mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-09 10:54:11 -04:00
If you’re only ever sending one template it’s really useful to be able to jump straight to that template from the dashboard. So this commit: - shows the template stats even if there’s only one row - hides the bar chart if there’s only one row (because it will always be 100%, and won’t be obvious what it is without its siblings)
26 lines
920 B
HTML
26 lines
920 B
HTML
{% from "components/message-count-label.html" import message_count_label %}
|
|
|
|
<dl>
|
|
{% for item in template_statistics %}
|
|
<div class="grid-row">
|
|
|
|
<dt class="column-half">
|
|
<span class="spark-bar-label">
|
|
<a href="{{ url_for('.view_template', service_id=current_service.id, template_id=item.template.id) }}">{{ item.template.name }}</a>
|
|
</span>
|
|
</dt>
|
|
|
|
<dd class="column-half">
|
|
{% if template_statistics|length > 1 %}
|
|
<span class="spark-bar">
|
|
<span style="width: {{ item.usage_count / most_used_template_count * 100 }}%"></span>
|
|
{{ item.usage_count }} {{ message_count_label(item.usage_count, item.template.template_type) }}
|
|
</span>
|
|
{% else %}
|
|
{{ item.usage_count }} {{ message_count_label(item.usage_count, item.template.template_type) }}
|
|
{% endif %}
|
|
</dd>
|
|
|
|
</div>
|
|
{% endfor %}
|
|
</dl> |