diff options
author | 2016-12-04 09:09:18 +0200 | |
---|---|---|
committer | 2016-12-04 09:09:18 +0200 | |
commit | 40953ed104a9f49316360e261fa45bf7ff8ed57b (patch) | |
tree | c4df7a91c655bcbf146df81d69aa40dc399dfd6e | |
parent | sync: Project members and subprojects syncing to DB (diff) | |
download | grumpy-40953ed104a9f49316360e261fa45bf7ff8ed57b.tar.gz grumpy-40953ed104a9f49316360e261fa45bf7ff8ed57b.tar.bz2 grumpy-40953ed104a9f49316360e261fa45bf7ff8ed57b.zip |
frontend: add a /setup/ page for listing existing projects and devs
Later we can convert this into a form to choose which projects/devs to follow;
hence the "setup" naming.
-rw-r--r-- | frontend/grumpy.py | 5 | ||||
-rw-r--r-- | frontend/templates/setup.html | 40 |
2 files changed, 45 insertions, 0 deletions
diff --git a/frontend/grumpy.py b/frontend/grumpy.py index 007748e..ea18a98 100644 --- a/frontend/grumpy.py +++ b/frontend/grumpy.py @@ -1,5 +1,6 @@ from flask import render_template, request from flask_classy import FlaskView +from sqlalchemy.sql import collate from backend.lib import models @@ -10,3 +11,7 @@ class GrumpyView(FlaskView): def index(self): categories = models.Category.query.all() return render_template("index.html", categories=categories) + + def setup(self): + maintainers = models.Maintainer.query.order_by(collate(models.Maintainer.email, 'NOCASE')).all() + return render_template("setup.html", maintainers=maintainers) diff --git a/frontend/templates/setup.html b/frontend/templates/setup.html new file mode 100644 index 0000000..e167c22 --- /dev/null +++ b/frontend/templates/setup.html @@ -0,0 +1,40 @@ +{% extends "base.html" %} +{% block content %} + +<div class="panel panel-default"> + <div class="panel-heading"> + <h3 class="panel-title"> + <span class="fa fa-fw fa-users"></span>Known projects + </h3> + </div> + <div class="table-responsive"> + <table class="table table-striped"> + {% for maintainer in maintainers if maintainer.is_project -%} + <tr> + <td class="text-nowrap">{{ maintainer.email }}</td> + <td>{{ maintainer.name }}</td> + </tr> + {%- endfor %} + </table> + </div> +</div> + +<div class="panel panel-default"> + <div class="panel-heading"> + <h3 class="panel-title"> + <span class="fa fa-fw fa-user"></span>Known developers + </h3> + </div> + <div class="table-responsive"> + <table class="table table-striped"> + {% for maintainer in maintainers if not maintainer.is_project -%} + <tr> + <td class="text-nowrap">{{ maintainer.email }}</td> + <td>{{ maintainer.name }}</td> + </tr> + {%- endfor %} + </table> + </div> +</div> + +{% endblock %} |