{% load i18n %}

{% if saved_search %}
    <div class="page-header">
        <form action="{{ form_action }}" method="post" class="pull-right">
            {% csrf_token %}
            <input type="hidden" name="querystring" value="{{ querystring }}" />
            <input type="hidden" name="p" value="{{ page }}" />
            <input type="hidden" name="s" value="{% if sort %}{{ sort }}{% endif %}" />

            <input type="hidden" name="saved_search" value="{{ saved_search.pk }}" />
            {% if saved_search.default %}
                <button type="submit" name="_unset" class="btn btn-default btn-xs">{% trans "Unset Default" %}</button>
            {% else %}
                <button type="submit" name="_default" class="btn btn-default btn-xs">{% trans "Set as Default" %}</button>
            {% endif %}
            <button type="submit" name="_delete" class="btn btn-danger btn-xs"><span class="fa fa-times" aria-hidden="true"></span> {% trans "Delete Search" %}</button>
        </form>
        {% block saved-search-header %}<h1>{{ saved_search }} {% if saved_search.default %} (default){% endif %}</h1>{% endblock saved-search-header %}
    </div>
{% endif %}
