mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-12 01:14:11 -04:00
Show template stats even if there’s only 1 row
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)
This commit is contained in:
@@ -11,10 +11,14 @@
|
||||
</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>
|
||||
<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>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if template_statistics|length > 1 %}
|
||||
{% if template_statistics|length %}
|
||||
{% include 'views/dashboard/template-statistics.html' %}
|
||||
{{ show_more(
|
||||
url_for('.template_history', service_id=current_service.id),
|
||||
|
||||
Reference in New Issue
Block a user