mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-12 13:20:43 -04:00
We have a `client_request` fixture which does a bunch of useful stuff like: - checking the status code of the response - returning a `BeautifulSoup` object For most tests of a platform admin view we used `platform_admin_client` instead. This is not as good because it returns a raw `Response` object and doesn’t do the additional checks. This commit converts all the tests using `platform_admin_client` to: use new `client_request` and log in as `platform_admin_user` before making any requests. This is also nice because it makes any test easy to parametrize with additional users, for example to test differences in behaviour dependant on being platform admin or not.
66 lines
2.0 KiB
HTML
66 lines
2.0 KiB
HTML
{% extends "views/platform-admin/_base_template.html" %}
|
|
{% from "components/big-number.html" import big_number_simple %}
|
|
{% from "components/status-box.html" import status_box %}
|
|
{% from "components/form.html" import form_wrapper %}
|
|
{% from "components/details/macro.njk" import govukDetails %}
|
|
{% from "components/button/macro.njk" import govukButton %}
|
|
|
|
{% block per_page_title %}
|
|
Summary
|
|
{% endblock %}
|
|
|
|
{% block platform_admin_content %}
|
|
|
|
<h1 class="heading-medium">
|
|
Summary
|
|
</h1>
|
|
|
|
{% set details_content %}
|
|
{% call form_wrapper(method="get") %}
|
|
{{ form.start_date(param_extensions={"hint": {"text":"Enter start date in format YYYY-MM-DD"}}) }}
|
|
{{ form.end_date(param_extensions={"hint": {"text":"Enter end date in format YYYY-MM-DD"}}) }}
|
|
</br>
|
|
{{ govukButton({ "text": "Filter" }) }}
|
|
{% endcall %}
|
|
{% endset %}
|
|
|
|
{{ govukDetails({
|
|
"summaryText": "Apply filters",
|
|
"html": details_content,
|
|
"open": form.errors | convert_to_boolean
|
|
}) }}
|
|
|
|
<div class="govuk-grid-row bottom-gutter">
|
|
{% for noti_type in global_stats %}
|
|
<div class="govuk-grid-column-one-third">
|
|
{{ big_number_simple(
|
|
noti_type.black_box.number,
|
|
noti_type.black_box.number|message_count_label(noti_type.black_box.notification_type)
|
|
) }}
|
|
|
|
{% for item in noti_type.other_data %}
|
|
{{ status_box(
|
|
number=item.number,
|
|
label=item.label,
|
|
failing=item.failing,
|
|
percentage=item.percentage,
|
|
url=item.url)
|
|
}}
|
|
{% endfor %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<div class="govuk-grid-row bottom-gutter">
|
|
{% for noti_type in global_stats %}
|
|
<div class="govuk-grid-column-one-third">
|
|
<div class="bordered-text-box">
|
|
<span class="big-number-number">{{ "{:,}".format(noti_type.test_data.number) }}</span>
|
|
{{ noti_type.test_data.label }}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% endblock %}
|