Преглед изворни кода

new filter for status on tools

joel
Simon Bowie пре 1 година
родитељ
комит
69a6e616ac
2 измењених фајлова са 15 додато и 1 уклоњено
  1. +12
    -0
      web/app/templates/resources.html
  2. +3
    -1
      web/app/tool.py

+ 12
- 0
web/app/templates/resources.html Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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…
Откажи
Сачувај