From 9bab970043330c9f27f4b29a55f046a3b701f026 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Wed, 27 Mar 2019 15:29:56 +0000 Subject: Allow admin to view annotations --- app/admin/routes.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'app/admin') diff --git a/app/admin/routes.py b/app/admin/routes.py index f8d72d2..bed0d18 100644 --- a/app/admin/routes.py +++ b/app/admin/routes.py @@ -168,6 +168,23 @@ def add_dataset(): return render_template("admin/add.html", title="Add Dataset", form=form) +@bp.route("/annotations", methods=("GET",)) +@admin_required +def view_annotations(): + annotations = ( + Annotation.query.join(Task, Annotation.task) + .join(User, Task.user) + .join(Dataset, Task.dataset) + .order_by(Dataset.name, User.username, Annotation.cp_index) + .all() + ) + return render_template( + "admin/annotations.html", + title="View Annotations", + annotations=annotations, + ) + + @bp.route("/", methods=("GET",)) @admin_required def index(): -- cgit v1.2.3