diff options
Diffstat (limited to 'archaeological_context_records')
-rw-r--r-- | archaeological_context_records/models.py | 10 | ||||
-rw-r--r-- | archaeological_context_records/templates/ishtar/sheet_contextrecord.html | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index a98f7792a..fa2d5b430 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -108,6 +108,7 @@ class IdentificationType(GeneralType): class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): SHOW_URL = 'show-contextrecord' + SLUG = 'contextrecord' TABLE_COLS = ['parcel.town', 'operation.year', 'operation.operation_code', 'label', 'unit'] @@ -220,6 +221,15 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): Q(operation__in_charge=user.ishtaruser.person) |\ Q(history_creator=user) + @classmethod + def get_owns(cls, user, menu_filtr=None): + extra_query = {} + if menu_filtr: + extra_query = {'operation': menu_filtr} + owns = super(ContextRecord, cls).get_owns(user, + extra_query=extra_query) + return sorted(owns, key=lambda x: x.cached_label) + def full_label(self): return unicode(self) if not self.operation: diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html index 2c2bf98fe..bd883ac0b 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html @@ -4,7 +4,7 @@ {% block head_title %}{% trans "Context Record" %}{% endblock %} {% block content %} -{% window_nav item window_id 'show-contextrecord' 'record_modify' 'show-historized-contextrecord' 'revert-contextrecord' previous next %} +{% window_nav item window_id 'show-contextrecord' 'record_modify' 'show-historized-contextrecord' 'revert-contextrecord' previous next 1 %} {% if item.image %} <a href='{{item.image.url}}' rel="prettyPhoto" title="{{item.label}}" class='photo'><img src='{{item.thumbnail.url}}'/></a> |