diff --git a/shimatta_kenkyusho/parts/views.py b/shimatta_kenkyusho/parts/views.py index db29e8b..74e8adb 100644 --- a/shimatta_kenkyusho/parts/views.py +++ b/shimatta_kenkyusho/parts/views.py @@ -2,6 +2,7 @@ from django.shortcuts import render, redirect from django.urls import resolve, reverse from django.contrib.auth import logout, login from django.contrib.auth.models import User +from django.utils.http import urlencode from django.http import HttpResponse from .navbar import NavBar from django.contrib.auth.forms import AuthenticationForm as AuthForm @@ -283,6 +284,7 @@ class ComponentView(LoginRequiredMixin, BaseTemplateMixin, TemplateView): context['components'] = comp_paginator.get_page(comp_page_num) context['comp_form'] = ComponentForm() context['search_string'] = search + context['additional_get_params'] = urlencode({'search': self.request.GET.get('search', default='')}) if search else None if not parameter_formset: context['advanced_search_param_formset'] = ParameterSearchFormSet() @@ -367,6 +369,11 @@ class PackageView(LoginRequiredMixin, BaseTemplateMixin, TemplateView): context['search_string'] = search_string context['packages'] = paginator.get_page(page_num) context['new_pkg_form'] = PackageForm() + get_params_for_paginator = None + if search_string: + get_params_for_paginator = urlencode({'search': search_string}) + + context['additional_get_params'] = get_params_for_paginator return context @@ -566,7 +573,8 @@ class StockViewDetail(LoginRequiredMixin, BaseTemplateMixin, DetailView): context['add_storage_form'] = add_storage_form context['delete_storage_error'] = None context['add_stock_form'] = AddStockForm() - + if stock_search_input: + context['additional_params'] = urlencode({'search': stock_search_input}) return context def handle_add_storage_post(self, request, **kwargs): diff --git a/shimatta_kenkyusho/templates/paginator.html b/shimatta_kenkyusho/templates/paginator.html index 34ad0c3..aeb1249 100644 --- a/shimatta_kenkyusho/templates/paginator.html +++ b/shimatta_kenkyusho/templates/paginator.html @@ -2,21 +2,21 @@