Put counts into the notification filters

We can filter notifications on the activity page by state.

This commit adds counts to those filters.

This is mainly so that we can consistently do the same thing on the job
page later on.
This commit is contained in:
Chris Hill-Scott
2016-06-08 15:15:59 +01:00
parent e5d2514846
commit e7e0b2f227
6 changed files with 80 additions and 19 deletions

View File

@@ -1,3 +1,5 @@
{% from 'components/big-number.html' import big_number %}
{% macro pill(
title,
items=[],
@@ -5,12 +7,19 @@
) %}
<nav role='navigation' class='pill' aria-labelledby="pill_{{title}}">
<h2 id="pill_{{title}}" class="visuallyhidden">{{title}}</h2>
{% for label, option, link in items %}
{% for label, option, link, count in items %}
{% if current_value == option %}
<span aria-hidden="true">{{ label }}</span>
<span aria-hidden="true">
{% else %}
<a href="{{ link }}">{{ label }}</a>
<a href="{{ link }}">
{% endif %}
{{ big_number(count, smaller=True) }}
<div class="pill-label">{{ label }}</div>
{% if current_value == option %}
</span>
{% else %}
</a>
{% endif %}
{% endfor %}
</nav>
{% endmacro %}
{% endmacro %}