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

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

{% block maincontent %}
 {% get_fieldset "category, image" from form as fieldset_common %}
 {% get_fieldset "headline_en, content_en" from form as fieldset_en %}
 {% get_fieldset "headline_en, content_en" from form as fieldset_en %}

 <form action="" method="post" enctype="multipart/formdata">
  <fieldset class="grid_12">
   <legend>{% if object.pk %}{% trans "Edit Article" %}{% else %}{% trans "Create Article" %}{% endif %}</legend>
   {% csrf_token %}
   {% with fieldset_common as form %}{% include "form.html" %}{% endwith %}
  </fieldset>
  <ul class="tabs grid_12">
   <li><a href="#de">{% trans "German" %}</a></li>
   <li><a href="#en">{% trans "English" %}</a></li>
  </ul>
  <div class="tab_container">
      <div id="de" class="tab_content">
            <h3 class="grid_12">Deutsch</h3>
            <label for="id_{{ form.headline_de.html_name }}" class="grid_2 {{ form.headline_de.css_classes }}">{{ form.headline_de.label }}</label>
            <p class="grid_10">{{ form.headline_de }}</p>
            <p>&nbsp;</p>
            {{ form.content_de }}
      </div>
      <div id="en" class="tab_content">
          <h3 class="grid_12">English</h3>
            <label for="id_{{ form.headline_en.html_name }}" class="grid_2 {{ form.headline_en.css_classes }}">{{ form.headline_en.label }}</label>
            <p class="grid_10">{{ form.headline_en }}</p>
            <p>&nbsp;</p>
            {{ form.content_en }}
      </div>
  </div>
  <p class="buttonbar">
   <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 %}

{% block javascript %}
    CKEDITOR.dtd.$removeEmpty['span'] = false;
    CKEDITOR.replace( 'id_content_de' );
    CKEDITOR.replace( 'id_content_en' );
{% endblock %}


{% block buttonbar %}{% endblock %}