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

31 lines
929 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
) %}
2017-02-14 14:21:36 +00:00
<ul role='tablist' class='pill'>
2016-06-08 15:15:59 +01:00
{% for label, option, link, count in items %}
{% if current_value == option %}
2017-02-14 14:21:36 +00:00
<li aria-selected='true' role='tab'>
<div class='pill-selected-item{% if not show_count %} pill-centered-item{% endif %}' tabindex='0'>
{% else %}
2017-02-14 14:21:36 +00:00
<li aria-selected='false' role='tab'>
<a href="{{ link }}">
2016-06-08 15:15:59 +01:00
{% endif %}
2017-06-13 15:28:33 +01:00
{% if show_count %}
2017-02-14 15:09:54 +00:00
{{ big_number(count, **big_number_args) }}
2017-06-13 15:28:33 +01:00
{% endif %}
<div class="pill-label{% if not show_count %} pill-centered-item{% endif %}">{{ label }}</div>
2016-06-08 15:15:59 +01:00
{% if current_value == option %}
2017-02-14 15:09:54 +00:00
</div>
2016-06-08 15:15:59 +01:00
{% else %}
2017-02-14 14:21:36 +00:00
</a>
{% endif %}
2017-02-14 14:21:36 +00:00
</li>
{% endfor %}
2017-02-14 14:21:36 +00:00
</ul>
2016-06-08 15:15:59 +01:00
{% endmacro %}