{% extends "admin/base_site.html" %}

{% load i18n %}
{% load admin_urls %}
{% load static from staticfiles %}

{% block extrastyle %}
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/admin_timeline.css' %}" />
{% endblock extrastyle %}
{% block extrahead %}
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
<script src="{% static 'admin/js/core.js' %}"></script>
{#<script src="{% static 'admin/js/jquery.js' %}"></script>#}
<script src="{% static 'admin/js/jquery-1.10.2.min.js' %}"></script>
<script src="{% static 'admin/js/jquery.init.js' %}"></script>
<script src="{% static 'admin/js/admin_timeline.js' %}"></script>
<script type="text/javascript">
    //<!--
    adminTimeline_init("{{ last_date }}", {{ users|safe }}, {{ content_types|safe }}, "{{ start_date }}", "{{ end_date }}", "{% url 'admin_timeline.log' %}");
    //-->
</script>
{% endblock extrahead %}
{% block coltype %}colMS{% endblock %}

{% block bodyclass %}admin-timeline{% endblock %}

{% block content %}
<div id="content-main">
{% if admin_log %}
<ul id="admin-timeline" class="actionlist">
    {% include "admin_timeline/timeline_ajax.html" %}
</ul>
{% endif %}
</div>

<div id="content-related">

    <form class="admin-timeline-filter-form" action="." method="post">
        {% csrf_token %}
        {{ filter_form.as_table }}
        <button type="submit">{% trans "Filter" %}</button>
    </form>

    {% comment %}
    <div class="module filtered" id="admin-timeline-users">
        <h2>{% trans 'Filter by user' %}</h2>
        {% if not admin_log_users %}
        <p>{% trans 'None available' %}</p>
        {% else %}
        <div class="changelist-filter">
            
            <ul>
                {% for id,username in admin_log_users %}
                <li>
                   <a href="?user_id={{ id }}"{% if id == user_id %} class="selected"{% endif %}>{{ username }}</a>
                </li>
                {% endfor %}
            </ul>
        </div>
        {% endif %}
    </div>

    <div class="module filtered" id="admin-timeline-users">
        <h2>{% trans 'Filter by content type' %}</h2>
        {% if not admin_log_content_types %}
        <p>{% trans 'None available' %}</p>
        {% else %}
        <div class="changelist-filter">

            <ul>
                {% for id,name in admin_log_content_types %}
                <li>
                   <a href="?content_type_id={{ id }}"{% if id == content_type_id %} class="selected"{% endif %}>{{ name }}</a>
                </li>
                {% endfor %}
            </ul>
        </div>
        {% endif %}
    </div>
    {% endcomment %}

</div>
{% endblock content %}

