Files
notifications-admin/app/templates/components/pill.html
T

28 lines
1010 B
HTML
Raw Normal View History

2016-06-08 15:15:59 +01:00
{% from 'components/big-number.html' import big_number %}
{% macro pill(
items=[],
2017-01-25 15:59:06 +00:00
current_value=None,
2017-06-13 15:28:33 +01:00
big_number_args={'smaller': True},
show_count=True
) %}
2020-09-03 16:05:08 +01:00
<nav aria-labelledby='page-header'>
<ul class='pill'>
{% for label, option, link, count in items %}
2020-09-04 13:32:34 +01:00
<li class="pill-item__container">
2020-09-03 16:05:08 +01:00
{% if current_value == option %}
2020-09-09 22:31:11 +01:00
<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">
2020-09-03 16:05:08 +01:00
{% else %}
2020-09-04 13:32:34 +01:00
<a class="pill-item govuk-link govuk-link--no-visited-state" href="{{ link }}">
2017-06-13 15:28:33 +01:00
{% endif %}
2020-09-03 16:05:08 +01:00
{% if show_count %}
2020-09-04 13:32:34 +01:00
{{ big_number(count, **big_number_args) }}
2020-09-03 16:05:08 +01:00
{% endif %}
2021-02-24 14:34:56 +00:00
<div class="pill-item__label{% if not show_count %} pill-item--centered{% endif %}">{{ label | safe }}</div>
2020-09-04 13:32:34 +01:00
</a>
</li>
2020-09-03 16:05:08 +01:00
{% endfor %}
</ul>
</nav>
2016-06-08 15:15:59 +01:00
{% endmacro %}