From patchwork Thu Oct 1 14:52:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 525077 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A2B08140D70 for ; Fri, 2 Oct 2015 00:53:22 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 6255E1A03AF for ; Fri, 2 Oct 2015 00:53:22 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lists.ozlabs.org (Postfix) with ESMTP id 414AC1A010A for ; Fri, 2 Oct 2015 00:52:46 +1000 (AEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 01 Oct 2015 07:52:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,618,1437462000"; d="scan'208";a="781899046" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 01 Oct 2015 07:52:42 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t91EqfST005373; Thu, 1 Oct 2015 15:52:41 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t91EqfOg019653; Thu, 1 Oct 2015 15:52:41 +0100 Received: (from sfinucan@localhost) by sivswdev01.ir.intel.com with id t91EqfPf019649; Thu, 1 Oct 2015 15:52:41 +0100 From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH v2 06/10] templates/patch-list: Add patch "checks" column Date: Thu, 1 Oct 2015 15:52:30 +0100 Message-Id: <1443711154-18689-7-git-send-email-stephen.finucane@intel.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1443711154-18689-1-git-send-email-stephen.finucane@intel.com> References: <1443711154-18689-1-git-send-email-stephen.finucane@intel.com> X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Add a column to display the important "checks" fields for each patch. Note that only the "completed" checks are shown (i.e. "in progress" and "not started" checks are ignored). Signed-off-by: Stephen Finucane --- patchwork/templates/patchwork/patch-list.html | 5 +++++ patchwork/templatetags/patch.py | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/patchwork/templates/patchwork/patch-list.html b/patchwork/templates/patchwork/patch-list.html index 4b3cb23..4dd37c7 100644 --- a/patchwork/templates/patchwork/patch-list.html +++ b/patchwork/templates/patchwork/patch-list.html @@ -78,6 +78,10 @@ + S/W/F + + + {% ifequal order.name "date" %} {{ patch.name|default:"[no subject]" }} {{ patch|patch_tags }} + {{ patch|patch_checks }} {{ patch.date|date:"Y-m-d" }} {{ patch.submitter|personify:project }} {{ patch.delegate.username }} diff --git a/patchwork/templatetags/patch.py b/patchwork/templatetags/patch.py index 496dcfc..58575e9 100644 --- a/patchwork/templatetags/patch.py +++ b/patchwork/templatetags/patch.py @@ -1,5 +1,6 @@ # Patchwork - automated patch tracking system # Copyright (C) 2008 Jeremy Kerr +# Copyright (C) 2015 Intel Corporation # # This file is part of the Patchwork package. # @@ -20,6 +21,8 @@ from django import template from django.utils.safestring import mark_safe +from patchwork.models import Check + register = template.Library() @@ -34,3 +37,14 @@ def patch_tags(patch): return mark_safe('%s' % ( ' / '.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('%s' % ( + ' / '.join(titles), + ' '.join([str(counts[state]) for state in required])))