First pass at clearer display of asset list filters

This commit is contained in:
2020-10-12 23:03:33 +01:00
parent fd85d50679
commit d255e1f89f
2 changed files with 56 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ from django.views import generic
from django.views.decorators.csrf import csrf_exempt
from versioning import versioning
from PyRIGS.views import GenericListView, GenericDetailView, GenericUpdateView, GenericCreateView, ModalURLMixin
from itertools import chain
@method_decorator(csrf_exempt, name='dispatch')
@@ -64,6 +65,8 @@ class AssetList(LoginRequiredMixin, generic.ListView):
def get_context_data(self, **kwargs):
context = super(AssetList, self).get_context_data(**kwargs)
context["form"] = self.form
context["category_filters"] = self.form.cleaned_data['category']
context["status_filters"] = self.form.cleaned_data['status']
context["categories"] = models.AssetCategory.objects.all()
context["statuses"] = models.AssetStatus.objects.all()
context["page_title"] = "Asset List"