padding-top: 1em;
}
+/* checks forms */
+/* TODO(stephenfin): Merge this with 'div.patchform' rules */
+.checks {
+ border: 1px solid gray;
+ margin: 0.5em 1em;
+}
+
+.checks th {
+ margin-top: 0em;
+ margin-left: -0.6em;
+ margin-right: -0.6em;
+ padding: 0.3em 0.3em 0.3em 0.6em;
+ background-color: #0A0A47;
+ color: white;
+ font-size: 100%;
+ font-weight: normal;
+}
+
+.checks td {
+ border-top: 1px solid gray;
+ padding: 10px 15px;
+ padding-left: 0.2em;
+ margin-top: 0em;
+}
+
+.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;
padding: 0.3em 0.5em;
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
+ 'django.contrib.humanize',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
{% extends "base.html" %}
+{% load humanize %}
{% load syntax %}
{% load person %}
{% load patch %}
>{{ patch.pull_url }}</a>
{% endif %}
+{% if patch.checks %}
+<h2>Checks</h2>
+<table class="checks">
+<tr>
+ <th>Context</th>
+ <th>Check</th>
+ <th>Description</th>
+</tr>
+{% for check in patch.checks %}
+<tr>
+ <td>{{ check.context }}</td>
+ <td>
+ <span title="Updated {{ check.date|naturaltime }}"
+ class="state {{ check.get_state_display }}">
+ {{ check.get_state_display }}
+ </span>
+ </td>
+ <td>
+ {% if check.target_url %}
+ <a href="{{ check.target_url }}">
+ {% endif %}
+ {{ check.description }}
+ {% if check.target_url %}
+ </a>
+ {% endif %}
+ </td>
+</tr>
+{% endfor %}
+</table>
+{% endif %}
+
{% for item in patch.commit_message %}
<h2>Commit Message</h2>
<div class="comment">
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())