Allow filter links to be used in combination

Means you can see, for example emails that have failed.

Means adding:
- logic to generate links which can have a type parameter, a status
  parameter, or both
- a ‘pill’ UI component for seeing which filters you currently have
  applied
- some logic to change the page title based on which filters you have
  applied
This commit is contained in:
Chris Hill-Scott
2016-04-13 12:50:28 +01:00
parent 4da92f170a
commit e282ca2109
6 changed files with 139 additions and 18 deletions

View File

@@ -0,0 +1,16 @@
{% macro pill(
title,
items=[],
current_value=None
) %}
<nav role='navigation' class='pill' aria-labelledby="pill_{{title}}">
<h2 id="pill_{{title}}" class="visuallyhidden">{{title}}</h2>
{% for label, option, link in items %}
{% if current_value == option %}
<span aria-hidden="true">{{ label }}</span>
{% else %}
<a href="{{ link }}">{{ label }}</a>
{% endif %}
{% endfor %}
</nav>
{% endmacro %}