Files
notifications-admin/app/templates/views/platform-admin/index.html
Chris Hill-Scott d9da219b7e Use a macro for form tags
This will stop us repeatedly forgetting to add `novalidate` and
`autocomplete='off'` to our forms (which is how most of them are set
up).

It uses sensible defaults, based on how we most-commonly configure
forms:
- most of our forms are `post`ed (but this can be overridden)
- `autocomplete` should only be enabled where it makes sense, otherwise
  it’s more annoying than useful (but this can be overriden)
- we should never be using HTML5 form validation because our own error
  styles and messages are better
2018-09-19 12:43:15 +01:00

60 lines
1.8 KiB
HTML

{% extends "views/platform-admin/_base_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/big-number.html" import big_number_simple %}
{% from "components/message-count-label.html" import message_count_label %}
{% from "components/status-box.html" import status_box %}
{% from "components/form.html" import form_wrapper %}
{% block per_page_title %}
Platform admin
{% endblock %}
{% block platform_admin_content %}
<h1 class="heading-large">
Summary
</h1>
<details {% if form.errors %}open{% endif %}>
<summary>Apply filters</summary>
{% call form_wrapper(method="get") %}
{{ textbox(form.start_date, hint="Enter start date in format YYYY-MM-DD") }}
{{ textbox(form.end_date, hint="Enter end date in format YYYY-MM-DD") }}
</br>
<button type="submit" class="button">Filter</button>
{% endcall %}
</details>
<div class="grid-row bottom-gutter">
{% for noti_type in global_stats %}
<div class="column-third">
{{ big_number_simple(
noti_type.black_box.number,
message_count_label(noti_type.black_box.number, 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="grid-row bottom-gutter">
{% for noti_type in global_stats %}
<div class="column-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 %}