diff --git a/development.ini b/development.ini index cb20cc3..bd0108c 100644 --- a/development.ini +++ b/development.ini @@ -33,6 +33,11 @@ session.secret = 'Change Me 2' session.auto_csrf = true static_views.cache_max_age = 0 +# custom jinja filters and tests +jinja2.filters = + are_extras_active = ordr2.templates.tests:are_extras_active + + ### # wsgi server configuration ### diff --git a/ordr2/templates/macros.jinja2 b/ordr2/templates/macros.jinja2 index 3c2b5de..1ddf72e 100644 --- a/ordr2/templates/macros.jinja2 +++ b/ordr2/templates/macros.jinja2 @@ -16,16 +16,20 @@ {%- endmacro %} -{% macro filter_box(title, query_key, items) -%} +{% macro filter_box(title, query_key, items, extras=None) -%} + {% if not extras %} + {% set extras = dict() %} + {% endif %} + {% set extras_active = context|are_extras_active(extras) %}