diff options
author | Michael Palimaka <kensington@gentoo.org> | 2017-07-30 02:15:26 +1000 |
---|---|---|
committer | Michael Palimaka <kensington@gentoo.org> | 2017-07-30 02:15:58 +1000 |
commit | 3ffde0d5a784722da8b07e5096506852299c1c6c (patch) | |
tree | 23fba8f113631f3c274934c5729adc134b6f3100 | |
parent | frontend: link from category listing to package page (diff) | |
download | grumpy-3ffde0d5a784722da8b07e5096506852299c1c6c.tar.gz grumpy-3ffde0d5a784722da8b07e5096506852299c1c6c.tar.bz2 grumpy-3ffde0d5a784722da8b07e5096506852299c1c6c.zip |
frontend: add basic maintainer page
-rw-r--r-- | frontend/grumpy.py | 10 | ||||
-rw-r--r-- | frontend/templates/maintainer.html | 25 |
2 files changed, 35 insertions, 0 deletions
diff --git a/frontend/grumpy.py b/frontend/grumpy.py index 972bbf9..3c4a62e 100644 --- a/frontend/grumpy.py +++ b/frontend/grumpy.py @@ -32,6 +32,16 @@ class GrumpyView(FlaskView): else: abort(404) + @route('/maintainer/<email>', methods=['GET']) + def maintainer(self, email): + maintainer = models.Maintainer.query.filter_by(email=email).first() + packages = models.Package.query.filter(models.Package.maintainers.contains(maintainer)) + + if maintainer: + return render_template('maintainer.html', maintainer=maintainer, packages=packages) + else: + abort(404) + @route('/maintainers', methods=['GET']) def maintainers(self): people = models.Maintainer.query.filter_by(is_project=False).order_by('email asc') diff --git a/frontend/templates/maintainer.html b/frontend/templates/maintainer.html new file mode 100644 index 0000000..0423937 --- /dev/null +++ b/frontend/templates/maintainer.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} +{% block content %} + +<div class="panel panel-default"> + <div class="panel-heading"> + <h3 class="panel-title"> + <span class="fa fa-fw fa-user"></span>{{ maintainer.email }} + </h3> + </div> + <div class="table-responsive"> + <table class="table table-striped"> + <thead> + <tr> + <th>Package</th> + </tr> + </thead> + {% for package in packages -%} + <tr> + <td class="text-nowrap"><a href="/package/{{ package.category.name }}/{{ package.name }}">{{ package.category.name}}/{{ package.name }}</a></td> + </tr> + {%- endfor %} + </table> + </div> +</div> +{% endblock %} |