From a1a7fe07f3bc54eb9adecbabfab073a7346878b4 Mon Sep 17 00:00:00 2001 From: Luis Alvergue Date: Mon, 7 Oct 2024 21:46:38 +0000 Subject: [PATCH 1/4] chore: fix indentation --- benefits/templates/admin/agency-base.html | 71 ++++++++++++----------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/benefits/templates/admin/agency-base.html b/benefits/templates/admin/agency-base.html index 0ec2067e0..adafc9b05 100644 --- a/benefits/templates/admin/agency-base.html +++ b/benefits/templates/admin/agency-base.html @@ -36,45 +36,46 @@

{{ site_header }}

{% block welcome-msg %} Welcome, - {% firstof user.get_short_name user.get_username %}. - {% endblock welcome-msg %} - {% block userlinks %} - {% if user.is_active and user.is_staff %} - {% url 'django-admindocs-docroot' as docsroot %} - {% if docsroot %}Documentation /{% endif %} - {% endif %} - {% if user.has_usable_password %} - Change password / - {% endif %} - -
- {% csrf_token %} - -
- {% endblock userlinks %} - - {% endif %} - {% endblock usertools %} + {% firstof user.get_short_name user.get_username %}. + + {% endblock welcome-msg %} + {% block userlinks %} + {% if user.is_active and user.is_staff %} + {% url 'django-admindocs-docroot' as docsroot %} + {% if docsroot %}Documentation /{% endif %} + {% endif %} + {% if user.has_usable_password %} + Change password / + {% endif %} + +
+ {% csrf_token %} + +
+ {% endblock userlinks %} + + {% endif %} +{% endblock usertools %} - {% block coltype %} - w-100 - {% endblock coltype %} +{% block coltype %} + w-100 +{% endblock coltype %} - {% block bodyclass %} - {{ block.super }} dashboard - {% endblock bodyclass %} +{% block bodyclass %} + {{ block.super }} dashboard +{% endblock bodyclass %} - {% block nav-breadcrumbs %} - {% endblock nav-breadcrumbs %} +{% block nav-breadcrumbs %} +{% endblock nav-breadcrumbs %} - {% block nav-sidebar %} - {% endblock nav-sidebar %} +{% block nav-sidebar %} +{% endblock nav-sidebar %} - {% block content_title %} - {% endblock content_title %} +{% block content_title %} +{% endblock content_title %} - {% block content %} - {% endblock content %} +{% block content %} +{% endblock content %} - {% block sidebar %} - {% endblock sidebar %} +{% block sidebar %} +{% endblock sidebar %} From 48ab19e894d99b3dd774cc7db8e5d612268d23db Mon Sep 17 00:00:00 2001 From: Luis Alvergue Date: Mon, 7 Oct 2024 21:44:33 +0000 Subject: [PATCH 2/4] chore: extract favicon, Bootstrap, and admin style as include --- benefits/templates/admin/agency-base.html | 9 +++------ benefits/templates/admin/includes/bootstrap.html | 4 ++++ benefits/templates/admin/includes/favicon.html | 3 +++ benefits/templates/admin/includes/style-admin.html | 3 +++ benefits/templates/admin/login.html | 9 +++------ 5 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 benefits/templates/admin/includes/bootstrap.html create mode 100644 benefits/templates/admin/includes/favicon.html create mode 100644 benefits/templates/admin/includes/style-admin.html diff --git a/benefits/templates/admin/agency-base.html b/benefits/templates/admin/agency-base.html index adafc9b05..69768a372 100644 --- a/benefits/templates/admin/agency-base.html +++ b/benefits/templates/admin/agency-base.html @@ -5,16 +5,13 @@ {% endblock dark-mode-vars %} {% block extrastyle %} - + {% include "admin/includes/favicon.html" %} - - + {% include "admin/includes/bootstrap.html" %} + {% include "admin/includes/style-admin.html" %} {% include "core/includes/analytics.html" with api_key=analytics.api_key uid=analytics.uid did=analytics.did %} {% endblock extrastyle %} diff --git a/benefits/templates/admin/includes/bootstrap.html b/benefits/templates/admin/includes/bootstrap.html new file mode 100644 index 000000000..5b0ef6048 --- /dev/null +++ b/benefits/templates/admin/includes/bootstrap.html @@ -0,0 +1,4 @@ + diff --git a/benefits/templates/admin/includes/favicon.html b/benefits/templates/admin/includes/favicon.html new file mode 100644 index 000000000..3b3f07a83 --- /dev/null +++ b/benefits/templates/admin/includes/favicon.html @@ -0,0 +1,3 @@ +{% load i18n static %} + + diff --git a/benefits/templates/admin/includes/style-admin.html b/benefits/templates/admin/includes/style-admin.html new file mode 100644 index 000000000..8586acbc0 --- /dev/null +++ b/benefits/templates/admin/includes/style-admin.html @@ -0,0 +1,3 @@ +{% load i18n static %} + + diff --git a/benefits/templates/admin/login.html b/benefits/templates/admin/login.html index 3ce8bc7f8..aa4f391cb 100644 --- a/benefits/templates/admin/login.html +++ b/benefits/templates/admin/login.html @@ -6,12 +6,9 @@ {% block extrastyle %} {% comment %} Overriding instead of extending agency-base here to remove jQuery declaration, which admin/login.html includes on its own {% endcomment %} - - - + {% include "admin/includes/favicon.html" %} + {% include "admin/includes/bootstrap.html" %} + {% include "admin/includes/style-admin.html" %} {% endblock extrastyle %} {% block branding %} From d492a59b093b8ecc6f0c9ccadaf45858ded0af90 Mon Sep 17 00:00:00 2001 From: Luis Alvergue Date: Mon, 7 Oct 2024 21:45:59 +0000 Subject: [PATCH 3/4] chore: extract login and logout branding as include --- benefits/templates/admin/includes/branding-login.html | 9 +++++++++ benefits/templates/admin/login.html | 8 +------- benefits/templates/registration/logged_out.html | 8 +------- 3 files changed, 11 insertions(+), 14 deletions(-) create mode 100644 benefits/templates/admin/includes/branding-login.html diff --git a/benefits/templates/admin/includes/branding-login.html b/benefits/templates/admin/includes/branding-login.html new file mode 100644 index 000000000..c5d3472c1 --- /dev/null +++ b/benefits/templates/admin/includes/branding-login.html @@ -0,0 +1,9 @@ +{% load i18n static %} + +
+ California Integrated Travel Project: Benefits logo (large) +
+ +
+

{{ site_header }}

+
diff --git a/benefits/templates/admin/login.html b/benefits/templates/admin/login.html index aa4f391cb..4cfad7774 100644 --- a/benefits/templates/admin/login.html +++ b/benefits/templates/admin/login.html @@ -12,11 +12,5 @@ {% endblock extrastyle %} {% block branding %} -
- California Integrated Travel Project: Benefits logo (large) -
- -
-

{{ site_header }}

-
+ {% include "admin/includes/branding-login.html" %} {% endblock branding %} diff --git a/benefits/templates/registration/logged_out.html b/benefits/templates/registration/logged_out.html index 83a65bc3e..e76a49893 100644 --- a/benefits/templates/registration/logged_out.html +++ b/benefits/templates/registration/logged_out.html @@ -15,13 +15,7 @@ {% endblock bodyclass %} {% block branding %} -
- California Integrated Travel Project: Benefits logo (large) -
- -
-

{{ site_header }}

-
+ {% include "admin/includes/branding-login.html" %} {% endblock branding %} {% block content %} From 4cbc4a2f52e3acb4cce3fa2ff9a6ded9dc904cb6 Mon Sep 17 00:00:00 2001 From: Luis Alvergue Date: Tue, 8 Oct 2024 18:34:12 +0000 Subject: [PATCH 4/4] chore: extract usertools as include --- benefits/templates/admin/agency-base.html | 25 +----------------- .../templates/admin/includes/usertools.html | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 benefits/templates/admin/includes/usertools.html diff --git a/benefits/templates/admin/agency-base.html b/benefits/templates/admin/agency-base.html index 69768a372..fc4a982e6 100644 --- a/benefits/templates/admin/agency-base.html +++ b/benefits/templates/admin/agency-base.html @@ -28,30 +28,7 @@

{{ site_header }}

{% endblock branding %} {% block usertools %} - {% if has_permission %} -
- {% block welcome-msg %} - - Welcome, - {% firstof user.get_short_name user.get_username %}. - - {% endblock welcome-msg %} - {% block userlinks %} - {% if user.is_active and user.is_staff %} - {% url 'django-admindocs-docroot' as docsroot %} - {% if docsroot %}Documentation /{% endif %} - {% endif %} - {% if user.has_usable_password %} - Change password / - {% endif %} - -
- {% csrf_token %} - -
- {% endblock userlinks %} -
- {% endif %} + {% include "admin/includes/usertools.html" %} {% endblock usertools %} {% block coltype %} diff --git a/benefits/templates/admin/includes/usertools.html b/benefits/templates/admin/includes/usertools.html new file mode 100644 index 000000000..b0ff961a3 --- /dev/null +++ b/benefits/templates/admin/includes/usertools.html @@ -0,0 +1,26 @@ +{% load i18n static %} + +{% if has_permission %} +
+ {% block welcome-msg %} + + Welcome, + {% firstof user.get_short_name user.get_username %}. + + {% endblock welcome-msg %} + {% block userlinks %} + {% if user.is_active and user.is_staff %} + {% url 'django-admindocs-docroot' as docsroot %} + {% if docsroot %}Documentation /{% endif %} + {% endif %} + {% if user.has_usable_password %} + Change password / + {% endif %} + +
+ {% csrf_token %} + +
+ {% endblock userlinks %} +
+{% endif %}