diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-11-14 17:06:40 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-11-14 17:58:17 +0100 |
| commit | 715c97d246c9375fc8cf055990c1f49c3efc9522 (patch) | |
| tree | 7cc2e179b4411459690ddd455ca9e5962f64528b | |
| parent | 6d902258dd5e1b96fe5849a47d280375c5b74a34 (diff) | |
| download | Ishtar-715c97d246c9375fc8cf055990c1f49c3efc9522.tar.bz2 Ishtar-715c97d246c9375fc8cf055990c1f49c3efc9522.zip | |
✨ datings refactoring: add actions on sheet
| -rw-r--r-- | archaeological_context_records/models.py | 11 | ||||
| -rw-r--r-- | archaeological_finds/models_finds.py | 13 |
2 files changed, 23 insertions, 1 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 63e6a773d..4da7e35e2 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -1261,6 +1261,17 @@ class ContextRecord( profile = get_current_profile() can_add_geo = can_edit_cr and profile.mapping and \ self.can_do(request, "ishtar_common.add_geovectordata") + if can_edit_cr and not is_locked: + actions += [ + ( + reverse("context-record-dating-add", args=[self.pk]), + _("Add period"), + "fa fa-plus", + _("period"), + "", + True, + ), + ] if can_add_geo: actions.append(self.get_add_geo_action()) can_create_find = self.can_do(request, "archaeological_finds.add_find") diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 8f295e4f8..5eed32772 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -2851,12 +2851,23 @@ class Find( is_locked = hasattr(self, "is_locked") and self.is_locked(request.user) profile = get_current_profile() + can_edit_find = self.can_do(request, "archaeological_finds.change_find") + if can_edit_find and not is_locked: + actions += [ + ( + reverse("find-dating-add", args=[self.pk]), + _("Add period"), + "fa fa-plus", + _("period"), + "", + True, + ), + ] can_add_geo = profile.mapping and self.can_do(request, "ishtar_common.add_geovectordata") if can_add_geo: if self.base_finds.count() == 1: actions.append(self.base_finds.all()[0].get_add_geo_action()) - can_edit_find = self.can_do(request, "archaeological_finds.change_find") if can_edit_find and not is_locked: actions += [ ( |
