Merge remote-tracking branch 'origin/main' into 1028-move-signedouthtml-to-another-template

This commit is contained in:
Beverly Nguyen
2024-01-12 13:03:26 -08:00
10 changed files with 125 additions and 40 deletions

View File

@@ -585,7 +585,7 @@ def add_template_filters(application):
format_mobile_network,
format_yes_no,
square_metres_to_square_miles,
convert_markdown_template
convert_markdown_template,
]:
application.add_template_filter(fn)

View File

@@ -26,18 +26,16 @@ from app.utils.time import parse_naive_dt
def apply_html_class(tags, html_file):
new_html = html_file
for tag in tags:
element = tag[0]
class_name = tag[1]
soup = BeautifulSoup(new_html, 'html.parser')
soup = BeautifulSoup(new_html, "html.parser")
for xtag in soup.find_all(element):
xtag['class'] = class_name
xtag["class"] = class_name
new_html = str(soup)
@@ -45,12 +43,11 @@ def apply_html_class(tags, html_file):
def convert_markdown_template(mdf, test=False):
content_text = ""
if not test:
APP_ROOT = get_root_path('notifications-admin')
file = 'app/content/' + mdf + '.md'
APP_ROOT = get_root_path("notifications-admin")
file = "app/content/" + mdf + ".md"
md_file = os.path.join(APP_ROOT, file)
with open(md_file) as f:
content_text = f.read()

View File

@@ -138,16 +138,20 @@ def get_started_old():
@main.route("/using-notify/get-started")
@user_is_logged_in
def get_started():
markdown = convert_markdown_template('get-started')
html_style = apply_html_class([['ol', 'usa-process-list'],
['li', 'usa-process-list__item padding-bottom-4 margin-top-2'],
['h2', 'usa-process-list__heading line-height-sans-3']],
markdown)
markdown = convert_markdown_template("get-started")
html_style = apply_html_class(
[
["ol", "usa-process-list"],
["li", "usa-process-list__item padding-bottom-4 margin-top-2"],
["h2", "usa-process-list__heading line-height-sans-3"],
],
markdown,
)
return render_template(
"views/get-started.html",
navigation_links=using_notify_nav(),
content=html_style
content=html_style,
)

View File

@@ -13,7 +13,7 @@
{% if link %}
</a>
{% endif %}
<span class="big-number-status{% if (global_stats.email.failure_rate|float > 3) is sameas true %} big-number-status--failing{% endif %}">
<span class="big-number-status{% if (global_stats.email.failure_rate|float > 0) is sameas true %} big-number-status--failing{% endif %}">
{% if global_stats.email.failed %}
{% if failure_link %}
<a class="usa-link" href="{{ failure_link }}">
@@ -44,7 +44,7 @@
{% if link %}
</a>
{% endif %}
<span class="big-number-status{% if (global_stats.sms.failure_rate|float > 3) is sameas true %} big-number-status--failing{% endif %}">
<span class="big-number-status{% if (global_stats.sms.failure_rate|float > 0) is sameas true %} big-number-status--failing{% endif %}">
{% if global_stats.sms.failed %}
{% if failure_link %}
<a class="usa-link" href="{{ failure_link }}">