{% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% block titletag %}{% trans "Add redirect" %}{% endblock %}
{% block content %}
    {% trans "Add redirect" as add_red_str %}
    {% include "wagtailadmin/shared/header.html" with title=add_red_str icon="redirect" %}

    {% if form.non_field_errors %}
        <div class="messages">
            <ul>
                {% for error in form.non_field_errors %}
                    <li class="error">{{ error }}</li>
                {% endfor %}
            </ul>
        </div>
    {% endif %}

    <form action="{% url 'wagtailredirects:add' %}" method="POST" class="nice-padding" novalidate>
        {% csrf_token %}

        <ul class="fields">
            {% for field in form.visible_fields %}
                {% include "wagtailadmin/shared/field_as_li.html" %}
            {% endfor %}

            <li>
                <input type="submit" value="{% trans 'Save' %}" class="button" />
            </li>
        </ul>
    </form>

{% endblock %}

{% block extra_js %}
    {{ block.super }}
    {% include "wagtailadmin/pages/_editor_js.html" %}
{% endblock %}
