>{% for tag in project.tags %}{{tag.abbrev}}{% if not forloop.last %}/{% endif %}{% endfor %}</span>
</th>
+ <th>
+ <span title="Success / Warning / Fail">S/W/F</span>
+ </th>
+
<th>
{% ifequal order.name "date" %}
<a class="colactive"
<td><a href="{% url 'patchwork.views.patch.patch' patch_id=patch.id %}"
>{{ patch.name|default:"[no subject]"|truncatechars:100 }}</a></td>
<td style="white-space: nowrap;">{{ patch|patch_tags }}</td>
+ <td style="white-space: nowrap;">{{ patch|patch_checks }}</td>
<td>{{ patch.date|date:"Y-m-d" }}</td>
<td>{{ patch.submitter|personify:project }}</td>
<td>{{ patch.delegate.username }}</td>
# Patchwork - automated patch tracking system
# Copyright (C) 2008 Jeremy Kerr <jk@ozlabs.org>
+# Copyright (C) 2015 Intel Corporation
#
# This file is part of the Patchwork package.
#
from django import template
from django.utils.safestring import mark_safe
+from patchwork.models import Check
+
register = template.Library()
return mark_safe('<span title="%s">%s</span>' % (
' / '.join(titles),
' '.join(counts)))
+
+
+@register.filter(name='patch_checks')
+def patch_checks(patch):
+ required = [Check.STATE_SUCCESS, Check.STATE_WARNING, Check.STATE_FAIL]
+ titles = ['Success', 'Warning', 'Fail']
+ counts = patch.check_count
+
+ return mark_safe('<span title="%s">%s</span>' % (
+ ' / '.join(titles),
+ ' '.join([str(counts[state]) for state in required])))