Add complete revision and history handling in the wiki

This commit is contained in:
Skia
2015-12-02 11:09:50 +01:00
parent 80926dd4ac
commit 92f68f5b42
8 changed files with 169 additions and 36 deletions

View File

@ -7,9 +7,16 @@
<p><a href="{% url 'core:page_edit' page.get_full_name %}">Edit</a></p>
<p><a href="{% url 'core:page_prop' page.get_full_name %}">Prop</a></p>
{% endif %}
<p>You're seeing the page <strong>{{ page.get_display_name }}</strong></p>
<h3>{{ page.title }}</h3>
<p>{{ page.content }}</p>
<p>You're seeing the page <strong>{{ page.get_display_name }}</strong> -
<a href="{% url 'core:page_hist' page.get_full_name %}">History</a></p>
{% if rev %}
<h4>This may not be the last update, you are seeing revision {{ rev.id }}!</h4>
<h3>{{ rev.title }}</h3>
<p>{{ rev.content }}</p>
{% else %}
<h3>{{ page.revisions.last.title }}</h3>
<p>{{ page.revisions.last.content }}</p>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,19 @@
{% extends "core/page.html" %}
{% block page %}
<h3>Page history</h3>
<p><a href="{% url 'core:page' page.get_full_name %}">Back to page</a></p>
<p>You're seeing the history of page <strong>{{ page.get_display_name }}</strong></p>
<ul>
<li><a href="{% url 'core:page' page_name=page.get_full_name %}">
last - {{ page.revisions.last.author }} - {{ page.revisions.last.date }}</a></li>
{% for r in page.revisions.all|dictsortreversed:'date'|slice:'1:' %}
<li><a href="{% url 'core:page_rev' page_name=page.get_full_name rev=r.id %}">
{{ r.author }} - {{ r.date }}</a></li>
{% endfor %}
</ul>
{% endblock %}