--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/base.html Mon Jun 13 21:51:21 2016 +0800
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>{% block title %}{% end %}{% block extra-title %} - Cat and Owl's online linter{% end %}</title>
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.26.3/css/uikit.almost-flat.min.css" integrity="sha384-5bOKVP1JAsV2lpzCrvNxDsgBg/FrwwHfDcgmtE7quy/iY+stYq7ORPYbkzJYffwS" crossorigin="anonymous">
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js" integrity="sha384-rY/jv8mMhqDabXSo+UCggqKtdmBfd3qC2/KvyTDNQ6PcUJXaxK1tMepoQda4g5vB" crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.26.3/js/uikit.min.js" integrity="sha384-6OYggLGXv4OPaVsh9O/0baGeEYFu1r1FE3+sNtPeDk6JofnNNZb2sHKzUa7wum04" crossorigin="anonymous"></script>
+ <nav class="uk-navbar uk-navbar-attached">
+ <div class="uk-container uk-container-center" style="position: relative;">
+ <a class="uk-navbar-brand" href="/">Cat and Owl's online linter</a>
+ {% block content %}{% end %}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/index.html Mon Jun 13 21:51:21 2016 +0800
+{% extends "base.html" %}
+{% block title %}Recently checked projects{% end %}
+ <div class="uk-container uk-container-center uk-margin-large-top">
+ <h2>Recently checked projects</h2>
+ <table class="uk-table uk-table-middle">
+ {% for check in checks %}
+ {% set project = check.project %}
+ {% set change = check.change %}
+ <td>{{ check.errors }} error(s), {{ check.warnings }} warning(s)</td>
+ <td>#{{ check.ordinal }}</td>
+ <td>{{ project.name }}</td>
+ <td>{{ change.rev }}:{{ change.node[:12] }} {{ change.branch }}</td>
+ <td>{{ check.started }}</td>
+ <td>{{ check.finished }}</td>
+ <td>{{ check.finished - check.started }}</td>
--- a/viewer.py Mon Jun 13 11:26:22 2016 +0800
+++ b/viewer.py Mon Jun 13 21:51:21 2016 +0800
from tornado.ioloop import IOLoop
from tornado.options import define, options
-from tornado.web import Application, RequestHandler
+from tornado.web import Application, RequestHandler, URLSpec
-from candolint.models import database
+from candolint.models import database, Project, Change, Check
rel = lambda *x: os.path.abspath(os.path.join(os.path.dirname(__file__), *x))
+class IndexHandler(BaseHandler):
+ .select(Check, Project, Change)
+ .group_by(Check.project))
+ self.render('index.html', checks=checks)
class CandolintViewer(Application):
+ URLSpec(r'/', IndexHandler),
static_path=rel('static'),