From cbbfef7f1ac2b4252c2818d707bbfa21bc855433 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 18 Sep 2013 23:31:21 +0200 Subject: Add history navigation for operations, context records and finds (refs #1401) --- .../templates/ishtar/sheet_contextrecord.html | 12 ++++++++++++ archaeological_context_records/urls.py | 4 ++++ archaeological_context_records/views.py | 1 + 3 files changed, 17 insertions(+) (limited to 'archaeological_context_records') diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html index 355e76abc..8356d789d 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html @@ -1,6 +1,18 @@ {% extends "ishtar/sheet.html" %} {% load i18n %} {% block content %} +{% if previous or next %} +
+{%if previous%} +{%trans "Previous version"%} ({{previous}}) +{% endif %} +{% if previous and next %} - {% endif %} +{%if next%} +Rollback - +{%trans "Next version"%} ({{next}}) +{% endif %} +
+{% endif %}
{%trans "Export as:"%} {%trans "OpenOffice.org file"%}, {%trans "PDF file"%}

{% trans "Context Record"%}

diff --git a/archaeological_context_records/urls.py b/archaeological_context_records/urls.py index 0ac1566ac..772938b81 100644 --- a/archaeological_context_records/urls.py +++ b/archaeological_context_records/urls.py @@ -45,6 +45,10 @@ urlpatterns = patterns('', urlpatterns += patterns('archaeological_context_records.views', url(r'show-contextrecord/(?P.+)?/(?P.+)?$', 'show_contextrecord', name='show-contextrecord'), + url(r'show-historized-contextrecord/(?P.+)?/(?P.+)?$', + 'show_contextrecord', name='show-historized-contextrecord'), + url(r'revert-contextrecord/(?P.+)/(?P.+)$', + 'revert_contextrecord', name='revert-contextrecord'), url(r'get-contextrecord/(?P.+)?$', 'get_contextrecord', name='get-contextrecord'), url(r'get-contextrecord-full/(?P.+)?$', diff --git a/archaeological_context_records/views.py b/archaeological_context_records/views.py index 8f56182ff..7f42866d8 100644 --- a/archaeological_context_records/views.py +++ b/archaeological_context_records/views.py @@ -26,6 +26,7 @@ from forms import * import models show_contextrecord = show_item(models.ContextRecord, 'contextrecord') +revert_contextrecord = revert_item(models.ContextRecord) get_contextrecord = get_item(models.ContextRecord, 'get_contextrecord', 'contextrecord', extra_request_keys={'parcel__town':'parcel__town__pk', -- cgit v1.2.3