Added page for UI for tag list

master
Felix Stupp 3 years ago
parent ce01248ec2
commit 381ec54796
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -249,6 +249,14 @@ def show_stats():
}
)
@flask_app.route("/tag")
def show_tag():
tag_list: List[Tag] = Tag.select()
return render_template(
"tag_list.htm",
tag_list=tag_list,
)
@flask_app.route("/debug/test")
def test():

@ -0,0 +1,41 @@
{% import "macros.htm" as macros %}
<!DOCTYPE html>
<html>
{% set title = tag_list | length | string + " Tags known" %}
<head>
<meta charset="utf-8"/>
<title>{{ title }}</title>
{{ macros.shared_style() }}
</head>
<body>
<h1>{{ title }}</h1>
<table>
<tr>
<th>Id</th>
<th>Title</th>
<th>Use for Pref.</th>
<th>Super Tags</th>
<th>Sub Tags</th>
</tr>
{% for tag in tag_list %}
<tr>
<td>
{{ tag.id }}
</td>
<td>
{{ tag.title }}
</td>
<td>
{{ tag.use_for_preferences | tenary("Yes", "no") }}
</td>
<td>
{{ tag.super_tag_list | map(attribute="id") | join(",") }}
</td>
<td>
{{ tag.sub_tag_list | map(attribute="id") | join(",") }}
</td>
</tr>
{% endfor %}
</table>
</body>
</html>
Loading…
Cancel
Save