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

{% block page__menu %}cur{% endblock %}

{% block content %}
<div class="title">
  <h2>{% trans 'Страница' %} {{ form.title_ru.value }}</h2>
  <h3><a href="{{ tanker_admin_url }}" class="link">{% trans 'Страницы в Танкере' %}</a></h3>
</div>

{% if messages %}
<div>
  {% for message in messages %}
  <p class="{{ message.tags }}">{{ message }}</p>
  {% endfor %}
</div>
{% endif %}

<form action="" method="post">

{% csrf_token %}

<table class="g g_padding-t_XL g_gap_L">

  <tr>
    <td class="c">
    <td class="c">
      <div class="b b_middle b_gap-x_XS">

        <div class="c">
          <button class="button button_size_L button_type_action" name="status" value="{{ page_translation_model.STATUS_DRAFT }}" type="submit">
            <span class="button__label">{% trans "Сохранить" %}</span>
          </button>
        </div>

        {% block upload_button %}
        <div class="c">
          <button class="button button_size_L button_type_action" name="status" value="{{ page_translation_model.STATUS_UPLOADED }}" type="submit">
            <span class="button__label">{% trans "Отправить в Танкер" %}</span>
          </button>
        </div>
        {% endblock upload_button %}

        {% block download_button %}
        <div class="c">
          <button class="button button_size_L button_type_action button_disable_yes" name="status" value="{{ page_translation_model.STATUS_DOWNLOADED }}" type="submit">
            <span class="button__label">{% trans "Загрузить из Танкера" %}</span>
          </button>
        </div>
        {% endblock download_button %}

        {% block publish_button %}
        <div class="c">
          <button class="button button_size_L button_type_action button_disable_yes" name="status" value="{{ page_translation_model.STATUS_PUBLISHED }}" type="submit">
            <span class="button__label">{% trans "Опубликовать" %}</span>
          </button>
        </div>
        {% endblock publish_button %}

        <div class="c">
          <a href="{% url 'page:list' %}" class="button button_size_L button_type_normal">
            <span class="button__label">{% trans "Отмена" %}</span>
          </a>
        </div>

      </div>

    <td class="c c_right">


  <tr>
    <td class="c"><label class="label label_forms label_forms_min label_L">{% trans "Тип страницы" %}</label>
    <td class="c" colspan="2">

      {% block slug_field %}
      {% endblock slug_field %}


  <tr>
    <td class="c"><label class="label label_forms label_forms_min label_L">{% trans "Порядковый номер" %}</label>
    <td class="c" colspan="2">

      <span class="input input_size_L w550 {% if form.order.errors %}error{% endif %}">
        <input name="{{ form.order.html_name }}" value="{{ form.order.value|default_if_none:'' }}" class="input__input"> 
      </span>

      {% if form.order.errors %}
      <span class="error-forms">{{ form.order.errors }}</span>
      {% endif %}


  <tr>
    <td class="c"><label class="label label_forms label_forms_min label_L">{% trans "Заголовок" %}</label>
    <td class="c" colspan="2">

      <span class="input input_size_L w550 {% if form.title_ru.errors %}error{%endif%}">
        <input name="{{ form.title_ru.html_name }}" value="{{ form.title_ru.value|default_if_none:'' }}" class="input__input">
      </span>

      {% if form.title_ru.errors %}
      <span class="error-forms">{{ form.title_ru.errors }}</span>
      {% endif %}


  <tr>
    <td class="c"><label class="label label_forms label_forms_min label_L">{% trans "Перевод" %}</label>
    <td class="c" colspan="2">

    {% block title_en_field %}
      <span class="input input_size_L w550 input_disable_yes">
        <input class="input__input" disabled>{{ title_translation }}</input>
      </span>
    {% endblock title_en_field %}


  <tr>
    <td class="c"><label class="label label_forms label_forms_min label_L">{% trans "Содержание" %}</label>
    <td class="c" colspan="2">

      <span class="textarea textarea_size_L w765 {% if form.text_ru.errors %}error{%endif%}">
        <textarea name="{{ form.text_ru.html_name }}" rows="18" class="textarea__textarea">{{ form.text_ru.value|default_if_none:'' }}</textarea>
      </span>

      {% if form.text_ru.errors %}
      <span class="error-forms">{{ form.text_ru.errors }}</span>
      {% endif %}


  <tr>
    <td class="c"><label class="label label_forms label_forms_min label_L">{% trans "Перевод" %}</label>
    <td class="c">

    {% block text_en_field %}
      <span class="textarea textarea_size_L w765 input_disable_yes">
        <textarea class="textarea__textarea" rows="18" disabled>{{ text_translation }}</textarea>
      </span>
    {% endblock text_en_field %}


</table>
</form>

{% endblock content %}
