{% extends "base.html" %}

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

{% block title %}
    {% if item %}
        {{ item }} – {% 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.content_object %}
            <a href="{{ item.content_object|absolute_url:'update' }}" class="btn btn-small">
                {% blocktrans with type=item.content_type.name|trans name=item.content_object %}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 %}
