summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-19 18:00:57 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-19 18:00:57 +0100
commit681b44304d27f02aaf5b484dbcc842d70d0412c5 (patch)
treed1029171f525b2db17e31e595e719bd8ccca611b
parent1ce09b797cdff55127caf7ad78d3f4c9d7ff9c47 (diff)
downloadIshtar-681b44304d27f02aaf5b484dbcc842d70d0412c5.tar.bz2
Ishtar-681b44304d27f02aaf5b484dbcc842d70d0412c5.zip
Treatments/treatment files history: navigation between version and restore action (refs #3385)
-rw-r--r--archaeological_finds/templates/ishtar/sheet_treatment.html2
-rw-r--r--archaeological_finds/templates/ishtar/sheet_treatmentfile.html2
-rw-r--r--archaeological_finds/urls.py8
-rw-r--r--archaeological_finds/views.py2
4 files changed, 12 insertions, 2 deletions
diff --git a/archaeological_finds/templates/ishtar/sheet_treatment.html b/archaeological_finds/templates/ishtar/sheet_treatment.html
index 37688b267..9d6c75425 100644
--- a/archaeological_finds/templates/ishtar/sheet_treatment.html
+++ b/archaeological_finds/templates/ishtar/sheet_treatment.html
@@ -4,7 +4,7 @@
{% block head_title %}{% trans "Treatment" %}{% endblock %}
{% block content %}
-{% window_nav item window_id 'show-treatment' 'treatment_modify' %}
+{% window_nav item window_id 'show-treatment' 'treatment_modify' 'show-historized-treatment' 'revert-treatment' previous next 1 %}
{% if item.image %}
<a href='{{item.image.url}}' rel="prettyPhoto" title="{{item.label}}" class='photo'><img src='{{item.thumbnail.url}}'/></a>
diff --git a/archaeological_finds/templates/ishtar/sheet_treatmentfile.html b/archaeological_finds/templates/ishtar/sheet_treatmentfile.html
index 81311deb8..b84f60883 100644
--- a/archaeological_finds/templates/ishtar/sheet_treatmentfile.html
+++ b/archaeological_finds/templates/ishtar/sheet_treatmentfile.html
@@ -4,7 +4,7 @@
{% block head_title %}{% trans "Treatment request" %}{% endblock %}
{% block content %}
-{% window_nav item window_id 'show-treatmentfile' 'treatmentfile_modify' %}
+{% window_nav item window_id 'show-treatmentfile' 'treatmentfile_modify' 'show-historized-treatmentfile' 'revert-treatmentfile' previous next 1 %}
<p class="window-refs">{{ item.name|default:"" }}</p>
{% if item.internal_reference %}
diff --git a/archaeological_finds/urls.py b/archaeological_finds/urls.py
index 9c554a124..06d505896 100644
--- a/archaeological_finds/urls.py
+++ b/archaeological_finds/urls.py
@@ -284,6 +284,10 @@ urlpatterns += patterns(
kwargs={'full': 'shortcut'}),
url(r'^show-treatment(?:/(?P<pk>.+))?/(?P<type>.+)?$', 'show_treatment',
name=models.Treatment.SHOW_URL),
+ url(r'show-historized-treatment/(?P<pk>.+)?/(?P<date>.+)?$',
+ 'show_treatment', name='show-historized-treatment'),
+ url(r'^revert-treatment/(?P<pk>.+)/(?P<date>.+)$',
+ 'revert_treatment', name='revert-treatment'),
url(r'get-treatmentfile/(?P<type>.+)?$',
'get_treatmentfile', name='get-treatmentfile'),
url(r'get-treatmentfile-shortcut/(?P<type>.+)?$',
@@ -292,6 +296,10 @@ urlpatterns += patterns(
url(r'^show-treatmentfile(?:/(?P<pk>.+))?/(?P<type>.+)?$',
'show_treatmentfile',
name=models.TreatmentFile.SHOW_URL),
+ url(r'show-historized-treatmentfile/(?P<pk>.+)?/(?P<date>.+)?$',
+ 'show_treatmentfile', name='show-historized-treatmentfile'),
+ url(r'^revert-treatmentfile/(?P<pk>.+)/(?P<date>.+)$',
+ 'revert_treatmentfile', name='revert-treatmentfile'),
# url(r'show-treatmentfile(?:/(?P<pk>.+))?/(?P<type>.+)?$',
# 'show_treatmentfile',
# name=models.TreatmentFile.SHOW_URL),
diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py
index 341734ae7..0b9cb8952 100644
--- a/archaeological_finds/views.py
+++ b/archaeological_finds/views.py
@@ -58,6 +58,7 @@ get_find_for_treatment = get_item(
own_table_cols=models.Find.TABLE_COLS_FOR_OPE, base_request={})
show_treatment = show_item(models.Treatment, 'treatment')
+revert_treatment = revert_item(models.Treatment)
get_treatment = get_item(models.Treatment, 'get_treatment', 'treatment')
get_administrativeacttreatment = get_item(
@@ -66,6 +67,7 @@ get_administrativeacttreatment = get_item(
base_request={"treatment__pk__isnull": False})
show_treatmentfile = show_item(models.TreatmentFile, 'treatmentfile')
+revert_treatmentfile = revert_item(models.TreatmentFile)
get_treatmentfile = get_item(models.TreatmentFile, 'get_treatmentfile',
'treatmentfile')