diff options
| 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 |
| commit | 13790d69392535543991be2f9de453b6a2fe9493 (patch) | |
| tree | 5df1cfe674759003b1599f7334448f9c7f00637d /archaeological_finds | |
| parent | b9fad2cce5388c1f32a936521149cf2fa36e783e (diff) | |
| download | Ishtar-13790d69392535543991be2f9de453b6a2fe9493.tar.bz2 Ishtar-13790d69392535543991be2f9de453b6a2fe9493.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_finds')
| -rw-r--r-- | archaeological_finds/models.py | 9 | ||||
| -rw-r--r-- | archaeological_finds/templates/ishtar/sheet_find.html | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index 15ed32120..0f069e1d8 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -275,6 +275,7 @@ class FindBasket(Basket): class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): CHECK_DICT = dict(CHECK_CHOICES) SHOW_URL = 'show-find' + SLUG = 'find' TABLE_COLS = ['label', 'material_types', 'datings.period', 'base_finds.context_record.parcel.town', 'base_finds.context_record.operation.year', @@ -564,6 +565,14 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): ishtaruser.person) |\ Q(history_creator=user) + @classmethod + def get_owns(cls, user, menu_filtr=None): + extra_query = {} + if menu_filtr: + extra_query = {'base_finds__context_record': menu_filtr} + owns = super(Find, cls).get_owns(user, extra_query=extra_query) + return sorted(owns, key=lambda x: x.cached_label) + def save(self, *args, **kwargs): super(Find, self).save(*args, **kwargs) diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index c867b46ee..fbd7cec1a 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -4,7 +4,7 @@ {% block head_title %}{% trans "Find" %}{% endblock %} {% block content %} -{% window_nav item window_id 'show-find' 'find_modify' 'show-historized-find' 'revert-find' previous next %} +{% window_nav item window_id 'show-find' 'find_modify' 'show-historized-find' 'revert-find' previous next 1 %} {% if item.image %} <a href='{{item.image.url}}' rel="prettyPhoto" title="{{item.label}}" class='photo'><img src='{{item.thumbnail.url}}'/></a> |
