{% load i18n wagtailadmin_tags %}
{% load l10n %}

<table class="listing">
    <col width="100%" />

    <thead>
        <tr>
            <th>
                <a href="{% url 'wagtailadmin_pages:revisions_index' page.id %}?ordering={% if ordering == "created_at" %}-{% endif %}created_at" class="icon icon-arrow-{% if ordering == "created_at" %}up-after{% elif ordering == "-created_at" %}down-after{% else %}down-after{% endif %} {% if ordering == "created_at" or ordering == "-created_at" %}teal{% endif %}">
                    {% trans 'Revision date' %}
                </a>
            </th>
        </tr>
    </thead>
    <tbody>
        {% if revisions %}
            {% page_permissions page as page_perms %}
            {% for revision in revisions %}
                <tr {% if revision == page.get_latest_revision %}class="index"{% endif %}>
                    <td class="title">
                        <div class="title-wrapper">
                            <a href="{% url 'wagtailadmin_pages:revisions_revert' page.id revision.id %}">{{ revision.created_at }}</a>
                            <span class="unbold">
                                {% trans 'by' context 'points to a user who created a revision' %}<span class="avatar small"><img src="{% avatar_url revision.user size=25 %}" alt="" /></span>{{ revision.user }}
                            </span>
                            {% if revision == page.get_latest_revision %}({% trans 'Current draft' %}){% endif %}
                            {% if revision == page.live_revision %}({% trans 'Live version' %}){% endif %}
                            {% if revision.approved_go_live_at %}({% trans 'Scheduled for' %} {{ revision.approved_go_live_at }}) {% endif %}
                        </div>

                        {% include "wagtailadmin/pages/revisions/_actions.html" %}
                    </td>
                </tr>
            {% endfor %}
        {% else %}
            {% block no_results %}<tr><td class="no-results-message"><p>{% trans 'No revisions of this page exist' %}</p></td></tr>{% endblock %}
        {% endif %}
    </tbody>
</table>
