{% extends "admin/object_history.html" %}
{% load pkinav %}
{% load media_url %}

{% block extrahead %}
<script type="text/javascript">var MEDIA_URL = "{% media_url %}";</script>
<link href="{% media_url %}pki/css/pki.css" type="text/css" media="screen" rel="stylesheet" /> 
{% endblock %}

{% block nav-global %}
    {% pkinav %}
{% endblock %}

{% block content %}
<div id="content-main">
<div class="module">
    <p />
    <table id="change-history">
        <thead>
        <tr>
            <th scope="col">Date/time</th>
            <th scope="col">User</th>
            <th scope="col">Action</th>
            <th scope="col">Changes</th>
        </tr>
        </thead>
        <tbody>
        {% if changelogs %}
        {% for c in changelogs %}
        <tr class="{% cycle 'row1' 'row2' %}">
            <th scope="row">{{ c.action_time|date:"DATETIME_FORMAT" }}</th>
            <td>{{ c.user.username }}{% if c.user.get_full_name %} ({{ c.user.get_full_name }}){% endif %}</td>
            <td>{{ c.action }}</td>
            <td>{{ c.changes }}</td>
        </tr>
        {% endfor %}
        {% else %}
        <tr>
            <th scope="row" colspan=4>No changelogs yet</th>
        </tr>
        {% endif %}
        </tbody>
    </table>
</div>
</div>
{% endblock %}
