summaryrefslogtreecommitdiff
path: root/archaeological_operations
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-09-09 00:41:57 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-09-09 00:41:57 +0200
commit5230a8e0a06a5d67d6c13f2359bc51be07b4fb5a (patch)
tree5df1cfe674759003b1599f7334448f9c7f00637d /archaeological_operations
parent06f8d8f45d5c08ec9ed17cee4836f3311703e6df (diff)
downloadIshtar-5230a8e0a06a5d67d6c13f2359bc51be07b4fb5a.tar.bz2
Ishtar-5230a8e0a06a5d67d6c13f2359bc51be07b4fb5a.zip
Shortcut menu: menu is now dynamic - selected items filter dependant items (refs #2996) - can now pin items from sheet (refs #3078)
Diffstat (limited to 'archaeological_operations')
-rw-r--r--archaeological_operations/models.py8
-rw-r--r--archaeological_operations/templates/ishtar/sheet_operation.html2
2 files changed, 7 insertions, 3 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index f5a1ca8b0..701ae4593 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -174,6 +174,7 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,
'start_date', 'excavation_end_date']
TABLE_COLS.insert(4, 'associated_file_short_label')
IMAGE_PREFIX = 'operations/'
+ SLUG = 'operation'
creation_date = models.DateField(_(u"Creation date"),
default=datetime.date.today)
end_date = models.DateField(_(u"Closing date"), null=True, blank=True)
@@ -298,8 +299,11 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,
ordering = ('cached_label',)
@classmethod
- def get_owns(cls, user):
- owns = super(Operation, cls).get_owns(user)
+ def get_owns(cls, user, menu_filtr=None):
+ extra_query = {}
+ if menu_filtr:
+ extra_query = {'associated_file': menu_filtr}
+ owns = super(Operation, cls).get_owns(user, extra_query=extra_query)
# owns = owns.annotate(null_count=Count('operation_code'))
# return owns.order_by("common_name", "-year", "operation_code")
return sorted(owns, key=lambda x: x.cached_label)
diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html
index 2f6dbdf4c..6b2030f5e 100644
--- a/archaeological_operations/templates/ishtar/sheet_operation.html
+++ b/archaeological_operations/templates/ishtar/sheet_operation.html
@@ -4,7 +4,7 @@
{% block head_title %}{% trans "Operation" %}{% endblock %}
{% block content %}
-{% window_nav item window_id 'show-operation' 'operation_modify' 'show-historized-operation' 'revert-operation' previous next %}
+{% window_nav item window_id 'show-operation' 'operation_modify' 'show-historized-operation' 'revert-operation' previous next 1 %}
{% if item.image %}
<a href='{{item.image.url}}' rel="prettyPhoto" title="{{item.label}}" class='photo'><img src='{{item.thumbnail.url}}'/></a>