{% extends "base.html" %}
{% load i18n fieldset_extras %}

{% block title %}
    {% if object.pk %}{% trans "Edit Page" %}:  {{ page.title }}{% else %}{% trans "Add Page" %}{% endif %}
{% endblock %}

{% block extra_head %}
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.min.js"
        defer></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/language_tabs.js"
        defer></script>
{% endblock %}

{% block jumbotron_background %}{{STATIC_URL}}img/teaser/edit_page.jpg{% endblock %}

{% block teaser %}
    {% if object.pk %}<h1>{% trans 'Edit' %}{{ page.title }}</h1>
    {% else %}<h1>{% trans "Add Page" %}</h1>
    {% endif %}
{% endblock %}


{% block maincontent %}
{% get_fieldset "parent, slug, content_type, status" from form as fieldset_common %}
{% get_fieldset "menu_name_de, title_de, pdf_de" from form as fieldset_de %}
{% get_fieldset "menu_name_en, title_en, pdf_en" from form as fieldset_en %}
{% get_fieldset "template, enable_comments" from form as fieldset_html %}

<form method="post" enctype="multipart/form-data">
    {{ form.media }}

    <fieldset>
            {% csrf_token %}
            <legend>{% if object.pk %}{% trans "Edit Page" %}{% else %}{% trans "Add Page" %}{% endif %}</legend>
            {% with fieldset_common as form %}{% include "form.html" %}{% endwith %}
            <legend>{% trans "HTML Specific" %}</legend>
            {% with fieldset_html as form %}{% include "form.html" %}{% endwith %}
    </fieldset>

    <ul class="tabs">
        <li><a href="#de">{% trans "German" %}</a></li>
        <li><a href="#en">{% trans "English" %}</a></li>
    </ul>

    <div class="tab_container">
        <section id="de" class="tab_content">
            <fieldset class="grid_12">
                <legend>{% trans "German" %}</legend>
                {% with fieldset_de as form %}{% include "form.html" %}{% endwith %}
            </fieldset>
            <br>
            {{form.content_de}}
        </section>
        <section id="en" class="tab_content">
            <fieldset class="grid_12">
                <legend>{% trans "English" %}</legend>
                {% with fieldset_en as form %}{% include "form.html" %}{% endwith %}
            </fieldset>
            <br>
        {{form.content_en}}
        </section>
    </div>
 <p></p>
 <p class="buttonbar grid_12">
  <button type="reset"><span class="fa fa-undo"></span> {% trans 'reset' %}</button>
  <button type="submit"><span class="fa fa-hdd-o"></span> {% trans 'save' %}</button>
 </p>
</form>
{% endblock %}

