From patchwork Thu Oct 1 14:52:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 525079 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 8A417140D69 for ; Fri, 2 Oct 2015 00:53:46 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 7070B1A010C for ; Fri, 2 Oct 2015 00:53:46 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lists.ozlabs.org (Postfix) with ESMTP id 1592E1A039D for ; Fri, 2 Oct 2015 00:52:56 +1000 (AEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 01 Oct 2015 07:52:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,618,1437462000"; d="scan'208";a="817157178" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 01 Oct 2015 07:52:43 -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 t91Eqfap005376; 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 t91EqfIe019660; Thu, 1 Oct 2015 15:52:41 +0100 Received: (from sfinucan@localhost) by sivswdev01.ir.intel.com with id t91EqfQU019656; Thu, 1 Oct 2015 15:52:41 +0100 From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH v2 07/10] templates/patch: Add check summary panel Date: Thu, 1 Oct 2015 15:52:31 +0100 Message-Id: <1443711154-18689-8-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 table to display the checks associated with a patch. This includes the requisite styling along with some additional filters. Signed-off-by: Stephen Finucane --- 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(+) diff --git a/htdocs/css/style.css b/htdocs/css/style.css index e5bbc75..d3c02c2 100644 --- a/htdocs/css/style.css +++ b/htdocs/css/style.css @@ -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; } diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py index d00245d..8facb52 100644 --- a/patchwork/settings/base.py +++ b/patchwork/settings/base.py @@ -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', diff --git a/patchwork/templates/patchwork/patch.html b/patchwork/templates/patchwork/patch.html index f18ee3b..fe05d34 100644 --- a/patchwork/templates/patchwork/patch.html +++ b/patchwork/templates/patchwork/patch.html @@ -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 }} {% endif %} +{% if patch.checks %} +

Checks

+ + + + + + +{% for check in patch.checks %} + + + + {% if check.target_url %}{% endif %} + + +{% endfor %} +
ContextDescriptionCheck
{{ check.context }} + {% if check.target_url %}{% endif %} + {{ check.description }} + {{ check.get_state_display }} +
+{% endif %} +

Comments

{% for comment in patch.comments %}
diff --git a/patchwork/templatetags/patch.py b/patchwork/templatetags/patch.py index 58575e9..3d4eb9e 100644 --- a/patchwork/templatetags/patch.py +++ b/patchwork/templatetags/patch.py @@ -48,3 +48,8 @@ def patch_checks(patch): return mark_safe('%s' % ( ' / '.join(titles), ' '.join([str(counts[state]) for state in required]))) + + +@register.filter(name='state_class') +def state_class(state): + return '-'.join(state.split())