diff options
Diffstat (limited to 'saleor/product')
-rw-r--r-- | saleor/product/templatetags/sort_by.py | 11 | ||||
-rw-r--r-- | saleor/product/templatetags/sort_menu.py | 17 |
2 files changed, 0 insertions, 28 deletions
diff --git a/saleor/product/templatetags/sort_by.py b/saleor/product/templatetags/sort_by.py deleted file mode 100644 index 58395c07..00000000 --- a/saleor/product/templatetags/sort_by.py +++ /dev/null @@ -1,11 +0,0 @@ -from django import template - -register = template.Library() - - -@register.inclusion_tag('category/_sort_by.html', takes_context=True) -def sort_by(context, attribute): - return {'request': context['request'], - 'label': attribute['label'], - 'ascending_attribute': attribute['value'], - 'descending_attribute': '-' + str(attribute['value'])} 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 |