{% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% block titletag %}{% trans "Redirects" %}{% endblock %}

{% block extra_js %}
    {{ block.super }}
    <script>
        window.headerSearch = {
            url: "{% url 'wagtailredirects:index' %}",
            termInput: "#id_q",
            targetOutput: "#redirects-results"
        }
    </script>
{% endblock %}

{% block content %}
    {% trans "Redirects" as redirects_str %}
    {% trans "Add redirect" as add_str %}
    {% if user_can_add %}
        {% include "wagtailadmin/shared/header.html" with title=redirects_str icon="redirect" add_link="wagtailredirects:add" add_text=add_str search_url="wagtailredirects:index" %}
    {% else %}
        {% include "wagtailadmin/shared/header.html" with title=redirects_str icon="redirect" search_url="wagtailredirects:index" %}
    {% endif %}

    <div class="nice-padding">
        <div id="redirects-results" class="redirects">
            {% include "wagtailredirects/results.html" %}
        </div>
    </div>
    
{% endblock %}
