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 + archaeological_finds/templates/ishtar/sheet_find.html | 14 ++++++++++++++ .../templates/ishtar/sheet_operation.html | 15 +++++++++++++++ archaeological_operations/urls.py | 2 ++ 6 files changed, 48 insertions(+) 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', diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 223e07415..da1e91cc5 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -2,6 +2,20 @@ {% 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 "Find"%}

diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index fd4c4d021..06c30b9e7 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -1,7 +1,22 @@ {% 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 "General"%}

{% if item.common_name %}

{{ item.common_name }}

{% endif %}

{{ item.year }}

diff --git a/archaeological_operations/urls.py b/archaeological_operations/urls.py index 0da649d2d..13a2c5c35 100644 --- a/archaeological_operations/urls.py +++ b/archaeological_operations/urls.py @@ -67,6 +67,8 @@ urlpatterns += patterns('archaeological_operations.views', 'revert_operation', name='revert-operation'), url(r'show-operation/(?P.+)?/(?P.+)?$', 'show_operation', name='show-operation'), + url(r'show-historized-operation/(?P.+)?/(?P.+)?$', + 'show_operation', name='show-historized-operation'), url(r'get-administrativeactop/(?P.+)?$', 'get_administrativeactop', name='get-administrativeactop'), url(r'get-operationsource/(?P.+)?$', -- cgit v1.2.3