1 |
commit: 40953ed104a9f49316360e261fa45bf7ff8ed57b |
2 |
Author: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 4 07:09:18 2016 +0000 |
4 |
Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 4 07:09:18 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/grumpy.git/commit/?id=40953ed1 |
7 |
|
8 |
frontend: add a /setup/ page for listing existing projects and devs |
9 |
|
10 |
Later we can convert this into a form to choose which projects/devs to follow; |
11 |
hence the "setup" naming. |
12 |
|
13 |
frontend/grumpy.py | 5 +++++ |
14 |
frontend/templates/setup.html | 40 ++++++++++++++++++++++++++++++++++++++++ |
15 |
2 files changed, 45 insertions(+) |
16 |
|
17 |
diff --git a/frontend/grumpy.py b/frontend/grumpy.py |
18 |
index 007748e..ea18a98 100644 |
19 |
--- a/frontend/grumpy.py |
20 |
+++ b/frontend/grumpy.py |
21 |
@@ -1,5 +1,6 @@ |
22 |
from flask import render_template, request |
23 |
from flask_classy import FlaskView |
24 |
+from sqlalchemy.sql import collate |
25 |
|
26 |
from backend.lib import models |
27 |
|
28 |
@@ -10,3 +11,7 @@ class GrumpyView(FlaskView): |
29 |
def index(self): |
30 |
categories = models.Category.query.all() |
31 |
return render_template("index.html", categories=categories) |
32 |
+ |
33 |
+ def setup(self): |
34 |
+ maintainers = models.Maintainer.query.order_by(collate(models.Maintainer.email, 'NOCASE')).all() |
35 |
+ return render_template("setup.html", maintainers=maintainers) |
36 |
|
37 |
diff --git a/frontend/templates/setup.html b/frontend/templates/setup.html |
38 |
new file mode 100644 |
39 |
index 0000000..e167c22 |
40 |
--- /dev/null |
41 |
+++ b/frontend/templates/setup.html |
42 |
@@ -0,0 +1,40 @@ |
43 |
+{% extends "base.html" %} |
44 |
+{% block content %} |
45 |
+ |
46 |
+<div class="panel panel-default"> |
47 |
+ <div class="panel-heading"> |
48 |
+ <h3 class="panel-title"> |
49 |
+ <span class="fa fa-fw fa-users"></span>Known projects |
50 |
+ </h3> |
51 |
+ </div> |
52 |
+ <div class="table-responsive"> |
53 |
+ <table class="table table-striped"> |
54 |
+ {% for maintainer in maintainers if maintainer.is_project -%} |
55 |
+ <tr> |
56 |
+ <td class="text-nowrap">{{ maintainer.email }}</td> |
57 |
+ <td>{{ maintainer.name }}</td> |
58 |
+ </tr> |
59 |
+ {%- endfor %} |
60 |
+ </table> |
61 |
+ </div> |
62 |
+</div> |
63 |
+ |
64 |
+<div class="panel panel-default"> |
65 |
+ <div class="panel-heading"> |
66 |
+ <h3 class="panel-title"> |
67 |
+ <span class="fa fa-fw fa-user"></span>Known developers |
68 |
+ </h3> |
69 |
+ </div> |
70 |
+ <div class="table-responsive"> |
71 |
+ <table class="table table-striped"> |
72 |
+ {% for maintainer in maintainers if not maintainer.is_project -%} |
73 |
+ <tr> |
74 |
+ <td class="text-nowrap">{{ maintainer.email }}</td> |
75 |
+ <td>{{ maintainer.name }}</td> |
76 |
+ </tr> |
77 |
+ {%- endfor %} |
78 |
+ </table> |
79 |
+ </div> |
80 |
+</div> |
81 |
+ |
82 |
+{% endblock %} |