add url & make it work

This commit is contained in:
bkfox
2022-05-05 17:15:06 +02:00
parent e44b77d0b3
commit ff398d8e7f
2 changed files with 36 additions and 11 deletions

View File

@ -5,14 +5,22 @@
{% block content %}
<ul>
{% for choice in choices %}
<div>
<form method="GET">
<li>
{% if choice.type %}
<form method="GET" action="?{{ choice.query_string }}"
onsubmit="return this.{{ choice.name }}.value ? true : false"">
<label for="filter-{{ choice.name }}">{{ choice.label }}: </label>
<input id="filter-{{ choice.name }}" type="{{ choice.type }}" name="{{ choice.name }}"
value="{{ choice.value }}" {{ choice.extra }} />
{% for k, v in choice.query_attrs.items %}
<input type="hidden" name="{{k}}" value="{{v}}" />
{% endfor %}
<button class="button"><img src="{% static "admin/img/search.svg" %}" /></button>
</form>
</div>
{% else %}
<a href="?{{ choice.query_string }}">{{ choice.label }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% endblock %}