Show depicts labels in edit list.
This commit is contained in:
parent
68cf86162b
commit
123c9d8aa1
13
app.py
13
app.py
|
@ -486,7 +486,18 @@ def get_other(entity):
|
|||
|
||||
@app.route("/admin/edits")
|
||||
def list_edits():
|
||||
return render_template('list_edits.html', edits=Edit.query)
|
||||
# edit_count = Edit.query.count()
|
||||
edit_list = Edit.query.order_by(Edit.timestamp)
|
||||
|
||||
depicts_ids = {edit.depicts_id for edit in Edit.query}
|
||||
|
||||
q = DepictsItem.query.filter(DepictsItem.item_id.in_(depicts_ids))
|
||||
depicts_items = {item.item_id: item for item in q}
|
||||
|
||||
return render_template('list_edits.html',
|
||||
edits=Edit.query,
|
||||
depicts_items=depicts_items,
|
||||
edit_list=edit_list)
|
||||
|
||||
@app.route("/next/Q<int:item_id>")
|
||||
def next_page(item_id):
|
||||
|
|
|
@ -11,14 +11,15 @@
|
|||
<th>username</th>
|
||||
<th>painting</th>
|
||||
<th>depicts</th>
|
||||
<th>when</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for edit in edits %}
|
||||
{% for edit in edit_list %}
|
||||
<tr>
|
||||
<td><a href="{{ edit.user_page_url }}">{{ edit.username }}</a></td>
|
||||
<td>{{ edit.painting_qid }}</td>
|
||||
<td>{{ edit.depicts_qid }}</td>
|
||||
<td>{{ depicts_items[edit.depicts_id].label }} ({{ edit.depicts_qid }})</td>
|
||||
<td>{{ edit.timestamp }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in a new issue