summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2022-05-20 11:23:10 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-12-12 12:21:00 +0100
commit3ff82007369b115406c2f2effbdfb13188167bb7 (patch)
treed5601f32c841063bcd93741d3516772c0ebe4bad /archaeological_operations/models.py
parent7659a92661450c331c79fbe59dee5b75434ee02d (diff)
downloadIshtar-3ff82007369b115406c2f2effbdfb13188167bb7.tar.bz2
Ishtar-3ff82007369b115406c2f2effbdfb13188167bb7.zip
Parcels: remove from operation wizard - improve display
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r--archaeological_operations/models.py34
1 files changed, 21 insertions, 13 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 90a4043b6..205cac550 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -1775,28 +1775,25 @@ class Operation(
is_locked = self.is_locked(request.user)
can_edit_operation = self.can_do(request, "change_operation")
- if can_edit_operation:
- actions += [
- (
- reverse("operation-qa-duplicate", args=[self.pk]),
- _("Duplicate"),
- "fa fa-clone",
- "",
- "",
- True,
- ),
+ if can_edit_operation and not is_locked:
+ actions = [
(
reverse("operation-parcels-modify", args=[self.pk]),
- _("Modify Parcels"),
+ _("Modify parcels"),
"fa fa-pencil",
_("parcels"),
"",
True,
),
- ]
+ ] + actions
can_add_cr = self.can_do(request, "add_contextrecord")
if can_add_cr and not is_locked:
- actions += [
+ start = actions
+ end = []
+ if actions[-1] and actions[-1][0].startswith("/document/create"):
+ start = actions[:-1]
+ end = [actions[-1]]
+ actions = start + [
(
reverse("operation-qa-contextrecord", args=[self.pk]),
_("Add context record"),
@@ -1805,6 +1802,17 @@ class Operation(
"",
True,
),
+ ] + end
+ if can_edit_operation:
+ actions += [
+ (
+ reverse("operation-qa-duplicate", args=[self.pk]),
+ _("Duplicate"),
+ "fa fa-clone",
+ "",
+ "",
+ True,
+ ),
]
return actions