Add type to tag links
This commit is contained in:
parent
821832770c
commit
28d967e3e2
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form method="get" action="">
|
<form method="get" action="">
|
||||||
|
{% if type %}<input type="hidden" name="type" value="{{ type }}" />{% endif %}
|
||||||
<input type="text" name="q" value="{{ query or ''}}" />
|
<input type="text" name="q" value="{{ query or ''}}" />
|
||||||
<input type="submit" value="Search" />
|
<input type="submit" value="Search" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -26,7 +27,7 @@
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
{% for t in tags %}
|
{% for t in tags %}
|
||||||
<li><a href="{{ url_for('packages_page', q=(query or '')+' tag:'+t.name) }}">
|
<li><a href="{{ url_for('packages_page', q=(query or '')+' tag:'+t.name, type=type) }}">
|
||||||
{{ t.title }}
|
{{ t.title }}
|
||||||
</a></li>
|
</a></li>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -31,7 +31,7 @@ def doPackageList(type):
|
||||||
return jsonify([package.getAsDictionary(app.config["BASE_URL"]) for package in query.all()])
|
return jsonify([package.getAsDictionary(app.config["BASE_URL"]) for package in query.all()])
|
||||||
else:
|
else:
|
||||||
tags = Tag.query.all()
|
tags = Tag.query.all()
|
||||||
return render_template("packages/list.html", title=title, packages=query.all(), query=search, tags=tags)
|
return render_template("packages/list.html", title=title, packages=query.all(), query=search, tags=tags, type=None if type is None else type.toName())
|
||||||
|
|
||||||
|
|
||||||
@app.route("/packages/")
|
@app.route("/packages/")
|
||||||
|
|
Loading…
Reference in New Issue