Commit 8be2494fd44162e754ce4af03f7f835befc8e6d2
1 parent
4e9d7814
Exists in
master
and in
4 other branches
Remove list param from Category and Label routes
Showing
3 changed files
with
4 additions
and
8 deletions
Show diff stats
app/main/routes.py
... | ... | @@ -101,11 +101,9 @@ def labels(): |
101 | 101 | def label(label_id): |
102 | 102 | # get label |
103 | 103 | this_label = Label.query.get(int(label_id)) |
104 | - label_categories = this_label.categories | |
105 | 104 | # pass to template |
106 | 105 | return render_template('label.html', subtitle=f"{this_label.name}", |
107 | - label=this_label, | |
108 | - categories=label_categories) | |
106 | + label=this_label) | |
109 | 107 | |
110 | 108 | |
111 | 109 | @bp.route('/category/<category_id>') |
... | ... | @@ -113,11 +111,9 @@ def label(label_id): |
113 | 111 | def category(category_id): |
114 | 112 | # get category |
115 | 113 | this_category = Category.query.get(int(category_id)) |
116 | - category_labels = this_category.labels | |
117 | 114 | # pass to template |
118 | 115 | return render_template('category.html', subtitle=f"{this_category.name}", |
119 | - category=this_category, | |
120 | - labels=category_labels) | |
116 | + category=this_category) | |
121 | 117 | |
122 | 118 | |
123 | 119 | @bp.route('/categories') | ... | ... |
app/main/templates/category.html
... | ... | @@ -17,7 +17,7 @@ |
17 | 17 | <dt class="col-sm-2 text-right"></dt> |
18 | 18 | <dd class="col-sm-10 text-left"></dd> |
19 | 19 | <dt class="col-sm-2 text-right">Labels :</dt> |
20 | - <dd class="col-sm-10 text-left">{{ labels|map(attribute='name') |join(", " )}}</dd> | |
20 | + <dd class="col-sm-10 text-left">{{ category.labels|map(attribute='name') |join(", " )}}</dd> | |
21 | 21 | </dl> |
22 | 22 | {{ commons.edit_link(url_for('main.category_edit', category_id=category.id), 25) }} |
23 | 23 | {{ commons.delete_link( url_for('main.category_delete', category_id=category.id), 25) }} | ... | ... |
app/main/templates/label.html
... | ... | @@ -17,7 +17,7 @@ |
17 | 17 | <dt class="col-sm-2 text-right"></dt> |
18 | 18 | <dd class="col-sm-10 text-left"></dd> |
19 | 19 | <dt class="col-sm-2 text-right">Categories :</dt> |
20 | - <dd class="col-sm-10 text-left">{{ categories|map(attribute='name') |join(", " )}}</dd> | |
20 | + <dd class="col-sm-10 text-left">{{ label.categories|map(attribute='name') |join(", " )}}</dd> | |
21 | 21 | </dl> |
22 | 22 | {{ commons.edit_link(url_for('main.label_edit', label_id=label.id), 25) }} |
23 | 23 | {{ commons.delete_link( url_for('main.label_delete', label_id=label.id), 25) }} | ... | ... |