-need:
-{% for and_filter in filter_and %}
-<select name="t_and">
-<option></option>
-{% for tag in tags | sort %}
-<option value="{{tag|e}}" {% if and_filter == tag %}selected{% endif %}>{{tag|e}}</option>
-{% endfor %}
-</select>
-{% endfor %}
-<select name="t_and">
-<option></option>
-{% for tag in tags | sort %}
-<option value="{{tag|e}}">{{tag|e}}</option>
-{% endfor %}
-</select>
+need tags:
+{{ macros.tagselection(submit_name='and_tag', selected_tags=filter_and, all_tags=tags) }}
<br />
-hide:
-{% for not_filter in filter_not %}
-<select name="t_not">
-<option></option>
-{% for tag in tags | sort %}
-<option value="{{tag|e}}" {% if not_filter == tag %}selected{% endif %}>{{tag|e}}</option>
-{% endfor %}
-</select>
-{% endfor %}
-<select name="t_not">
-<option></option>
-{% for tag in tags | sort %}
-<option value="{{tag|e}}">{{tag|e}}</option>
-{% endfor %}
-</select>
+hide tags:
+{{ macros.tagselection(submit_name='not_tag', selected_tags=filter_not, all_tags=tags) }}