--- a/candolint/handlers.py Sat Sep 16 17:41:43 2017 +0800
+++ b/candolint/handlers.py Mon Sep 18 14:27:41 2017 +0800
line['link'] = adapter.get_line_url(check.change, line)
- self.render('check.html', project=project, check=check, lines=lines, adapter=adapter)
+ .select(*Check.get_light_fields())
+ .where(Check.project == check.project)
+ .where(Check.success == True)
+ .where(Check.change != check.change)
+ .where(Change.branch == check.change.branch)
+ .where(Check.ordinal < check.ordinal)
+ .order_by(Check.ordinal.desc())
+ self.render('check.html', project=project, check=check, lines=lines, adapter=adapter, reference=reference)
class CompareHandler(BaseHandler):
--- a/templates/check.html Sat Sep 16 17:41:43 2017 +0800
+++ b/templates/check.html Mon Sep 18 14:27:41 2017 +0800
+ {% if reference is not None %}
+ {% if check.errors > reference.errors %}
+ <span class="uk-text-danger">worse</span> than
+ {% elif check.errors < reference.errors %}
+ <span class="uk-text-success">better</span> than
+ {% if check.warnings > reference.warnings %}
+ <span class="uk-text-warning">worse</span> than
+ {% elif check.warnings < reference.warnings %}
+ <span class="uk-text-success">better</span> than
+ <a href="{{ project.get_url() }}/{{ reference.ordinal }}">check #{{ reference.ordinal }}</a>,
+ the previous check on branch {{ change.branch }}
+ (<a href="{{ project.get_url() }}/{{ check.ordinal }}/compare/{{ reference.ordinal }}">compare</a>).
{% include ui/check-log.html %}