{% extends "sphene/sphwiki/base.html" %}

{% load sph_extras %}
{% load sph_pagination %}

{% block head %}
  {{ block.super }}
  {% if sph_settings.wiki_rss_url %}
    <link rel="alternate" title="Latest Wiki Changes" href="{{ sph_settings.wiki_rss_url }}" type="application/rss+xml" />
  {% endif %}
{% endblock %}

{% block content %}

  <h1 class="wiki_title">Latest changes for this Wiki</h1><br/>

  <table class="sph_object_list">
    <tr>
      <th>Snip</th>
      <th>Date</th>
      <th>Editor</th>
      <th width="80%">Change Message</th>
    </tr>

    {% for change in object_list %}
      <tr{% if not change.snip.has_view_permission %} class="nopermission" title="Not enough permissions to view this wiki snip."{% endif %}>
        {% if change.snip.has_view_permission %}
          <td><a href="{{ change.snip.get_absolute_url }}">{{ change.snip.name }}</a></td>
          <td class="recentchanges_changedate"><a href="{{ change.get_absolute_url }}" title="Changes to Previous Version">{{ change.edited|sph_date }}</a></td>
        {% else %}
          <td>{{ change.snip.name }}</td>
          <td class="recentchanges_changedate">{{ change.edited|sph_date }}</td>
        {% endif %}
        <td class="recentchanges_editor">{% sph_html_user change.editor %}</td>
        <td>{{ change.message }}</td>
      </tr>
    {% endfor %}
  </table>

  {% if is_paginated %}
    {{ hits }} Changes. {% sph_pagination pages page %}
  {% else %}
    {{ object_list.count }} Changes.
  {% endif %}

{% endblock %}
