@@ -285,6 +285,50 @@ table.patchmeta tr th, table.patchmeta tr td {
padding-top: 1em;
}
+.checks {
+ border: 1px solid gray;
+ margin: 0.5em 1em;
+}
+
+.checks th {
+ background: #786fb4;
+ color: white;
+}
+
+.checks td {
+ border-top: 1px solid gray;
+ padding: 10px 15px;
+}
+
+.checks td a {
+ text-decoration: none;
+}
+
+.checks td a:visited {
+ color: #786FB4;
+}
+
+.checks a:hover {
+ text-decoration: underline;
+}
+
+.checks .state {
+ font-weight: bold;
+ color: #ddd;
+}
+
+.checks .state.success {
+ color: #82ca9d;
+}
+
+.checks .state.warning {
+ color: #ffe59a;
+}
+
+.checks .state.fail {
+ color: #f7977a;
+}
+
.comment .meta {
background: #f0f0f0;
}
@@ -19,6 +19,7 @@ ROOT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
+ 'django.contrib.humanize',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
@@ -1,5 +1,6 @@
{% extends "base.html" %}
+{% load humanize %}
{% load syntax %}
{% load person %}
{% load patch %}
@@ -176,6 +177,30 @@ function toggle_headers(link_id, headers_id)
>{{ patch.pull_url }}</a>
{% endif %}
+{% if patch.checks %}
+<h2>Checks</h2>
+<table class="checks">
+<tr>
+ <th>Context</th>
+ <th>Description</th>
+ <th>Check</th>
+</tr>
+{% for check in patch.checks %}
+<tr>
+ <td>{{ check.context }}</td>
+ <td>
+ {% if check.target_url %}<a href="{{ check.target_url }}">{% endif %}
+ {{ check.description }}</td>
+ {% if check.target_url %}</a>{% endif %}
+ <td><span title="Updated {{ check.date|naturaltime }}"
+ class="state {{ check.get_state_display }}">
+ {{ check.get_state_display }}</span>
+ </td>
+</tr>
+{% endfor %}
+</table>
+{% endif %}
+
<h2>Comments</h2>
{% for comment in patch.comments %}
<div class="comment">
@@ -48,3 +48,8 @@ def patch_checks(patch):
return mark_safe('<span title="%s">%s</span>' % (
' / '.join(titles),
' '.join([str(counts[state]) for state in required])))
+
+
+@register.filter(name='state_class')
+def state_class(state):
+ return '-'.join(state.split())
Add a table to display the checks associated with a patch. This includes the requisite styling along with some additional filters. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> --- htdocs/css/style.css | 44 ++++++++++++++++++++++++++++++++ patchwork/settings/base.py | 1 + patchwork/templates/patchwork/patch.html | 25 ++++++++++++++++++ patchwork/templatetags/patch.py | 5 ++++ 4 files changed, 75 insertions(+)