From nobody Fri Apr 19 22:15:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524485671188486.29002542166256; Mon, 23 Apr 2018 05:14:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 312D031500BE; Mon, 23 Apr 2018 12:14:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21D535E1A0; Mon, 23 Apr 2018 12:14:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0FDEE4CA9E; Mon, 23 Apr 2018 12:14:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3NCESRP004174 for ; Mon, 23 Apr 2018 08:14:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1A65010FFE6F; Mon, 23 Apr 2018 12:14:28 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-110.ams2.redhat.com [10.36.116.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7552510FFE6D for ; Mon, 23 Apr 2018 12:14:27 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 23 Apr 2018 14:14:20 +0200 Message-Id: <20180423121423.21500-2-pbonzini@redhat.com> In-Reply-To: <20180423121423.21500-1-pbonzini@redhat.com> References: <20180423121423.21500-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 1/4] add result renderer infrastructure X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 23 Apr 2018 12:14:30 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Plugins can prepare the "status" section of the series/message detail pages from the same Result objects used by the REST API. Record in the Result the object that created it, so that it can prepare an HTML rendering of the Result. Signed-off-by: Paolo Bonzini --- api/models.py | 11 ++++++++--- static/css/base.css | 6 ++++-- www/templates/project-detail.html | 9 +++++++++ www/templates/series-detail.html | 9 +++++++++ www/views.py | 18 ++++++++++++++++++ 5 files changed, 48 insertions(+), 5 deletions(-) diff --git a/api/models.py b/api/models.py index 9aa1196..501070c 100644 --- a/api/models.py +++ b/api/models.py @@ -601,13 +601,18 @@ class Module(models.Model): def __str__(self): return self.name =20 -class Result(namedtuple("Result", "name status log log_url obj data")): +class Result(namedtuple("Result", "name status log log_url obj data render= er")): __slots__ =3D () =20 - def __new__(cls, name, status, obj, log=3DNone, log_url=3DNone, data= =3DNone, request=3DNone): + def __new__(cls, name, status, obj, log=3DNone, log_url=3DNone, data= =3DNone, request=3DNone, renderer=3DNone): if log_url is not None and request is not None: log_url =3D request.build_absolute_uri(log_url) if status not in ('pending', 'success', 'failure'): raise ValueError("invalid value '%s' for status field" % statu= s) return super(cls, Result).__new__(cls, status=3Dstatus, log=3Dlog,= log_url=3Dlog_url, - obj=3Dobj, data=3Ddata, name=3Dn= ame) + obj=3Dobj, data=3Ddata, name=3Dn= ame, renderer=3Drenderer) + + def render(self): + if self.renderer is None: + return None + return self.renderer.render_result(self) diff --git a/static/css/base.css b/static/css/base.css index 82995f5..35fba6e 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -137,10 +137,12 @@ h1, h2, h3, .h1, .h2, .h3 { .status-content > .fa { color: #337ab7; } -.status-content.status-alert > .fa { +.status-content.status-alert > .fa, +.status-content.status-failure > .fa { color: #CC0000; } -.status-content.status-good > .fa { +.status-content.status-good > .fa, +.status-content.status-success > .fa { color: #009900; } .status-content > div { diff --git a/www/templates/project-detail.html b/www/templates/project-deta= il.html index 80fce3b..aaccdc0 100644 --- a/www/templates/project-detail.html +++ b/www/templates/project-detail.html @@ -41,6 +41,15 @@ {% endif %} +{% for result in results %} +
+ {% if result.status =3D=3D "pending" %} + {% elif result.status =3D=3D "running" %} + {% elif result.status =3D=3D "failure" %} + {% elif result.status =3D=3D "success" %} {% endif %} +
{{ result.html }}
+
+{% endfor %} {% for status in project.extra_status %}
{% if status.icon %} diff --git a/www/templates/series-detail.html b/www/templates/series-detail= .html index 434bc35..9b2db1c 100644 --- a/www/templates/series-detail.html +++ b/www/templates/series-detail.html @@ -56,6 +56,15 @@
Only {{ series.num_patches }} patches received!
{% endif %} +{% for result in results %} +
+ {% if result.status =3D=3D "pending" %} + {% elif result.status =3D=3D "running" %} + {% elif result.status =3D=3D "failure" %} + {% elif result.status =3D=3D "success" %} {% endif %} +
{{ result.html }}
+
+{% endfor %} {% for status in series.extra_status %}
{% if status.icon %} diff --git a/www/views.py b/www/views.py index 8965ebf..b0ccf48 100644 --- a/www/views.py +++ b/www/views.py @@ -91,6 +91,21 @@ def prepare_series(request, s, skip_patches=3DFalse): add_msg_recurse(s, skip_patches) return r =20 +def prepare_results(request, obj): + results =3D [] + dispatch_module_hook("rest_results_hook", request=3Drequest, + obj=3Dobj, results=3Dresults, detailed=3DFalse) + + results_dicts =3D [] + for result in results: + html =3D result.render() + if html is None: + continue + d =3D result._asdict() + d['html'] =3D html + results_dicts.append(d) + return results_dicts + def prepare_series_list(request, sl): return [prepare_message(request, s, False) for s in sl] =20 @@ -204,6 +219,7 @@ def view_project_detail(request, project): po.extra_ops =3D [] dispatch_module_hook("prepare_project_hook", request=3Drequest, projec= t=3Dpo) return render_page(request, "project-detail.html", + results=3Dprepare_results(request, po), project=3Dpo, navigate_links=3Dnav_path, search=3D"") @@ -255,6 +271,7 @@ def view_series_detail(request, project, message_id): project=3Dproject, navigate_links=3Dnav_path, search=3Dsearch, + results=3Dprepare_results(request, s), patches=3Dprepare_patches(request, s), messages=3Dprepare_series(request, s, is_cover_lett= er)) =20 @@ -280,5 +297,6 @@ def view_series_message(request, project, thread_id, me= ssage_id): project=3Dproject, navigate_links=3Dnav_path, search=3Dsearch, + results=3D[], patches=3Dprepare_patches(request, s), messages=3Dprepare_series(request, m)) --=20 2.17.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Fri Apr 19 22:15:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524485671899475.8588571069421; Mon, 23 Apr 2018 05:14:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E566280B2A; Mon, 23 Apr 2018 12:14:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D609D6608D; Mon, 23 Apr 2018 12:14:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C87C2180596E; Mon, 23 Apr 2018 12:14:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3NCESlK004185 for ; Mon, 23 Apr 2018 08:14:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id CE05A10FFE6D; Mon, 23 Apr 2018 12:14:28 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-110.ams2.redhat.com [10.36.116.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5EFC510FFE74 for ; Mon, 23 Apr 2018 12:14:28 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 23 Apr 2018 14:14:21 +0200 Message-Id: <20180423121423.21500-3-pbonzini@redhat.com> In-Reply-To: <20180423121423.21500-1-pbonzini@redhat.com> References: <20180423121423.21500-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 2/4] git: add rendering of Results X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 23 Apr 2018 12:14:30 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- mods/git.py | 62 +++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/mods/git.py b/mods/git.py index 1f22f2e..7d33566 100644 --- a/mods/git.py +++ b/mods/git.py @@ -122,7 +122,13 @@ class GitModule(PatchewModule): else: git_repo =3D obj.get_property("git.repo") git_tag =3D obj.get_property("git.tag") - data =3D {'repo': git_repo, 'tag': 'refs/tags/' + git_tag} + git_url =3D obj.get_property("git.url") + data =3D {} + if git_repo and git_tag: + data['repo'] =3D git_repo + data['tag'] =3D 'refs/tags/' + git_tag + if git_url: + data['url'] =3D git_url status =3D 'success' log_url =3D reverse("git-log", kwargs=3D{'series': obj.message= _id}) else: @@ -130,30 +136,19 @@ class GitModule(PatchewModule): log_url =3D None results.append(Result(name=3D'git', obj=3Dobj, status=3Dstatus, log=3Dlog, log_url=3Dlog_url, data=3Ddata, - request=3Drequest)) + request=3Drequest, renderer=3Dself)) =20 def prepare_message_hook(self, request, message, detailed): if not message.is_series_head: return - l =3D message.get_property("git.apply-log") - if l: - failed =3D message.get_property("git.apply-failed") - log_url =3D reverse("git-log", - kwargs=3D{"series": message.message_id}) - html_log_url =3D log_url + "?html=3D1" - colorbox_a =3D format_html('apply log', - html_log_url, log_url) - if failed: + if message.get_property("git.apply-log"): + if message.get_property("git.apply-failed"): title =3D "Failed in applying to current master" message.status_tags.append({ "title": title, "type": "default", "char": "G", }) - message.extra_status.append({ - "kind": "alert", - "html": format_html('{} ({})', title, colorbox_a), - }) else: git_url =3D message.get_property("git.url") git_repo =3D message.get_property("git.repo") @@ -165,25 +160,12 @@ class GitModule(PatchewModule): "type": "info", "char": "G", }) - if git_repo and git_tag: - message.extra_status.append({ - "kind": "good", - "html": format_html('Patches applied successfu= lly (tree, {}).
git fetch {} {}', - git_url, colorbox_a, git_r= epo, git_tag), - }) else: message.status_tags.append({ "title": format_html("Patches applied successfully= "), "type": "info", "char": "G", }) - message.extra_status.append({ - "kind": "good", - "html": format_html('Patches applied successfully = ({})', - colorbox_a), - "extra": colorbox_div, - "id": "gitlog" - }) if request.user.is_authenticated: if message.get_property("git.apply-failed") !=3D None or \ message.get_property("git.need-apply") =3D=3D None: @@ -195,6 +177,30 @@ class GitModule(PatchewModule): "class": "warning", }) =20 + def render_result(self, result): + if result.status =3D=3D 'pending': + return None + + if result.log_url is not None: + html_log_url =3D result.log_url + "?html=3D1" + colorbox_a =3D format_html('apply log', + html_log_url, result.log_url) + if result.status =3D=3D 'failed': + return format_html('Failed in applying to current master (= {})', title, colorbox_a) + else: + if 'url' in result.data: + s =3D format_html('tree, {}', resul= t.data['url'], colorbox_a) + else: + s =3D colorbox_a + s =3D format_html('Patches applied successfully ({})', s) + if 'repo' in result.data and 'tag' in result.data: + git_repo =3D result.data['repo'] + git_tag =3D result.data['tag'] + if git_tag.startswith('refs/tags/'): + git_tag =3D git_tag[5:] + s +=3D format_html('
git fetch {} {}'= , git_repo, git_tag) + return s + def prepare_project_hook(self, request, project): if not project.maintained_by(request.user): return --=20 2.17.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Fri Apr 19 22:15:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524485671856396.9069840400383; Mon, 23 Apr 2018 05:14:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 015CE30A034B; Mon, 23 Apr 2018 12:14:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E3C8F5E1A0; Mon, 23 Apr 2018 12:14:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D87984CA9E; Mon, 23 Apr 2018 12:14:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3NCETDt004195 for ; Mon, 23 Apr 2018 08:14:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id AEF921102E28; Mon, 23 Apr 2018 12:14:29 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-110.ams2.redhat.com [10.36.116.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2003810FFE6F for ; Mon, 23 Apr 2018 12:14:28 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 23 Apr 2018 14:14:22 +0200 Message-Id: <20180423121423.21500-4-pbonzini@redhat.com> In-Reply-To: <20180423121423.21500-1-pbonzini@redhat.com> References: <20180423121423.21500-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 3/4] testing: add rendering of Results X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 23 Apr 2018 12:14:31 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- mods/testing.py | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/mods/testing.py b/mods/testing.py index 24d6ff0..8dc4d0a 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -228,22 +228,6 @@ class TestingModule(PatchewModule): ret[tn]["name"] =3D tn return ret =20 - def prepare_testing_report(self, obj): - for pn, p in obj.get_properties().items(): - if not pn.startswith("testing.report."): - continue - tn =3D pn[len("testing.report."):] - failed =3D not p["passed"] - log_url =3D self.reverse_testing_log(obj, tn, html=3DFalse) - html_log_url =3D self.reverse_testing_log(obj, tn, html=3DTrue) - passed_str =3D "failed" if failed else "passed" - html =3D format_html('Test {} {}', - tn, html_log_url, log_url, passed_str) - obj.extra_status.append({ - "kind": "alert" if failed else "good", - "html": html, - }) - def _build_reset_ops(self, obj): if isinstance(obj, Message): typearg =3D "type=3Dmessage" @@ -292,12 +276,12 @@ class TestingModule(PatchewModule): data =3D p.copy() del data['passed'] results.append(Result(name=3D'testing.' + tn, obj=3Dobj, statu= s=3Dpassed_str, - log=3Dlog, log_url=3Dlog_url, request=3D= request, data=3Ddata)) + log=3Dlog, log_url=3Dlog_url, request=3D= request, data=3Ddata, + renderer=3Dself)) =20 def prepare_message_hook(self, request, message, detailed): if not message.is_series_head: return - self.prepare_testing_report(message) if message.project.maintained_by(request.user) \ and message.get_property("testing.started"): message.extra_ops +=3D self._build_reset_ops(message) @@ -321,6 +305,17 @@ class TestingModule(PatchewModule): "char": "T", }) =20 + def render_result(self, result): + if result.status !=3D 'success' and result.status !=3D 'failure': + return None + pn =3D result.name + tn =3D pn[len("testing."):] + failed =3D result.status =3D=3D 'failure' + html_log_url =3D result.log_url + '&html=3D1' + passed_str =3D "failed" if failed else "passed" + return format_html('Test {} {}', + tn, html_log_url, result.log_url, passed_str) + def check_active_testers(self, project): at =3D [] for k, v in project.get_properties().items(): @@ -347,7 +342,6 @@ class TestingModule(PatchewModule): "content_html": self.build_config_html(= request, = project)}) self.check_active_testers(project) - self.prepare_testing_report(project) =20 if project.maintained_by(request.user) \ and project.get_property("testing.started"): --=20 2.17.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Fri Apr 19 22:15:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524485673368102.31589396610184; Mon, 23 Apr 2018 05:14:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C09A80F75; Mon, 23 Apr 2018 12:14:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 461125C8B9; Mon, 23 Apr 2018 12:14:32 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2F81C1809547; Mon, 23 Apr 2018 12:14:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3NCEUo3004201 for ; Mon, 23 Apr 2018 08:14:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 787791102E28; Mon, 23 Apr 2018 12:14:30 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-110.ams2.redhat.com [10.36.116.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id F2F0F1102E2A for ; Mon, 23 Apr 2018 12:14:29 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 23 Apr 2018 14:14:23 +0200 Message-Id: <20180423121423.21500-5-pbonzini@redhat.com> In-Reply-To: <20180423121423.21500-1-pbonzini@redhat.com> References: <20180423121423.21500-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 4/4] www: remove extra_status from series detail view, simplify in project detail X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 23 Apr 2018 12:14:32 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Most of the functionality is not used anymore after conversion to Results. Signed-off-by: Paolo Bonzini --- mods/testing.py | 2 +- static/css/base.css | 2 -- www/templates/project-detail.html | 5 +---- www/templates/series-detail.html | 9 --------- www/views.py | 1 - 5 files changed, 2 insertions(+), 17 deletions(-) diff --git a/mods/testing.py b/mods/testing.py index 8dc4d0a..83b3914 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -330,7 +330,7 @@ class TestingModule(PatchewModule): if not at: return project.extra_status.append({ - "kind": "running", + "icon": "fa-refresh fa-spin", "html": "Active testers: " + ", ".join(at) }) =20 diff --git a/static/css/base.css b/static/css/base.css index 35fba6e..545aad1 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -137,11 +137,9 @@ h1, h2, h3, .h1, .h2, .h3 { .status-content > .fa { color: #337ab7; } -.status-content.status-alert > .fa, .status-content.status-failure > .fa { color: #CC0000; } -.status-content.status-good > .fa, .status-content.status-success > .fa { color: #009900; } diff --git a/www/templates/project-detail.html b/www/templates/project-deta= il.html index aaccdc0..35ee845 100644 --- a/www/templates/project-detail.html +++ b/www/templates/project-detail.html @@ -52,10 +52,7 @@ {% endfor %} {% for status in project.extra_status %}
- {% if status.icon %} - {% elif status.kind =3D=3D "running" %} - {% elif status.kind =3D=3D "alert" %} - {% elif status.kind =3D=3D "good" %} {% endif %} + {% if status.icon %}{% = endif %}
{{ status.html }}
{% endfor %} diff --git a/www/templates/series-detail.html b/www/templates/series-detail= .html index 9b2db1c..52b8f96 100644 --- a/www/templates/series-detail.html +++ b/www/templates/series-detail.html @@ -65,15 +65,6 @@
{{ result.html }}
{% endfor %} -{% for status in series.extra_status %} -
- {% if status.icon %} - {% elif status.kind =3D=3D "running" %} - {% elif status.kind =3D=3D "alert" %} - {% elif status.kind =3D=3D "good" %} {% endif %} -
{{ status.html }}
-
-{% endfor %} =20 {% if is_head %} {% if series.get_diff_stat %} diff --git a/www/views.py b/www/views.py index b0ccf48..7816024 100644 --- a/www/views.py +++ b/www/views.py @@ -52,7 +52,6 @@ def prepare_message(request, m, detailed): }) # hook points for plugins m.has_other_revisions =3D False - m.extra_status =3D [] m.extra_ops =3D [] m.extra_links =3D [] dispatch_module_hook("prepare_message_hook", request=3Drequest, messag= e=3Dm, --=20 2.17.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel