From 948b9799b4a44739b36ba65e01ec27fe21f68255 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 2 Dec 2018 18:21:22 +0100 Subject: Sheet find: link to baskets --- ishtar_common/models.py | 4 ++++ ishtar_common/templates/ishtar/blocks/window_nav.html | 6 ++++-- ishtar_common/templatetags/window_header.py | 12 ++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index b6c8fbb3d..70f65fd68 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3477,6 +3477,10 @@ class Basket(FullSearch, OwnPerms): def cached_label(self): return unicode(self) + @property + def full_label(self): + return u"{} - {}".format(self.label, self.user) + @classmethod def get_short_menu_class(cls, pk): return 'basket' diff --git a/ishtar_common/templates/ishtar/blocks/window_nav.html b/ishtar_common/templates/ishtar/blocks/window_nav.html index 6cd4bff40..90d58d605 100644 --- a/ishtar_common/templates/ishtar/blocks/window_nav.html +++ b/ishtar_common/templates/ishtar/blocks/window_nav.html @@ -27,9 +27,9 @@ {% endif %} -
+
{% else %} -
+
{% endif %} {% if pin_action and item.SLUG %}
+ {% block post_pin %} + {% endblock %}
{% endif %}
diff --git a/ishtar_common/templatetags/window_header.py b/ishtar_common/templatetags/window_header.py index f6fc27082..e6325d3fb 100644 --- a/ishtar_common/templatetags/window_header.py +++ b/ishtar_common/templatetags/window_header.py @@ -32,6 +32,18 @@ def window_nav(context, item, window_id, show_url, modify_url='', histo_url='', 'pin_action': pin_action} +@register.inclusion_tag('ishtar/blocks/window_find_nav.html', + takes_context=True) +def window_find_nav(context, item, window_id, show_url, modify_url='', + histo_url='', revert_url='', previous=None, nxt=None, + pin_action=False, baskets=None): + dct = window_nav(context, item, window_id, show_url, modify_url=modify_url, + histo_url=histo_url, revert_url=revert_url, + previous=previous, nxt=nxt, pin_action=pin_action) + dct['baskets'] = baskets + return dct + + @register.inclusion_tag('ishtar/blocks/window_file_nav.html', takes_context=True) def window_file_nav(context, item, window_id, previous=None, nxt=None): -- cgit v1.2.3