Add page showing priority of two SMS providers

It’s not very useful to know the priority of one provider without
knowing the other. And these pages were never really designed, so they
weren’t super easy to understand anyway.

This commit adds a page that takes the first two text message providers
and shows their relative priority against each other.

It follows the design of the events page, as a pattern for showing a
log of historical events.
This commit is contained in:
Chris Hill-Scott
2019-12-02 14:29:34 +00:00
parent 9b12747bb4
commit 16ebdfeb8b
4 changed files with 208 additions and 2 deletions

View File

@@ -0,0 +1,61 @@
{% extends "views/platform-admin/_base_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-header.html" import page_header %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/form.html" import form_wrapper %}
{% block per_page_title %}
Text message providers
{% endblock %}
{% block platform_admin_content %}
{{ page_header('Text message providers') }}
{% call form_wrapper() %}
{% endcall %}
{% for day, versions in versions %}
<h2 class="heading-small top-gutter">
{% if day %}
{{ day|format_date_human|title }}
{% else %}
Start
{% endif %}
</h2>
<ul class="bottom-gutter">
{% for version in versions %}
<li class="history-list-item">
<div class="grid-row">
<div class="column-one-third">
<div class="history-list-user">
{{ version.created_by.name or ('&nbsp;'|safe) }}
</div>
{% if version.updated_at %}
<div class="history-list-time">
{{ version.updated_at|format_time }}
</div>
{% endif %}
</div>
<div class="column-two-thirds">
{% set percentage = (version.priority / (version.priority + version.other_provider.priority) * 100) %}
<div class="history-list-percentage">
<div class="history-list-percentage-left-label">
{{ version.display_name }}<br><br>
{{ percentage|format_thousands }}%
</div>
<div class="history-list-percentage-right-label">
{{ version.other_provider.display_name }}<br><br>
{{ (100 - percentage)|format_thousands }}%
</div>
<div class="history-list-percentage-marker" style="left: {{ (100 -percentage)|format_thousands }}%"></div>
</div>
</div>
</div>
</li>
{% endfor %}
</ul>
{% endfor %}
{% endblock %}