2016-06-08 15:15:59 +01:00
|
|
|
{% from 'components/big-number.html' import big_number %}
|
|
|
|
|
|
2016-04-13 12:50:28 +01:00
|
|
|
{% 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
|
2016-04-13 12:50:28 +01:00
|
|
|
) %}
|
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 %}
|
2023-08-14 10:35:11 -04:00
|
|
|
<a id="pill-item-selected" class="pill-item pill-item--selected usa-link {% if not show_count %} pill-item--centered{% endif %}" aria-disabled="true" aria-current="page">
|
2020-09-03 16:05:08 +01:00
|
|
|
{% else %}
|
2023-06-08 13:12:00 -04:00
|
|
|
<a class="pill-item usa-dark-background usa-link usa-link--alt bg-primary" 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 %}
|