{% extends "shatailadmin/base.html" %} {% load i18n shatailadmin_tags %} {% block titletag %}{% blocktrans trimmed with query=query.query_string %}Editing {{ query }}{% endblocktrans %}{% endblock %} {% block content %} {% trans "Editing" as editing_str
%} {% include "shatailadmin/shared/header.html" with title=editing_str subtitle=query.query_string icon="pick" %}

<form action="{% url 'shatailsearchpromotions:edit' query.id %}" method="POST" class="nice-padding" novalidate>
    {% csrf_token %}

    <ul class="fields">
        <li>
            {% include "shatailsearch/queries/chooser_field.html" with field=query_form.query_string only %}
        </li>
        <li>
            {% include "shatailsearchpromotions/includes/searchpromotions_formset.html" with formset=searchpicks_formset only %}
        </li>
        <li>
            <input type="submit" value="{% trans 'Save' %}" class="button" />
            <a href="{% url 'shatailsearchpromotions:delete' query.id %}" class="button button-secondary no">{% trans "Delete" %}</a>
        </li>
    </ul>
</form>
{% endblock %} {% block extra_css %} {{ block.super }} {% include "shatailadmin/pages/_editor_css.html" %} {{ form_media.css }} {% endblock %} {% block extra_js %} {{ block.super }} {% include "shatailadmin/pages/_editor_js.html" %}
<script src="{% versioned_static 'shatailsearch/js/query-chooser-modal.js' %}"></script>
{{ form_media.js }}

<script type="text/javascript">
    { % include "shatailsearchpromotions/includes/searchpromotions_formset.js"
        with formset = searchpicks_formset only %
    } { % include "shatailsearch/queries/chooser_field.js"
        only %
    }

    $(function() {
        createQueryChooser('{{ query_form.query_string.auto_id }}');
    });
</script>
{% endblock %}