summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-12-03 17:14:13 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-12-03 17:14:41 +0100
commit1ec422545704e35f9a1fe2eaa5f974cc82d5179f (patch)
treeaeef3e6775cadaff9b948aa142dfdac39d250859 /archaeological_operations/models.py
parentc79ec86652742f9e98df25c3ef187d0022aa5a5b (diff)
downloadIshtar-1ec422545704e35f9a1fe2eaa5f974cc82d5179f.tar.bz2
Ishtar-1ec422545704e35f9a1fe2eaa5f974cc82d5179f.zip
Sheet operation QA: add context record
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r--archaeological_operations/models.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index b15dbf580..a0d0ba30b 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -1064,6 +1064,22 @@ class Operation(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter,
finds__base_finds__context_record__operation=self
)
+ def get_extra_actions(self, request):
+ """
+ For sheet template
+ """
+ # url, base_text, icon, extra_text, extra css class, is a quick action
+
+ can_add_cr = self.can_do(request, 'add_contextrecord')
+ actions = []
+ if can_add_cr:
+ actions += [
+ (reverse('operation-qa-contextrecord', args=[self.pk]),
+ _(u"Add context record"), "fa fa-plus",
+ _(u"context record"), "", True),
+ ]
+ return actions
+
associated_file_short_label_lbl = _(u"Archaeological file")
full_code_patriarche_lbl = _(u"Code patriarche")