Selaa lähdekoodia

new filter for status on tools

joel
Simon Bowie 1 vuosi sitten
vanhempi
commit
69a6e616ac
2 muutettua tiedostoa jossa 15 lisäystä ja 1 poistoa
  1. +12
    -0
      web/app/templates/resources.html
  2. +3
    -1
      web/app/tool.py

+ 12
- 0
web/app/templates/resources.html Näytä tiedosto

@@ -115,6 +115,18 @@
</div>
</div>
{% endif %}
{% if status_filter %}
<div class="" >
<div class="filter-header">Status</div>
<div class="filter-options my-4" x-show="expandFilters">
{% for status in status_filter %}
<div {% if request.args.get('status')==status %} class="active" {% endif %}>
<a href="{{ url_for(request.endpoint, status=status) }}" hx-target="#resources" hx-select="#resources">{{ status }}</a>
</div>
{% endfor %}
</div>
</div>
{% endif %}
</div>

<div>

+ 3
- 1
web/app/tool.py Näytä tiedosto

@@ -47,7 +47,9 @@ def get_tools():
licenses_filter = get_filter_values('license', type)
# language
languages_filter = get_filter_values('scriptingLanguage', type)
return render_template('resources.html', resources=tools, type=type, practices_filter=practices_filter, licenses_filter=licenses_filter, languages_filter=languages_filter, count=count, view=view)
# status
status_filter = get_filter_values('status', type)
return render_template('resources.html', resources=tools, type=type, practices_filter=practices_filter, licenses_filter=licenses_filter, languages_filter=languages_filter, status_filter=status_filter, count=count, view=view)

# route for displaying a single tool based on the ID in the database
@tool.route('/tools/<int:tool_id>')

Loading…
Peruuta
Tallenna