{% load i18n wagtailadmin_tags %}
{% if last_edits %}
    <div class="panel nice-padding">{# TODO try moving these classes onto the section tag #}
        <section>
            <h2>{% trans "Your most recent edits" %}</h2>
            <table class="listing listing-page">
                <col />
                <col width="15%"/>
                <col width="15%"/>
                <thead>
                    <tr>
                        <th class="title">{% trans "Title" %}</th>
                        <th>{% trans "Date" %}</th>
                        <th>{% trans "Status" %}</th>
                    </tr>
                </thead>
                <tbody>
                    {% for revision in last_edits %}
                        <tr>
                            <td class="title" valign="top">
                                <h2>
                                    <a href="{% url 'wagtailadmin_pages:edit' revision.page.id %}" title="{% trans 'Edit this page' %}">{{ revision.page.title }}</a>

                                    {% include "wagtailadmin/pages/listing/_privacy_indicator.html" with page=revision.page %}
                                    {% include "wagtailadmin/pages/listing/_locked_indicator.html" with page=revision.page %}
                                </h2>
                                <ul class="actions">
                                    <li><a href="{% url 'wagtailadmin_pages:edit' revision.page.id %}" class="button button-small button-secondary">{% trans "Edit" %}</a></li>
                                    {% if revision.page.has_unpublished_changes %}
                                        <li><a href="{% url 'wagtailadmin_pages:view_draft' revision.page.id %}" class="button button-small button-secondary">{% trans 'Draft' %}</a></li>
                                    {% endif %}
                                    {% if revision.page.live %}
                                        <li><a href="{{ revision.page.url }}" class="button button-small button-secondary">{% trans 'Live' %}</a></li>
                                    {% endif %}
                                </ul>
                            </td>
                            <td valign="top"><div class="human-readable-date" title="{{ revision.created_at|date:"d M Y H:i" }}">{{ revision.created_at|timesince }} ago</div></td>
                            <td valign="top">
                                {% include "wagtailadmin/shared/page_status_tag.html" with page=revision.page %}
                            </td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </section>
    </div>
{% endif %}