summaryrefslogtreecommitdiff
path: root/saleor/product/templatetags/sort_menu.py
diff options
context:
space:
mode:
authormichal <michal.sipa@mirumee.com>2017-10-06 14:22:50 +0200
committermichal <michal.sipa@mirumee.com>2017-10-06 14:22:50 +0200
commit0ba195f2efdacb674c8ff7affbea353abbe2a936 (patch)
tree28ea4f3afb583e5f44a202a779aa655b8f1d19ce /saleor/product/templatetags/sort_menu.py
parent0d11f7d0285b2dca7c7539049d01eafd8da6b99e (diff)
downloadsaleor-frontend-0ba195f2efdacb674c8ff7affbea353abbe2a936.tar.gz
saleor-frontend-0ba195f2efdacb674c8ff7affbea353abbe2a936.tar.bz2
saleor-frontend-0ba195f2efdacb674c8ff7affbea353abbe2a936.zip
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.
Diffstat (limited to 'saleor/product/templatetags/sort_menu.py')
-rw-r--r--saleor/product/templatetags/sort_menu.py17
1 files changed, 0 insertions, 17 deletions
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