kb: add history system (#7915)

This commit is contained in:
Frédéric Péters 2015-07-23 12:30:07 +02:00
parent fbfd9c2894
commit fefc0aa1f4
4 changed files with 43 additions and 0 deletions

View File

@ -3,3 +3,4 @@ gadjo
django-select2
django-ckeditor
django-haystack
django-reversion

View File

@ -102,6 +102,7 @@ setup(
'django-select2',
'django-ckeditor',
'django-haystack',
'django-reversion',
],
zip_safe=False,
cmdclass={

View File

@ -0,0 +1,17 @@
{% extends "kb/base.html" %}
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Knowledge Base' %} - {{ object.title }}</h2>
<a href="{% url 'kb-page-view' slug=object.slug %}">{% trans 'Back to page' %}</a>
{% endblock %}
{% block content %}
<ul>
{% for version in versions_list %}
<li>{{ version.revision.date_created }}, <a href="{% url 'kb-page-version' slug=object.slug version=version.id %}">{% trans 'view' %}</a></li>
{% endfor %}
</ul>
{% endblock %}

View File

@ -0,0 +1,24 @@
{% extends "kb/page_detail.html" %}
{% load i18n %}
{% block appbar %}
<h2>{% trans 'Knowledge Base' %} - {{ object.title }}</h2>
<a href="{% url 'kb-page-view' slug=object.slug %}">{% trans 'Back to page' %}</a>
<a href="{% url 'kb-page-history' slug=object.slug %}">{% trans 'History' %}</a>
{% endblock %}
{% block content %}
<p>
{% trans 'Warning: this is an old version of this page.' %}
</p>
<form method="POST">
{% csrf_token %}
<button>{% trans 'Revert to this version' %}</button>
</form>
{{block.super}}
{% endblock %}