{% extends "two_column_body.html" %}
{% import "macros.html" as macros %}
<!-- revisions.html -->
{% block title %}{% filter trim %}{% trans %}Revision history{% endtrans %}{% endfilter %}{% endblock %}
{% block layout_class %}revisions-page{% endblock %}
{% block content %}
  <h1>
    {% trans %}Revision history{% endtrans %}&nbsp;
    [<a href="{{ post.get_absolute_url() }}">{% trans %}back{% endtrans %}</a>]
  </h1>
  <div class="revisions-list">
    {% for revision in revisions %}
      <div class="js-revision{% if loop.first %} js-active{% endif %}">
        <div class="revision-header">
          <div class="revision-number with-caret-right-icon">
            {% trans rev=revision.revision %}Revision {{ rev }}{% endtrans %}
          </div>
          <div class="revision-author">
            {% if revision.revision == 1 %}
              {% set contributor_type = "original_author" %}
            {% else %}
              {% set contributor_type = "last_updater" %}
            {% endif %}
            {{ macros.post_contributor_info(revision, contributor_type) }}
          </div>
        </div>
        <div class='js-revision-body' {% if loop.first %}style="display: block"{% endif %}>
          {{ revision.diff }}
        </div>
      </div>
    {% endfor %}
  </div>
{% endblock %}

{% block endjs %}
  {% compress js %}
    <script src="{{ '/jslib/editor.js'|media }}"></script>
    <script src="{{ '/jslib/highlight.min.js'|media }}"></script>
    <script src="{{ '/js/utils/toggle.js'|media }}"></script>
    <script src="{{ '/js/utils/expander_toggle.js'|media }}"></script>
    <script src="{{ '/js/pages/revisions.js'|media }}"></script>
  {% endcompress %}
{% endblock %}
