{% extends 'forgewiki:templates/wiki/master.html' %}
{% from 'allura:templates/jinja_master/lib.html' import abbr_date with context %}

{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / {{title}}{% endblock %}

{% block header %}{{title}}{% endblock %}

{% block actions %}
  <a href="." title="View Page"><b data-icon="{{g.icons['search'].char}}" class="ico {{g.icons['search'].css}}" title="View Page"></b></a>
{% endblock %}

{% block wiki_content %}
{{c.page_size.display(limit=limit,count=count,page=page)}}
<form method="get" action="diff">
  <div class="grid-19"><input type="submit" value="Compare revisions"/></div>
  <div style="clear:both"></div>
  <table>
    <thead>
      <tr>
        <th>Version</th>
        <th>Date</th>
        <th>V1</th>
        <th>V2</th>
        <th>&nbsp;</th>
      </tr>
    </thead>
    <tbody>
      {% set i = 0 %}
      {% for p in pages %}
        <tr>
          <td>{{p.version}} by {{p.author.display_name}}</td>
          <td>{{abbr_date(p.mod_date)}}</td>
          <td><input name="v1" type="radio" value="{{p.version}}"/></td>
          <td><input name="v2" type="radio" value="{{p.version}}"/></td>
          <td class="tright">
            {% if i != 0 and h.has_access(p, 'edit')() %}
              <a class="post-link" href="./revert?version={{p.version}}"><b data-icon="{{g.icons['fork'].char}}" class="ico {{g.icons['fork'].css}}" title="Revert to version {{p.version}}"></b></a>
            {% endif %}
            <a href="./?version={{p.version}}"><b data-icon="{{g.icons['search'].char}}" class="ico {{g.icons['search'].css}}" title="View Revision"></b></a>
          </td>
        </tr>
        {% set i = i+1 %}
      {% endfor %}
    </tbody>
  </table>
</form>
{{c.page_list.display(limit=limit, page=page, count=count)}}
{% endblock %}
