{% extends 'djiki/base_page.html' %}
{% load i18n djiki_tags %}
{% block title %}{% trans "Edit page" %}: {{ block.super }}{% endblock %}
{% block djiki_main %}
<div class="djiki-page djiki-page--edit">
  <div class="djiki-page-content djiki-page-content--preview">
    <h1 class="djiki-page-title">{{ page.title }}</h1>
    {% if preview_content %}
    {{ preview_content|djiki_markup }}
    {% endif %}
  </div>
  <div class="djiki-page-edit">
    <form action="" method="post" class="form form-horizontal djiki-form djiki-form--page-edit">
      {% csrf_token %}
      <fieldset>
      {% for field in form %}
        {% if not field.is_hidden %}
        <div class="grid_1 alpha label">
        {{ field.label_tag }}
        </div>
        <div class="grid_11 omega field">
        {% if field.errors %}{{ field.errors }}{% endif %}
        {{ field }}
        </div>
        {% else %}
        {{ field }}
        {% endif %}
      {% endfor %}
      </fieldset>
      <div class="djiki-form-buttons">
        <button class="save" type="submit" name="action" value="save">{% trans "Save" %}</button>
        <button class="preview" type="submit" name="action" value="preview">{% trans "Preview" %}</button>
      </div>
    </form>
  </div>
</div>
{% endblock %}
