Files
notifications-admin/app/templates/views/dashboard/template-statistics.html
Chris Hill-Scott c3d78f5652 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)
2016-05-13 10:26:57 +01:00

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>