From 513f87389c206bcfbb1d1b629bbc11245064527c Mon Sep 17 00:00:00 2001 From: Michael Palimaka Date: Sun, 30 Jul 2017 00:47:52 +1000 Subject: frontend: add package page The package page currently shows gentoo-ci pkgcheck results. --- frontend/grumpy.py | 11 +++++++++++ frontend/templates/package.html | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 frontend/templates/package.html 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//', 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 %} + +
+
+

+ {{ category.name }}/{{ package.name }} +

+
+
+

+ PkgCheck results +

+
+
+ + + + + + + + + {% for violation in pkgcheck -%} + + + + + + {%- endfor %} +
VersionClassMessage
{{ violation.version.version }}{{ violation.violationclass }}{{ violation.message }}
+
+
+ +{% endblock %} -- cgit v1.2.3-65-gdbad