diff --git a/cookbook/filters.py b/cookbook/filters.py index 2d473cf8c..c1cc86463 100644 --- a/cookbook/filters.py +++ b/cookbook/filters.py @@ -66,14 +66,6 @@ class IngredientFilter(django_filters.FilterSet): fields = ['name'] -class KeywordFilter(django_filters.FilterSet): - name = django_filters.CharFilter(lookup_expr='icontains') - - class Meta: - model = Keyword - fields = ['name'] - - class ShoppingListFilter(django_filters.FilterSet): def __init__(self, data=None, *args, **kwargs): diff --git a/cookbook/templates/manage/keyword_table.html b/cookbook/templates/manage/keyword_table.html index ea1eb90b5..a1e57d118 100644 --- a/cookbook/templates/manage/keyword_table.html +++ b/cookbook/templates/manage/keyword_table.html @@ -1,3 +1,4 @@ +{% load crispy_forms_tags %} {% load i18n %} {% load django_tables2 %} diff --git a/cookbook/templates/manage/keywords.html b/cookbook/templates/manage/keywords.html index fab4415bf..efbdabe5a 100644 --- a/cookbook/templates/manage/keywords.html +++ b/cookbook/templates/manage/keywords.html @@ -1,5 +1,4 @@ {% extends "base.html" %} -{% load crispy_forms_tags %} {% load i18n %} {% load django_tables2 %} @@ -9,26 +8,13 @@ {% block content %}
-

{% trans 'Manage Keywords' %} +

{% trans 'Manage Keywords' %} {% trans 'List' %} {% if create_url %} {% endif %}

- {% if filter %} -
-
-
- {% csrf_token %} - {{ filter.form|crispy }} - - {% trans 'Clear' %} -
- {% endif %} - - {% render_table table %}
diff --git a/cookbook/views/manage.py b/cookbook/views/manage.py index 43ca4f8ca..db126cc4f 100644 --- a/cookbook/views/manage.py +++ b/cookbook/views/manage.py @@ -1,4 +1,3 @@ -from cookbook.filters import KeywordFilter from cookbook.helper.permission_helper import group_required from cookbook.models import Keyword from cookbook.tables import ManageKeywordTable @@ -10,17 +9,11 @@ from django.utils.translation import gettext as _ @group_required('user') def keywords(request): - f = KeywordFilter( - request.GET, - queryset=Keyword.objects.all().order_by('pk') - ) - - table = ManageKeywordTable(f.qs) + table = ManageKeywordTable(Keyword.objects.all()) RequestConfig(request, paginate={'per_page': 25}).configure(table) return render( request, 'manage/keywords.html', - {'title': _("Keyword"), 'table': table, - 'create_url': 'new_keyword', 'filter': f} + {'title': _("Keyword"), 'table': table, 'create_url': 'new_keyword'} )