diff options
author | 2017-07-30 00:47:52 +1000 | |
---|---|---|
committer | 2017-07-30 00:48:26 +1000 | |
commit | 513f87389c206bcfbb1d1b629bbc11245064527c (patch) | |
tree | b91e8bf5d0bfa2a67908ebb72f2ab598f8fbed48 | |
parent | sync: add gentoo-ci pkgcheck results syncronisation (diff) | |
download | grumpy-513f87389c206bcfbb1d1b629bbc11245064527c.tar.gz grumpy-513f87389c206bcfbb1d1b629bbc11245064527c.tar.bz2 grumpy-513f87389c206bcfbb1d1b629bbc11245064527c.zip |
frontend: add package page
The package page currently shows gentoo-ci pkgcheck results.
-rw-r--r-- | frontend/grumpy.py | 11 | ||||
-rw-r--r-- | frontend/templates/package.html | 35 |
2 files changed, 46 insertions, 0 deletions
diff --git a/frontend/grumpy.py b/frontend/grumpy.py index 8d106a6..5c0193c 100644 --- a/frontend/grumpy.py +++ b/frontend/grumpy.py @@ -32,6 +32,17 @@ class GrumpyView(FlaskView): else: abort(404) + @route('/package/<categoryname>/<packagename>', methods=['GET']) + def package(self, categoryname, packagename): + category = models.Category.query.filter_by(name=categoryname).first() + package = models.Package.query.filter_by(category=category,name=packagename).first() + pkgcheck = models.PkgCheck.query.filter_by(package=package) + + if package: + return render_template('package.html', category=category, package=package, pkgcheck=pkgcheck) + else: + abort(404) + class SetupView(FlaskView): @route('/', methods=['GET', 'POST']) # FIXME: Can we enable POST without giving a rule override from the automatic, or handle this some other better way with wtforms setup? def index(self): diff --git a/frontend/templates/package.html b/frontend/templates/package.html new file mode 100644 index 0000000..5d5b457 --- /dev/null +++ b/frontend/templates/package.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} +{% block content %} + +<div class="panel panel-default"> + <div class="panel-heading"> + <h3 class="panel-title"> + <span class="fa fa-fw fa-cubes"></span>{{ category.name }}/{{ package.name }} + </h3> + </div> + <div class="panel-heading"> + <h3 class="panel-title"> + PkgCheck results + </h3> + </div> + <div class="table-responsive"> + <table class="table table-striped"> + <thead> + <tr> + <th>Version</th> + <th>Class</th> + <th>Message</th> + </tr> + </thead> + {% for violation in pkgcheck -%} + <tr> + <td>{{ violation.version.version }}</td> + <td>{{ violation.violationclass }}</td> + <td>{{ violation.message }}</td> + </tr> + {%- endfor %} + </table> + </div> +</div> + +{% endblock %} |