{% extends "admin/change_form.html" %}
{% load i18n admin_modify adminmedia pages_tags %}

{% block title %}{% trans "Edit" %}{% endblock %}

{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="{% admin_media_prefix %}js/urlify.js"></script>
<script type="text/javascript" src="../jsi18n/"></script>
{% endblock %}

{% block content %}
<!-- Content -->
<div id="content-main">
    {% block object-tools %}
        {% if change and not is_popup %}
            <ul class="object-tools">
                {% if has_absolute_url %}<li><a href="{{ page.get_absolute_url }}" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif %}
            </ul>
        {% endif %}
    {% endblock %}
    
    <form id="page_form" {% if has_file_field %}enctype="multipart/form-data" {% endif %} action="?language={{ request.GET.language }}{%if request.GET.target %}&amp;target={{ request.GET.target }}{% endif %}&amp;{%if request.GET.target %}position={{ request.GET.position }}{% endif %}" method="post">
        <div class="sidebar">
        {% for fieldset in adminform %}
            {% include "admin/pages/page/includes/fieldset.html" %}
            
            {% if forloop.first %}
                {% if not add %}
                <fieldset class="module module-translation-helper aligned">
                    <h2>{% trans "Translation helper" %}</h2>
                    <div class="form-row">
                        <label for="translation-helper-select" class="required">{% trans "Language:" %}</label>
                        <select id="translation-helper-select">
                            <option value="" selected="selected">---------</option>
                            {% for lang in traduction_languages %}
                                <option value="{{ lang.0 }}">{{ lang.1 }}</option>
                            {% endfor %}
                        </select>
                        {% comment %}A little "smart" trick here to have this right column{% endcomment %}
                        <div id="translation-helper-content"></div>
                    </div>
                </fieldset>
                {% endif %}
                
                </div><div class="content">
            {% endif %}
        {% endfor %}
        </div>

        {% for inline_admin_formset in inline_admin_formsets %}
            {% include inline_admin_formset.opts.template %}
        {% endfor %}
        
        {% submit_row %}
    </form>
</div>
<script type="text/javascript" charset="utf-8">
<!--
(function() {
    /* Hide the Sites options if not needed */
    {% if not PAGE_USE_SITE_ID %}
        $('.form-row.sites').hide();
        $('#id_sites')[0].selectedIndex = 0;
    {% endif %}
})();
-->
</script>
<!-- END Content -->
{% endblock %}
