{% extends "admin/base_site.html" %}
{% load i18n admin_urls %}

{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
&rsaquo; {% translate 'History' %}
</div>
{% endblock %}

{% block content %}
<div id="content-main">
<div class="module">

{% if action_list %}
    <table id="change-history">
        <thead>
        <tr>
            <th scope="col">{% translate 'Date/time' %}</th>
            <th scope="col">{% translate 'User' %}</th>
            <th scope="col">{% translate 'Value' %}</th>
            <th scope="col">{% translate 'User Type' %}</th>
            <th scope="col">{% translate 'Tags' %}</th>
            <th scope="col">{% translate 'Help' %}</th>
            <th scope="col">{% translate 'Batch Changes' %}</th>
        </tr>
        </thead>
        <tbody>
        {% for action in action_list %}
        <tr>
            <th scope="row">{{ action.created_on|date:"DATETIME_FORMAT" }}</th>
            <td>
                {{ action.get_was_changed_display }}
                {{ action.get_by_user_display }}
                {{ action.user }}
            </td>
            <td><pre>{{ action.value }}</pre></td>
            <td>{{action.user_defined_type_display}}</td>
            <td>{% if action.tags %}<pre>{{action.tags}}</pre>{% endif %}</td>
            <td>{% if action.help %}<pre>{{action.help}}</pre>{% endif %}</td>
            <td><a href="{{ action.admin_url_batch_changes }}">{% translate 'Batch Changes' %}</a></td>
        </tr>
        {% endfor %}
        </tbody>
    </table>
{% else %}
    <p>{% translate "This object doesn’t have a change history. It probably wasn’t added via this admin site." %}</p>
{% endif %}
</div>
</div>
{% endblock %}
