mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Add complete revision and history handling in the wiki
This commit is contained in:
@ -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 %}
|
||||
|
||||
|
||||
|
19
core/templates/core/page_hist.html
Normal file
19
core/templates/core/page_hist.html
Normal 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 %}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user