Files
notifications-admin/app/templates/components/pill.html
2020-09-10 23:11:13 +01:00

28 lines
1003 B
HTML

{% from 'components/big-number.html' import big_number %}
{% macro pill(
items=[],
current_value=None,
big_number_args={'smaller': True},
show_count=True
) %}
<nav aria-labelledby='page-header'>
<ul class='pill'>
{% for label, option, link, count in items %}
<li class="pill-item__container">
{% if current_value == option %}
<a id="pill-selected-item" class="pill-item pill-item--selected govuk-link govuk-link--no-visited-state{% if not show_count %} pill-item--centered{% endif %}" href="{{ link }}" aria-current="page">
{% else %}
<a class="pill-item govuk-link govuk-link--no-visited-state" href="{{ link }}">
{% endif %}
{% if show_count %}
{{ big_number(count, **big_number_args) }}
{% endif %}
<div class="pill-item__label{% if not show_count %} pill-item--centered{% endif %}">{{ label }}</div>
</a>
</li>
{% endfor %}
</ul>
</nav>
{% endmacro %}