diff --git a/app.py b/app.py index d53ae78..9c0c1e4 100755 --- a/app.py +++ b/app.py @@ -503,7 +503,9 @@ def get_other(entity): @app.route("/edits") def list_edits(): - edit_list = Edit.query.order_by(Edit.timestamp.desc()) + q = Edit.query.order_by(Edit.timestamp.desc()) + page = utils.get_int_arg('page') or 1 + pager = Pagination(page, 100, q.count()) item_count = (database.session .query(func.count(distinct(Edit.artwork_id))) @@ -514,8 +516,8 @@ def list_edits(): .scalar()) return render_template('list_edits.html', - edits=Edit.query, - edit_list=edit_list, + pager=pager, + edit_list=pager.slice(q), item_count=item_count, user_count=user_count) diff --git a/templates/list_edits.html b/templates/list_edits.html index f5439c9..43f5966 100644 --- a/templates/list_edits.html +++ b/templates/list_edits.html @@ -1,15 +1,18 @@ +{% from "macro.html" import render_pagination %} {% extends "base.html" %} {% block content %}
-

This tool has been used to add a total of {{ edits.count() }} depicts statements.

+

This tool has been used to add a total of {{ '{:,d}'.format(pager.total_count) }} depicts statements.

-

{{ user_count }} users have tried this tool.

+

{{ '{:,d}'.format(user_count) }} users have tried this tool.

-

{{ item_count }} artworks have been cataloged.

+

{{ '{:,d}'.format(item_count) }} artworks have been cataloged.

- + {{ render_pagination(pager) }} + +
@@ -28,12 +31,13 @@ - + {% endfor %}
username {{ edit.depicts.label }} ({{ edit.depicts_qid }}){{ edit.timestamp.strftime('%Y %b %d %H:%M') }}{{ edit.timestamp.strftime('%Y %b %d %H:%M') }}
+ {{ render_pagination(pager) }}