Files
notifications-admin/app/templates/components/pill.html
Chris Hill-Scott 867143e871 Center-align pill text when there’s no big number
When the text is left aligned it looks messy because the spacing is so
uneven and there are no big numbers to give it some rhythm.
2017-06-23 13:49:27 +01:00

31 lines
929 B
HTML

{% from 'components/big-number.html' import big_number %}
{% macro pill(
items=[],
current_value=None,
big_number_args={'smaller': True},
show_count=True
) %}
<ul role='tablist' class='pill'>
{% for label, option, link, count in items %}
{% if current_value == option %}
<li aria-selected='true' role='tab'>
<div class='pill-selected-item{% if not show_count %} pill-centered-item{% endif %}' tabindex='0'>
{% else %}
<li aria-selected='false' role='tab'>
<a href="{{ link }}">
{% endif %}
{% if show_count %}
{{ big_number(count, **big_number_args) }}
{% endif %}
<div class="pill-label{% if not show_count %} pill-centered-item{% endif %}">{{ label }}</div>
{% if current_value == option %}
</div>
{% else %}
</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% endmacro %}