diff --git a/app/app/views.py b/app/app/views.py index a97e444a..9747ad8a 100644 --- a/app/app/views.py +++ b/app/app/views.py @@ -170,6 +170,7 @@ def institution_detail(request, institution_id): def documents(request): template = "app/documents.html" + url_params = {} subject_id = request.GET.get("subject") language_id = request.GET.get("language") institution_id = request.GET.get("institution") @@ -182,10 +183,13 @@ def documents(request): if subject_id: documents = documents.filter(subjects__id=subject_id) + url_params["subject"] = subject_id if language_id: documents = documents.filter(languages__id=language_id) + url_params["language"] = language_id if institution_id: documents = documents.filter(institution__id=institution_id) + url_params["institution"] = institution_id paginator = Paginator(documents, 10) @@ -220,6 +224,7 @@ def documents(request): "current_page": "documents", "page_obj": page_obj, "documents": document_data, + "url_params": urlencode(url_params), "subjects": subjects, "languages": languages, "institutions": institutions, diff --git a/app/templates/app/documents.html b/app/templates/app/documents.html index 43e174f7..b1e7fd4e 100644 --- a/app/templates/app/documents.html +++ b/app/templates/app/documents.html @@ -85,8 +85,8 @@