diff options
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 |
commit | 5a16bff4556fc70b8feb5e39bad362c7f0a23d41 (patch) | |
tree | d5601f32c841063bcd93741d3516772c0ebe4bad /archaeological_operations/models.py | |
parent | c4b95aeae997c70214f6d63daab3b9b71d3418c4 (diff) | |
download | Ishtar-5a16bff4556fc70b8feb5e39bad362c7f0a23d41.tar.bz2 Ishtar-5a16bff4556fc70b8feb5e39bad362c7f0a23d41.zip |
Parcels: remove from operation wizard - improve display
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 34 |
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 |