diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-03-19 16:19:00 +0000 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-03-19 16:19:00 +0000 |
| commit | df42a47ea20ec14a5716b5b23d4595239a260114 (patch) | |
| tree | f8d833b317942630ea7c42c2ee8c6a4b5d55a954 /app/main | |
| parent | visuals (diff) | |
| download | AnnotateChange-df42a47ea20ec14a5716b5b23d4595239a260114.tar.gz AnnotateChange-df42a47ea20ec14a5716b5b23d4595239a260114.zip | |
add task overview to user landing page
Diffstat (limited to 'app/main')
| -rw-r--r-- | app/main/routes.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/main/routes.py b/app/main/routes.py index e69282c..662e14a 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -1,11 +1,20 @@ # -*- coding: utf-8 -*- from flask import render_template -from flask_login import login_required +from flask_login import current_user from app.main import bp +from app.models import Task + @bp.route("/") @bp.route("/index") def index(): + if current_user.is_authenticated: + user_id = current_user.id + tasks = Task.query.filter_by(annotator_id=user_id).all() + tasks_done = [t for t in tasks if t.done] + tasks_todo = [t for t in tasks if not t.done] + return render_template("index.html", title="Home", + tasks_done=tasks_done, tasks_todo=tasks_todo) return render_template("index.html", title="Home") |
