{% load i18n %}

<h2>{% trans 'Data' %}</h2>

<form action="{% url lfs_manage_category_edit_data category.id %}"
      method="post"
      class="category-data-form"
      enctype="multipart/form-data">
    {% csrf_token %}

    <fieldset>
        <legend>{% trans "General" %}</legend>
        <div class="field">
            <div class="label">
                {{ form.exclude_from_navigation.label_tag }}:
            </div>
            <div>
                {{ form.exclude_from_navigation }}
            </div>
        </div>
        <div class="field">
            <div class="label">
                {{ form.name.label_tag }}:
            </div>
            {% if form.name.errors %}
                <div class="error">
                    {{ form.name }}
                    {{ form.name.errors }}
                </div>
            {% else %}
                <div>
                    {{ form.name }}
                </div>
            {% endif %}
        </div>
        <div class="field">
            <div class="label">
                {{ form.slug.label_tag }}:
            </div>
            {% if form.slug.errors %}
                <div class="error">
                    {{ form.slug }}
                    {{ form.slug.errors }}
                </div>
            {% else %}
                <div>
                    {{ form.slug }}
                </div>
            {% endif %}
        </div>
    </fieldset>
    <fieldset>
        <legend>{% trans "Content" %}</legend>
            <div class="field">
                <div class="label">
                    {{ form.description.label_tag }}:
                </div>
                {% if form.description.errors %}
                    <div class="error">
                        {{ form.description }}
                        {{ form.description.errors }}
                    </div>
                {% else %}
                    <div>
                        {{ form.description }}
                    </div>
                {% endif %}
            </div>
            <div class="field">
                <div class="label">
                    {% trans "Image" %}
                </div>
                {% if form.image.errors %}
                    <div class="error">
                        {{ form.image }}
                        {{ form.image.errors }}
                    </div>
                {% else %}
                    <div>
                        {{ form.image }}
                    </div>
                {% endif %}
            </div>
            <div class="field">
                <div class="label">
                    {{ form.static_block.label_tag }}:
                </div>
                {% if form.static_block.errors %}
                    <div class="error">
                        {{ form.static_block }}
                        {{ form.static_block.errors }}
                    </div>
                {% else %}
                    <div>
                        {{ form.static_block }}
                    </div>
                {% endif %}
            </div>
    </fieldset>

    <div class="buttons">
        <input value="{% trans 'Save data' %}"
               type="submit"
               class="category-data-save-button button"/>
    </div>
</form>
