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

{% block titletag %}{% trans "Add site" %} {{ site.hostname }}{% endblock %}
{% block bodyclass %}menu-sites{% endblock %}

{% block content %}

    {% trans "Add site" as add_site_str %}
    {% include "wagtailadmin/shared/header.html" with title=add_site_str icon="site" %}

    <form action="{% url 'wagtailsites_create' %}" method="POST">
        {% csrf_token %}
        <div class="nice-padding">
            <ul class="fields">
                {% include "wagtailadmin/shared/field_as_li.html" with field=form.hostname %}
                {% include "wagtailadmin/shared/field_as_li.html" with field=form.port %}

                <li>
                    {% trans "Choose a different root page" as choose_another_text_str %}
                    {% trans "Choose a root page" as choose_one_text_str %}
                    {% if form.instance.root_page %}
                        {% include "wagtailadmin/edit_handlers/page_chooser_panel.html" with field=form.root_page page=form.instance.root_page is_chosen=True choose_one_text_str=choose_one_text_str choose_another_text_str=choose_another_text_str only %}
                    {% else %}
                        {% include "wagtailadmin/edit_handlers/page_chooser_panel.html" with field=form.root_page is_chosen=False choose_one_text_str=choose_one_text_str choose_another_text_str=choose_another_text_str only %}
                    {% endif %}
                </li>

                {% include "wagtailadmin/shared/field_as_li.html" with field=form.is_default_site %}
               
                <li><input type="submit" value="{% trans 'Save' %}" /></li>
            </ul>
        </div>
    </form>
{% endblock %}
{% block extra_js %}
    {% include "wagtailadmin/pages/_editor_js.html" %}

    <script type="text/javascript">
        {% include "wagtailsites/includes/site_form.js" %}
    </script>
{% endblock %}
