From a1ba9318ad1d3b3c2bc96f5db0a0a802fa10a50f Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Wed, 15 Apr 2020 22:43:40 +0200 Subject: [PATCH] Restructuring templates --- core/views/auth.py | 6 +++--- core/views/dbsettings.py | 8 ++++---- templates/backend/{auth_base.html => auth/base.html} | 0 templates/backend/{ => auth}/login.html | 2 +- templates/backend/{ => auth}/otp_selector.html | 2 +- templates/backend/{ => auth}/otp_verifier.html | 2 +- templates/backend/base.html | 2 +- templates/backend/dbsettings/delete.html | 8 ++++---- templates/backend/dbsettings/index.html | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) rename templates/backend/{auth_base.html => auth/base.html} (100%) rename templates/backend/{ => auth}/login.html (97%) rename templates/backend/{ => auth}/otp_selector.html (95%) rename templates/backend/{ => auth}/otp_verifier.html (95%) diff --git a/core/views/auth.py b/core/views/auth.py index f97d59e..abca065 100644 --- a/core/views/auth.py +++ b/core/views/auth.py @@ -10,7 +10,7 @@ from core.models.otp import LoginSession from core.helpers.otp import get_user_otps, get_otp_choices, get_otp_by_name class LoginView(FormView): - template_name = f"{settings.EXPEPHALON_BACKEND}/login.html" + template_name = f"{settings.EXPEPHALON_BACKEND}/auth/login.html" form_class = LoginForm def get(self, request, *args, **kwargs): @@ -31,7 +31,7 @@ class LoginView(FormView): return super().form_invalid(form) class OTPSelectorView(FormView): - template_name = f"{settings.EXPEPHALON_BACKEND}/otp_selector.html" + template_name = f"{settings.EXPEPHALON_BACKEND}/auth/otp_selector.html" form_class = OTPSelectorForm def clean_session(self): @@ -60,7 +60,7 @@ class OTPSelectorView(FormView): return redirect("login") class OTPValidatorView(FormView): - template_name = f"{settings.EXPEPHALON_BACKEND}/otp_verifier.html" + template_name = f"{settings.EXPEPHALON_BACKEND}/auth/otp_verifier.html" form_class = OTPVerificationForm def clean_session(self): diff --git a/core/views/dbsettings.py b/core/views/dbsettings.py index ad0ca0e..566cc4d 100644 --- a/core/views/dbsettings.py +++ b/core/views/dbsettings.py @@ -6,22 +6,22 @@ try: from dbsettings.models import Setting class DBSettingsListView(ListView): - template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings.html" + template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings/index.html" model = Setting class DBSettingsEditView(UpdateView): - template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings_update.html" + template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings/update.html" model = Setting success_url = reverse_lazy("dbsettings") fields = ["key", "value"] class DBSettingsDeleteView(DeleteView): - template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings_delete.html" + template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings/delete.html" model = Setting success_url = reverse_lazy("dbsettings") class DBSettingsCreateView(CreateView): - template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings_create.html" + template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings/create.html" model = Setting success_url = reverse_lazy("dbsettings") fields = ["key", "value"] diff --git a/templates/backend/auth_base.html b/templates/backend/auth/base.html similarity index 100% rename from templates/backend/auth_base.html rename to templates/backend/auth/base.html diff --git a/templates/backend/login.html b/templates/backend/auth/login.html similarity index 97% rename from templates/backend/login.html rename to templates/backend/auth/login.html index 995e013..309a28f 100644 --- a/templates/backend/login.html +++ b/templates/backend/auth/login.html @@ -1,4 +1,4 @@ -{% extends "backend/auth_base.html" %} +{% extends "backend/auth/base.html" %} {% load bootstrap4 %} {% block content %}
diff --git a/templates/backend/otp_selector.html b/templates/backend/auth/otp_selector.html similarity index 95% rename from templates/backend/otp_selector.html rename to templates/backend/auth/otp_selector.html index 88b20cd..8d9387a 100644 --- a/templates/backend/otp_selector.html +++ b/templates/backend/auth/otp_selector.html @@ -1,4 +1,4 @@ -{% extends "backend/auth_base.html" %} +{% extends "backend/auth/base.html" %} {% load bootstrap4 %} {% block content %}