From 0ba195f2efdacb674c8ff7affbea353abbe2a936 Mon Sep 17 00:00:00 2001 From: michal Date: Fri, 6 Oct 2017 14:22:50 +0200 Subject: Further refactoring of sort_by and sort_menu Combine sort_by and sort_menu to one template and templatetag. Move templatetags to shop.py. Delete sort_menu.py and _sort_menu.html. Update index.html with new templatetags. --- saleor/product/templatetags/sort_menu.py | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 saleor/product/templatetags/sort_menu.py (limited to 'saleor/product/templatetags/sort_menu.py') diff --git a/saleor/product/templatetags/sort_menu.py b/saleor/product/templatetags/sort_menu.py deleted file mode 100644 index d538f055..00000000 --- a/saleor/product/templatetags/sort_menu.py +++ /dev/null @@ -1,17 +0,0 @@ -from django import template - -from ..filters import DEFAULT_SORT - -register = template.Library() - - -@register.inclusion_tag('category/_sort_menu.html', takes_context=True) -def sort_menu(context, attributes): - ctx = { - 'request': context['request'], - 'sort_by': (context['request'].GET.get('sort_by', DEFAULT_SORT) - .strip('-')), - 'sort_by_choices': attributes, - 'arrow_down': (context['request'].GET.get('sort_by', DEFAULT_SORT) - .startswith('-'))} - return ctx -- cgit v1.2.3