306:edefddec933d
Anton Shestakov <av6@dwimlabs.net>, Sun, 24 Sep 2017 12:25:05 +0800
viewer: use subqueries to get data on index page Before, there were bare columns in the aggregate query, their values were undefined (but it somehow worked), as SQLite docs say. Good news is that now this bigger query uses (project_id, ordinal) index and is really fast.

next change 309:c828dbfa7137
previous change 299:18a3583a520a

templates/check.html

Permissions: -rw-r--r--

Other formats: Feeds:
{% extends "base.html" %}
{% block title %}Check #{{ check.ordinal }}{% end %}
{% block content %}
<div class="uk-container uk-container-center uk-margin-large-top">
<h2>
{% module Template('ui/project-link.html', project=project) %}
<span class="uk-text-nowrap">· check #{{ check.ordinal }}</span>
</h2>
<div class="uk-grid">
<div class="uk-width-small-1-3">
<dl class="uk-description-list-horizontal list-terse">
<dt>Started:</dt>
<dd>{% module Time(check.started) %}</dd>
<dt>Finished:</dt>
<dd>{% module Time(check.finished) %}</dd>
<dt>Duration:</dt>
<dd>{{ check.get_duration() }}</dd>
<dt>Result:</dt>
<dd>
<img src="{{ project.get_url() }}/{{ check.ordinal }}/dot.svg" alt="Check Result">
{% if check.success %}
{{ locale.translate('{} error', '{} errors', check.errors).format(check.errors) }},
{{ locale.translate('{} warning', '{} warnings', check.warnings).format(check.warnings) }}
{% else %}
job failed
{% end %}
</dd>
<dt>Other formats:</dt>
<dd><a href="{{ project.get_url() }}/{{ check.ordinal }}/raw">raw</a></dd>
</dl>
</div>
<div class="uk-width-small-2-3">
<dl class="uk-description-list-horizontal list-terse">
{% set change = check.change %}
<dt>Commit:</dt>
<dd><a href="{{ adapter.get_commit_url(change) }}">{% if change.rev is not None %}{{ change.rev }}:{% end %}{{ change.node[:12] }}</a></dd>
<dt>Branch:</dt>
<dd><a href="{{ adapter.get_branch_url(change) }}">{{ change.branch }}</a></dd>
<dt>Author:</dt>
<dd>{{ change.author }}</dd>
<dt>Date:</dt>
<dd>{% module Time(change.date, False) %}</dd>
<dt>Description:</dt>
<dd>{{ change.message }}</dd>
</dl>
</div>
</div>
{% if reference is not None %}
<p>
Overall,
{% 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
{% else %}
{% 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
{% else %}
same as
{% end %}
{% end %}
<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>).
</p>
{% end %}
{% if chart %}
<div class="chart-container"><svg id="check-chart"></svg></div>
<script type="application/json" id="check-chart-data">{% raw json_encode(chart) %}</script>
{% end %}
{% include ui/check-log.html %}
</div>
{% end %}