{% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% load wagtailadmin_tags %}

{% block titletag %}{% blocktrans trimmed with title=parent_page.get_admin_display_title %}Create a page in {{ title }}{% endblocktrans %}{% endblock %}

{% block content %}
    {% trans "Create a page in" as create_str %}
    {% include "wagtailadmin/shared/header.html" with title=create_str subtitle=parent_page.get_admin_display_title icon="doc-empty-inverse" %}

    <div class="nice-padding">
        {% if page_types %}
            <p>{% trans "Choose which type of page you'd like to create." %}</p>
        {% else %}
            <p>{% trans "Sorry, you cannot create a page at this location." %}</p>
        {% endif %}

        {% if page_types %}
            <ul class="listing">
                {% for verbose_name, app_label, model_name, page_description in page_types %}
                    <li>
                        <div class="row row-flush">
                            <div class="col8">
                                <a href="{% url 'wagtailadmin_pages:add' app_label model_name parent_page.id %}{% if next %}?next={{ next }}{% endif %}" class="icon icon-plus-inverse icon-larger">
                                    {{ verbose_name }}
                                    {% if page_description %}
                                        <div><span class="visuallyhidden">.</span><small>{{ page_description }}</small></div>
                                    {% endif %}
                                </a>
                            </div>

                            <small class="col4" style="text-align:end">
                                <a href="{% url 'wagtailadmin_pages:type_use' app_label model_name %}" class="nolink">{% blocktrans trimmed with page_type=verbose_name %}Pages using {{ page_type }}{% endblocktrans %}</a>
                            </small>

                        </div>
                    </li>
                {% endfor %}
            </ul>
        {% endif %}
    </div>
{% endblock %}
