{% extends "wiki/base.html" %}
{# L10n: {n} is the revision number, {t} is the title of the document. {c} is the category. #}
{% set title = _('Revision {n} | {t} | {c}')|f(n=revision.id, t=document.title, c=document.get_category_display()) %}
{% block title %}{{ page_title(title) }}{% endblock %}
{% set meta = [('robots', 'noindex, nofollow')] %}
{% set classes = 'document' %}

{% block content %}

  <article>
    <h1>{{ document.title }}</h1>

    <details class="h2" open="open">
      <summary class="hidden">{{ _('Revision Information') }}</summary>
      <div class="revision-info">
        <ul>
          <li>
            <mark>{{ _('Revision slug:') }}</mark>
            <span>{{ revision.slug }}</span>
          </li>
          <li>
            <mark>{{ _('Revision title:') }}</mark>
            <span>{{ revision.title }}</span>
          </li>
          <li class="revision-id">
            <mark>{{ _('Revision id:') }}</mark>
            <span>{{ revision.id }}</span>
          </li>
          <li class="revision-created">
            <mark>{{ _('Created:') }}</mark>
            <span>{{ datetimeformat(revision.created, format='datetime') }}</span>
          </li>
          <li>
            <mark>{{ _('Creator:') }}</mark>
            <span>{{ revision.creator }}</span>
            {{ ban_link(revision.creator, request.user) }}
          </li>
          <li>
            <mark>{{ _('Is current revision?') }}</mark>
            <span>{{ (revision == document.current_revision)|yesno }}</span>
          </li>
          <li>
            <mark>{{ _('Comment') }}</mark>
            <span>{{ comment }}</span>
          </li>
          {#
          {% if user.is_authenticated() %}
            <li><a href="{{ url('wiki.new_revision_based_on', document.slug, revision.id) }}">{{ _('Edit article based on this revision') }}</a></li>
          {% endif %}
          #}
        </ul>
      </div>
    </details>

    <details><div class="wiki-block">
      <h2><summary>{{ _('Revision Content') }}</summary></h2>
      <article id="wikiArticle" class="text-content">
        {{ revision.content_cleaned|safe }}
      </article>
    </div></details>

    <details><div class="wiki-block">
      <h2><summary>{{ _('Revision Source') }}</summary></h2>
      <div id="doc-source">
        <pre class="brush:html">{{ revision.content }}</pre>
      </div>
    </div></details>

    <a href="{{ url('wiki.revert_document', document.full_path, revision.id) }}" class="button">{{ _('Revert to this revision') }}</a>
  </article>
{% endblock %}
