Skip to content

Commit ef4d4e8

Browse files
Refactor: Remove CA State Web Template (#2526)
- Remove CA State Web Template dependency, replace with Bootstrap - Remove CA State Web Template domain from CSP
2 parents 4cb6247 + a8a89dd commit ef4d4e8

File tree

12 files changed

+36
-42
lines changed

12 files changed

+36
-42
lines changed

benefits/core/templates/core/base.html

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,17 @@
1616
<title>{% block page-title %}{% endblock page-title %}| {% translate "Cal-ITP Benefits" %}</title>
1717
{# djlint:on #}
1818

19-
{% block preload %}{% endblock preload %}
19+
{% block preload %}
20+
{% endblock preload %}
2021

2122
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700" rel="stylesheet" type="text/css">
22-
23-
{% comment %}
24-
CA State Template v6.0.7 comes with Bootstrap v5.1.3
25-
See https://github.com/Office-of-Digital-Services/California-State-Web-Template/releases/tag/v6.0.7
26-
{% endcomment %}
27-
<link href="https://california.azureedge.net/cdt/statetemplate/6.0.7/css/cagov.core.min.css" rel="stylesheet">
28-
23+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
24+
rel="stylesheet"
25+
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
26+
crossorigin="anonymous">
2927
<link href="{% static "css/styles.css" %}" rel="stylesheet">
3028
<link href="{% static "img/favicon.ico" %}" rel="icon" type="image/x-icon" />
3129

32-
{% comment %}
33-
CA State Template v6.0.7 does not include jQuery
34-
See https://github.com/Office-of-Digital-Services/California-State-Web-Template/releases/tag/v6.0.7
35-
{% endcomment %}
3630
<script nonce="{{ request.csp_nonce }}"
3731
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"
3832
integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ="
@@ -149,15 +143,8 @@
149143

150144
</footer>
151145

152-
{% comment %}
153-
CA State Template v6.0.7 comes with Bootstrap v5.1.3
154-
see https://github.com/Office-of-Digital-Services/California-State-Web-Template/releases/tag/v6.0.7
155-
156-
But we aren't using CA State Template Javascript, so include Bootstrap directly
157-
{% endcomment %}
158-
<script nonce="{{ request.csp_nonce }}"
159-
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
160-
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
146+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
147+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
161148
crossorigin="anonymous"></script>
162149

163150
<script nonce="{{ request.csp_nonce }}">

benefits/core/templates/core/includes/lang-selector.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{% get_language_info for code as langinfo %}
1717
<input name="next" type="hidden" value="{{ redirect_to }}" />
1818
<input name="language" type="hidden" value="{{ code }}" />
19-
<button class="btn btn-lg btn-outline-light" type="submit">{{ langinfo.name_local | capfirst }}</button>
19+
<button class="btn btn-outline-light" type="submit">{{ langinfo.name_local | capfirst }}</button>
2020
</form>
2121
{% endif %}
2222
{% endfor %}

benefits/core/templates/core/includes/nocookies.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% load i18n %}
33

44
{% block content %}
5-
<div class="text-left">
5+
<div class="text-start">
66
<span class="navbar-brand">{% translate "Cookies are disabled" %}</span>
77
<span class="navbar-text">
88
{% translate "To function properly, this website requires a browser that supports cookies. Please enable cookies for this website and" %}

benefits/core/templates/core/includes/noscript.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% load i18n %}
33

44
{% block content %}
5-
<div class="text-left">
5+
<div class="text-start">
66
<span class="navbar-brand">{% translate "JavaScript is disabled" %}</span>
77
<span class="navbar-text">
88
{% translate "To function properly, this website requires a browser that supports JavaScript. Please enable JavaScript for this website and" %}

benefits/core/templates/core/landing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="row align-items-end align-items-lg-center">
2222
<div class="col-lg-5">
2323
<div class="box py-3 px-3 py-lg-0 px-lg-0 mt-lg-5 pt-lg-4">
24-
<h1 class="text-left p-0 ">
24+
<h1 class="text-start p-0 ">
2525
{% block headline %}
2626
{% endblock headline %}
2727
</h1>

benefits/in_person/templates/error-base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="row justify-content-center">
1010
<div class="col-lg-6">
1111
<div class="border border-3 p-3">
12-
<h2 class="p-0 m-0 text-left">In-person enrollment</h2>
12+
<h2 class="p-0 m-0 text-start">In-person enrollment</h2>
1313
</div>
1414
<div class="border border-3 border-top-0 p-3 min-vh-60 d-flex flex-column justify-content-between">
1515
<div class="d-flex">

benefits/in_person/templates/in_person/eligibility.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="row justify-content-center">
99
<div class="col-11 col-md-10 col-lg-6 border border-3 px-0">
1010
<div class="border border-3 border-top-0 border-start-0 border-end-0">
11-
<h2 class="p-3 m-0 text-left">In-person enrollment</h2>
11+
<h2 class="p-3 m-0 text-start">In-person enrollment</h2>
1212
</div>
1313
<div class="p-3">{% include "core/includes/form.html" with form=form %}</div>
1414
<div class="row d-flex justify-content-start p-3 pt-8">

benefits/in_person/templates/in_person/enrollment/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="row justify-content-center">
1010
<div class="col-lg-6">
1111
<div class="border border-3 p-3">
12-
<h2 class="p-0 m-0 text-left">In-person enrollment</h2>
12+
<h2 class="p-0 m-0 text-start">In-person enrollment</h2>
1313
</div>
1414
<div class="border border-3 border-top-0 p-3">
1515
<div class="loading">

benefits/in_person/templates/in_person/enrollment/success.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="row justify-content-center">
1010
<div class="col-lg-6">
1111
<div class="border border-3 p-3">
12-
<h2 class="p-0 m-0 text-left">In-person enrollment</h2>
12+
<h2 class="p-0 m-0 text-start">In-person enrollment</h2>
1313
</div>
1414
<div class="border border-3 border-top-0 p-3 min-vh-60 d-flex flex-column justify-content-between">
1515
<div class="d-flex">

benefits/settings.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def RUNTIME_ENVIRONMENT():
310310
env_connect_src = _filter_empty(os.environ.get("DJANGO_CSP_CONNECT_SRC", "").split(","))
311311
CSP_CONNECT_SRC.extend(env_connect_src)
312312

313-
CSP_FONT_SRC = ["'self'", "https://california.azureedge.net/", "https://fonts.gstatic.com/"]
313+
CSP_FONT_SRC = ["'self'", "https://fonts.gstatic.com/"]
314314
env_font_src = _filter_empty(os.environ.get("DJANGO_CSP_FONT_SRC", "").split(","))
315315
CSP_FONT_SRC.extend(env_font_src)
316316

@@ -353,9 +353,8 @@ def RUNTIME_ENVIRONMENT():
353353
CSP_STYLE_SRC = [
354354
"'self'",
355355
"'unsafe-inline'",
356-
"https://california.azureedge.net/",
357356
"https://fonts.googleapis.com/css",
358-
"https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/",
357+
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/",
359358
]
360359
env_style_src = _filter_empty(os.environ.get("DJANGO_CSP_STYLE_SRC", "").split(","))
361360
CSP_STYLE_SRC.extend(env_style_src)

0 commit comments

Comments
 (0)