From eafb394f55690bac527d8d34b58e87a9a80316dd Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Fri, 19 Jun 2020 11:09:51 +0100 Subject: [PATCH] Move closemodal into PyRIGS --- PyRIGS/urls.py | 1 + PyRIGS/views.py | 14 ++++++++++++++ RIGS/urls.py | 2 -- RIGS/views.py | 14 -------------- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/PyRIGS/urls.py b/PyRIGS/urls.py index 564cf31c..91d58e19 100644 --- a/PyRIGS/urls.py +++ b/PyRIGS/urls.py @@ -23,6 +23,7 @@ urlpatterns = [ path('api///', login_required(views.SecureAPIRequest.as_view()), name="api_secure"), + path('closemodal/', views.CloseModal.as_view(), name='closemodal'), path('search_help/', views.SearchHelp.as_view(), name='search_help'), path('admin/', admin.site.urls), diff --git a/PyRIGS/views.py b/PyRIGS/views.py index 0582873b..e0cf97cd 100644 --- a/PyRIGS/views.py +++ b/PyRIGS/views.py @@ -163,3 +163,17 @@ class GenericListView(generic.ListView): class SearchHelp(generic.TemplateView): template_name = 'search_help.html' + + +""" +Called from a modal window (e.g. when an item is submitted to an event/invoice). +May optionally also include some javascript in a success message to cause a load of +the new information onto the page. +""" + + +class CloseModal(generic.TemplateView): + template_name = 'closemodal.html' + + def get_context_data(self, **kwargs): + return {'messages': messages.get_messages(self.request)} diff --git a/RIGS/urls.py b/RIGS/urls.py index b7f29378..c49143b1 100644 --- a/RIGS/urls.py +++ b/RIGS/urls.py @@ -12,8 +12,6 @@ from django.views.decorators.cache import cache_page urlpatterns = [ path('', login_required(views.Index.as_view()), name='index'), - path('closemodal/', views.CloseModal.as_view(), name='closemodal'), - # People path('people/', permission_required_with_403('RIGS.view_person')(views.PersonList.as_view()), name='person_list'), diff --git a/RIGS/views.py b/RIGS/views.py index 24b2e53e..57ba2fbf 100644 --- a/RIGS/views.py +++ b/RIGS/views.py @@ -41,20 +41,6 @@ class Index(generic.TemplateView): return context -""" -Called from a modal window (e.g. when an item is submitted to an event/invoice). -May optionally also include some javascript in a success message to cause a load of -the new information onto the page. -""" - - -class CloseModal(generic.TemplateView): - template_name = 'closemodal.html' - - def get_context_data(self, **kwargs): - return {'messages': messages.get_messages(self.request)} - - class PersonList(GenericListView): template_name = 'person_list.html' model = models.Person