{% extends 'base.html' %}
{% load staticfiles %}
{% load i18n %}
{% block button_bar %}
    {% if edit_url %}
        <a class="button primary" href="{{ edit_url }}"><span
                class="icon-pencil on-left"></span>{% trans 'edit'|capfirst %}</a>
    {% endif %}
    {% if not edit_user_hint %}
    <form method="post" id="toggleActiveForm" style="display: inline;">
        <input type="hidden" name="reload_url" value="{{ request.get_full_path }}"/>
        {% csrf_token %}
        {% if not object.is_active %}
            <a class="button" onclick="$('#toggleActiveForm').submit()"><span
                    class="icon-link on-left"></span>{% trans 'activate'|capfirst %}</a>
        {% else %}
            <a class="button" onclick="$('#toggleActiveForm').submit()"><span
                    class="icon-link-2 on-left"></span>{% trans 'deactivate'|capfirst %}</a>
        {% endif %}
    </form>
    {% endif %}
    {% if create_url %}
        <a href="{{ create_url }}" class="button"><span class="icon-plus on-left"></span>{% trans 'add'|capfirst %}</a>
    {% endif %}
{% endblock button_bar %}
{% comment %}
generalized detail view template
{% endcomment %}
{% block content %}
    <table class="table striped">
        <thead>
        <tr>
            <th colspan="2">
                {{ object }}
                &NonBreakingSpace;
                {% if not object.is_active %}
                    ({% trans 'inactive' %})
                {% endif %}
            </th>
        </tr>
        </thead>
        <tbody>
        {% for v in object_info %}
            <tr>
                <td>{{ v.0 }}</td>
                <td>
                    {% if v.1 %}
                        {# place related stuff (fk or file links) into links #}
                        {% if v.2 %}
                            {# fk provided? #}
                            {% if v.4 %}
                                <a href={% url v.3 pk=v.4 %}>{{ v.1 }}</a>
                            {% else %}
                                <a href="{{ v.3 }}">{{ v.1 }}</a>
                            {% endif %}
                        {% else %}
                            {{ v.1 }}
                        {% endif %}
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
        {% block extra_rows %}
        {% endblock extra_rows %}
        </tbody>
        <tfoot>
        <tr>
            <td colspan="2">
                {% trans 'last modified' %}: {{ last_modified }}
                <a onclick="window.open('{% url 'history_detail' %}?oid={{ object.id }}&ct={{ contentType }}', '', 'width=840, height=640')"
                   href=''>{% trans 'change history' %}</a>
            </td>
        </tr>
        </tfoot>
    </table>

    <!-- additional lists or tables for related objects -->
    <div style="margin-top: 25px;">
        {% block extra %}
        {% endblock extra %}
    </div>


{% endblock content %}



