summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-01-04 16:20:11 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-01-11 17:30:46 +0100
commita87eb643c09fb8af86c0b7198cccd097eef1aac6 (patch)
tree4724ae36d28c7e7dd492afaaca9442102861f1e8 /archaeological_finds
parent4dd953b8327d684107b6485cef2fb69cd7663603 (diff)
downloadIshtar-a87eb643c09fb8af86c0b7198cccd097eef1aac6.tar.bz2
Ishtar-a87eb643c09fb8af86c0b7198cccd097eef1aac6.zip
Sheet: only display window link when permissions are OK
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/templates/ishtar/sheet_find.html6
-rw-r--r--archaeological_finds/templates/ishtar/wizard/wizard_findbasket_deletion.html4
-rw-r--r--archaeological_finds/templates/ishtar/wizard/wizard_treatement_deletion.html2
-rw-r--r--archaeological_finds/tests.py21
4 files changed, 27 insertions, 6 deletions
diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html
index 1ff5e21f4..3036c2cb6 100644
--- a/archaeological_finds/templates/ishtar/sheet_find.html
+++ b/archaeological_finds/templates/ishtar/sheet_find.html
@@ -291,7 +291,7 @@
<td class='string'>{{ treatment.label|default_if_none:"-" }}</td>
<td class='string'>{{ treatment.treatment_types_lbl }}</td>
<td class='string'>{{ treatment.treatment_state|default_if_none:"-" }}</td>
- <td class='item-list'>{% for it in treatment.limited_finds %}<span>{{it}} {{it|link_to_window}}</span>{% endfor %}</td>
+ <td class='item-list'>{% for it in treatment.limited_finds %}<span>{{it}} {{it|link_to_window:request}}</span>{% endfor %}</td>
<td class='string'>{{ treatment.person|default_if_none:"-" }}</td>
<td class='string'>{{ treatment.container|default_if_none:"-" }}</td>
<td class='string'>{{ treatment.start_date|default_if_none:"-" }}</td>
@@ -328,7 +328,7 @@
<td class='string'>{{ treatment.label|default_if_none:"-" }}</td>
<td class='string'>{{ treatment.treatment_types_lbl }}</td>
<td class='string'>{{ treatment.treatment_state|default_if_none:"-" }}</td>
- <td class='item-list'>{% for it in items %}<span>{{it}} {{it|link_to_window}}</span>{% endfor %}</td>
+ <td class='item-list'>{% for it in items %}<span>{{it}} {{it|link_to_window:request}}</span>{% endfor %}</td>
<td class='string'>{{ treatment.person|default_if_none:"-" }}</td>
<td class='string'>{{ treatment.container|default_if_none:"-" }}</td>
<td class='string'>{{ treatment.start_date|default_if_none:"-" }}</td>
@@ -366,7 +366,7 @@
<td class='string'>{{ treatment.label|default_if_none:"-" }}</td>
<td class='string'>{{ treatment.treatment_types_lbl }}</td>
<td class='string'>{{ treatment.treatment_state|default_if_none:"-" }}</td>
- <td class='item-list'>{% for it in items %}<span>{{it}} {{ it|link_to_window}}</span>{% endfor %}</td>
+ <td class='item-list'>{% for it in items %}<span>{{it}} {{ it|link_to_window:request}}</span>{% endfor %}</td>
<td class='string'>{{ treatment.person|default_if_none:"" }}</td>
<td class='string'>{{ treatment.container|default_if_none:"-" }}</td>
<td class='string'>{{ treatment.start_date|default_if_none:"" }}</td>
diff --git a/archaeological_finds/templates/ishtar/wizard/wizard_findbasket_deletion.html b/archaeological_finds/templates/ishtar/wizard/wizard_findbasket_deletion.html
index ffd5f0398..15c82bd05 100644
--- a/archaeological_finds/templates/ishtar/wizard/wizard_findbasket_deletion.html
+++ b/archaeological_finds/templates/ishtar/wizard/wizard_findbasket_deletion.html
@@ -7,7 +7,7 @@
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
{% trans "This basket is attached to treatments requests:" %}
<ul>{% for tf in current_object.treatment_files.all %}
- <li>{{ tf }} {{tf|link_to_window}}</li>
+ <li>{{ tf }} {{tf|link_to_window:request}}</li>
{% endfor %}</ul>
{% trans "Are you sure you want to delete this basket?" %}
</div>
@@ -16,7 +16,7 @@
{% trans "Items inside the basket (these items will not be deleted):" %}
</div>
<ul>{% for item in current_object.items.all %}
- <li>{{item}} {{item|link_to_window}}</li>
+ <li>{{item}} {{item|link_to_window:request}}</li>
{% endfor %}</ul>
<div class="alert alert-info">
diff --git a/archaeological_finds/templates/ishtar/wizard/wizard_treatement_deletion.html b/archaeological_finds/templates/ishtar/wizard/wizard_treatement_deletion.html
index be46bfd05..f084ad35c 100644
--- a/archaeological_finds/templates/ishtar/wizard/wizard_treatement_deletion.html
+++ b/archaeological_finds/templates/ishtar/wizard/wizard_treatement_deletion.html
@@ -10,7 +10,7 @@
{% trans "The following finds will be deleted and restored to a previous version."%}
<ul>{% for item in current_object.downstream.all %}
<li>
- {{item}} {{item|link_to_window}}
+ {{item}} {{item|link_to_window:request}}
</li>
{% endfor %}</ul>
{% trans "All changes made to the associated finds since this treatment record will be lost!" %}
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py
index ae03b2ba4..876bbecb2 100644
--- a/archaeological_finds/tests.py
+++ b/archaeological_finds/tests.py
@@ -815,6 +815,27 @@ class FindQATest(FindInit, TestCase):
base_desc_1 + u"\n" + extra_desc)
+class FindHistoryTest(FindInit, TestCase):
+ fixtures = FIND_FIXTURES
+ model = models.Find
+
+ def setUp(self):
+ self.create_finds(data_base={"label": u"Find 1"}, force=True)
+ self.create_finds(data_base={"label": u"Find 2"}, force=True)
+ self.username, self.password, self.user = create_superuser()
+ self.client = Client()
+ self.client.login(username=self.username, password=self.password)
+
+ def test_m2m_history_save(self):
+ pass
+
+ def test_m2m_history_display(self):
+ pass
+
+ def test_m2m_history_restore(self):
+ pass
+
+
class TreatmentTest(FindInit, TestCase):
fixtures = FIND_FIXTURES
model = models.Find