From patchwork Thu Nov 5 17:13:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 540537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7BB53140E3B for ; Fri, 6 Nov 2015 04:14:42 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 5E8D41A0D29 for ; Fri, 6 Nov 2015 04:14:42 +1100 (AEDT) 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 A391A1A0CA8 for ; Fri, 6 Nov 2015 04:14:13 +1100 (AEDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 05 Nov 2015 09:13:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,248,1444719600"; d="scan'208";a="594642450" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 05 Nov 2015 09:13:39 -0800 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 tA5HDasP023482; Thu, 5 Nov 2015 17:13:36 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id tA5HDaR4032223; Thu, 5 Nov 2015 17:13:36 GMT Received: (from sfinucan@localhost) by sivswdev01.ir.intel.com with id tA5HDanG032219; Thu, 5 Nov 2015 17:13:36 GMT From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH v3 5/8] templates/patch-list: Add patch "checks" column Date: Thu, 5 Nov 2015 17:13:20 +0000 Message-Id: <1446743603-31517-6-git-send-email-stephen.finucane@intel.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1446743603-31517-1-git-send-email-stephen.finucane@intel.com> References: <1446743603-31517-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 c81fe88..165b079 100644 --- a/patchwork/templates/patchwork/patch-list.html +++ b/patchwork/templates/patchwork/patch-list.html @@ -76,6 +76,10 @@ $(document).ready(function() { + S/W/F + + + {% ifequal order.name "date" %} {{ patch.name|default:"[no subject]"|truncatechars:100 }} {{ 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 3b28158..26cfc13 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() @@ -37,3 +40,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])))