{% extends "admin/base_site.html" %}

{% block content %}
<form action="{{ form_url }}" method="post" id="edit_page_form" class="pylucid_form">
{% csrf_token %}
<p>
    <small>
    Note: A new page can only create the default system language.
    This is <strong>{{ default_lang_entry.description }}</strong>. You can translate it later.
    </small>
</p>
{% if not sites|length_is:"1" %}
<p>
    <small>This new content page will be create on site: '<strong>{{ current_site }}</strong>'.</small>
</p>
{% endif %}

{% if has_errors %}
    <fieldset><legend>{% trans 'Form errors:' %}</legend>
    {% for form in all_forms %}      
        {% include "admin/pylucid/includes/form_errorlist.html" %}
    {% endfor %}
    </fieldset>
{% endif %}

<fieldset>
    <legend>
        PluginContent - {% trans 'Language:' %} <strong>{{ default_lang_entry.description }}</strong>
    </legend>
    
    {% include "admin/pylucid/includes/buttons_save_abort.html" %}
    
    {% with pagecontent_form.content as field %}
    <div title="{{ field.help_text }}" class="field {{ field.html_name }}">
        <label for="{{ field.auto_id }}"{% if field.errors %} class="error"{% endif %}>
            {% if field.field.required %}<strong>{{ field.label }}</strong>{% else %}{{ field.label }}{% endif %}
            :       
            {% if field.errors %}
                {% for error in field.errors %}{{ error|escape }}{% endfor %}
            {% endif %}
        </label>
        {{ field }}
        <div class="field_help_text">{{ field.help_text }}</div>
    </div>
    {% endwith %}
    
    {% with pagecontent_form.markup as field %}
        {% include "admin/pylucid/includes/form_field.html" %}
    {% endwith %}
</fieldset>

<fieldset><legend>{% trans 'Language' %}: <strong>{{ default_lang_entry.description }}</strong></legend>
    <h2 class="form_collapse">PageMeta</h2>
    {% with pagemeta_form as form %}
        {% include "admin/pylucid/includes/pylucid_formset.html" %}
    {% endwith %}
</fieldset>

{% include "page_admin/includes/fieldsets_pagetree.html" %}

{% include "admin/pylucid/includes/buttons_save_abort.html" %}

</form>
{% endblock %}
