{% extends "base.html" %}

{% load i18n %}
{% load tags %}

{% block title %}
    {% if item %}
        {{ item.title }} – {% trans "Edit item" %}
    {% else %}
        {% trans "New item" %}
    {% endif %}
    – {{ block.super }}
{% endblock %}

{% block content %}
    <h1>
        {% if item %}
            {% trans "Edit item" %}
        {% else %}
            {% trans "New item" %}
        {% endif %}
        <small class="pull-right">
        <a href="{% url 'item_overview' %}" class="btn btn-mini"><i class="icon-chevron-left"></i> {% trans "Back to overview" %}</a>
        </small>
    </h1>
    <p>
        {% if item.related_sid %}
            <a href="{% model_url item.get_related_slide 'update' %}" class="btn btn-small">
                {% blocktrans with type=item.get_related_type|trans name=item.get_related_slide %}Edit {{ type }} {{ name }}{% endblocktrans %}
            </a>
        {% endif %}
    </p>
    <form action="" method="post">{% csrf_token %}
        {% include "form.html" %}
        <p>
        {% include "formbuttons_saveapply.html" %}
        <a href='{% url 'item_overview' %}' class="btn">
            {% trans 'Cancel' %}
        </a>
        </p>
        <small>* {% trans "required" %}</small>
    </form>
{% endblock %}
