--- a/candolint/uimodules.py Wed Jun 15 22:12:55 2016 +0800
+++ b/candolint/uimodules.py Wed Jun 15 22:13:58 2016 +0800
datetime = value.isoformat() + 'Z'
text = value.strftime('%Y-%m-%d %H:%M:%S') + ' UTC'
return self.render_string('ui/time.html', datetime=datetime, title=text, text=text)
+ def render(self, check):
+ return self.render_string('ui/badges.html', check=check)
--- a/static/main.css Wed Jun 15 22:12:55 2016 +0800
+++ b/static/main.css Wed Jun 15 22:13:58 2016 +0800
--- a/templates/index.html Wed Jun 15 22:12:55 2016 +0800
+++ b/templates/index.html Wed Jun 15 22:13:58 2016 +0800
{% set project = check.project %}
{% set change = check.change %}
- <td>{{ check.errors }} error(s), {{ check.warnings }} warning(s)</td>
+ <td>{% module Badges(check=check) %}</td>
<a href="/{{ project.domain }}/{{ project.user or '-' }}/{{ project.name }}/{{ check.ordinal }}">
--- a/templates/project.html Wed Jun 15 22:12:55 2016 +0800
+++ b/templates/project.html Wed Jun 15 22:13:58 2016 +0800
{% for check in checks %}
{% set change = check.change %}
- <td>{{ check.errors }} error(s), {{ check.warnings }} warning(s)</td>
+ <td>{% module Badges(check=check) %}</td>
<a href="/{{ project.domain }}/{{ project.user or '-' }}/{{ project.name }}/{{ check.ordinal }}">
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/ui/badges.html Wed Jun 15 22:13:58 2016 +0800
+{% if not check.success %}
+ <span class="uk-badge uk-badge-unknown uk-text-large" title="checking failed">?</span>
+{% elif check.errors or check.warnings %}
+ <span class="uk-badge uk-badge-danger uk-text-large"
+ title="{{ locale.translate('{} error', '{} errors', check.errors).format(check.errors) }}">
+ {% if check.warnings %}
+ <span class="uk-badge uk-badge-warning uk-text-large"
+ title="{{ locale.translate('{} warning', '{} warnings', check.warnings).format(check.warnings) }}">
+ <span class="uk-badge uk-badge-success uk-text-large" title="no lint found">OK</span>