Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id C7E36E00A64; Fri, 6 Jan 2017 06:51:05 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [134.134.136.24 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 83893E007C2 for ; Fri, 6 Jan 2017 06:51:02 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 06 Jan 2017 06:51:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,325,1477983600"; d="scan'208";a="919627859" Received: from jalamego-mobl2.zpn.intel.com ([10.219.5.139]) by orsmga003.jf.intel.com with ESMTP; 06 Jan 2017 06:51:01 -0800 From: Jose Lamego To: yocto@yoctoproject.org Date: Fri, 6 Jan 2017 08:50:46 -0600 Message-Id: <1483714246-6857-1-git-send-email-jose.a.lamego@linux.intel.com> X-Mailer: git-send-email 1.9.1 Cc: Jose Lamego Subject: [patchwork][PATCH] patchwork/templates/patchwork/series: Improve series view X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2017 14:51:05 -0000 From: Jose Lamego Reviewing patches from a series requires heavy usage of the browser navigation buttons, providing a poor UX. This changes allows viewing content from each patch in a series, without leaving the series view. [YOCTO #10627] Signed-off-by: Jose Lamego --- htdocs/js/series.js | 43 +++++++++++ patchwork/templates/patchwork/patch.html | 15 ++-- patchwork/templates/patchwork/series.html | 114 ++++++++++++++++-------------- 3 files changed, 113 insertions(+), 59 deletions(-) create mode 100644 htdocs/js/series.js diff --git a/htdocs/js/series.js b/htdocs/js/series.js new file mode 100644 index 0000000..4f4f477 --- /dev/null +++ b/htdocs/js/series.js @@ -0,0 +1,43 @@ +$(document).ready(function(){ + $('[data-toggle="tooltip"]').tooltip(); + revTab=document.getElementById('revs-list') + coverView=document.getElementById('cover-letter-view'), + patchView=document.getElementById('patch-view'), + patchList=document.getElementById('patches-list') + + revTab.style.border='none' + revTab.style.background='transparent' + revTab.style.padding='15px' + coverView.style.display='block' + patchView.style.display='none' + patchList.style.display='none' + + document.getElementById('cover-letter-tab').onclick=function(){ + coverView.style.display='block' + patchView.style.display='none' + patchList.style.display='none' + } + + document.getElementById('patches-tab').onclick=function(){ + coverView.style.display='none' + patchList.style.display='block' + patchView.style.display="none" + } + + $('#revs-list').on('change', function(e){ + var optionSelected=$("option:selected", this) + jQuery('.tab-content div.tab-pane.fade.in.active'). + removeClass(' in active') + jQuery('.tab-content div#'+this.value+'.tab-pane.fade'). + addClass(' in active') + patchView.style.display='none' + }) + + $('.patch-link').on('click', function(){ + coverView.style.display='none' + patchView.style.display='block' + patchView.innerHTML= + '

Loading patch...

' + $("#patch-view").load(this.getAttribute("data-url") + " #patch-body") + }) +}) diff --git a/patchwork/templates/patchwork/patch.html b/patchwork/templates/patchwork/patch.html index 5ce540d..59df19d 100644 --- a/patchwork/templates/patchwork/patch.html +++ b/patchwork/templates/patchwork/patch.html @@ -7,6 +7,7 @@ {% block title %}{{patch.name}}{% endblock %} {% block body %} + - +

{{ patch.name }}

Submitted by {{ patch.submitter|personify:project }} on {{ patch.date }} + | + Patch ID: {{ patch.id }}

Details

@@ -134,10 +137,10 @@ function toggle_headers(link_id, headers_id)
{% csrf_token %} - + {% for bundle in bundles %} + + {% endfor %}
@@ -219,5 +222,5 @@ function toggle_headers(link_id, headers_id)
{% endfor %} - + {% endblock %} diff --git a/patchwork/templates/patchwork/series.html b/patchwork/templates/patchwork/series.html index c0a5261..6c35212 100644 --- a/patchwork/templates/patchwork/series.html +++ b/patchwork/templates/patchwork/series.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% load person %} +{% load static %} {% block title %}{{project.name}}{% endblock %} {% block headers %} @@ -9,64 +10,70 @@ $(function () { pw.setup_series({ patches: 'series-patchlist' }); }); + {% endblock %} {% block body %} -

{{ series.name }}

- -
- Submitted by {{ series.submitter|personify:project }} on {{ series.submitted }} -
- -

Details

+

{{ series.name }}

+ +
+ Submitted by {{ series.submitter|personify:project }} on {{ series.submitted }} + | + Reviewer: {{ series.reviewer }} + | + Updated on: {{ series.last_updated }} + | + Series ID: {{ series.pk }} +
- - - -{% if series.reviewer %} - -{% else %} - -{% endif %} - - - - - - - - - - - - - -
Reviewer{{ series.reviewer.name }}None
Submitted{{ series.submitted }}
Last Updated{{ series.last_updated }}
Revision{{ series.last_revision.version }}
+ +
{% if cover_letter %} -

Cover Letter

- -
-
-{{ cover_letter }}
-  
-
- +

Cover Letter

+
+
+      {{ cover_letter }}
+    
+
+{% else %} +

No cover letter was found for this series.

{% endif %} +
-

Revisions

- -
- - - -
+
{% for revision in revisions %}
@@ -87,8 +94,7 @@ $(function () { {% for patch in revision.patch_list %} - {{ patch.name|default:"[no subject]"|truncatechars:100 }} + {{ patch.name|default:"[no subject]"|truncatechars:100 }} {{ patch.submitter|personify:project }} {{ patch.state }} @@ -101,7 +107,7 @@ $(function () {

Tests

-
+
{% for test_result in revision.test_results %} {% include "patchwork/test-result.html" %} {% endfor %} @@ -114,6 +120,8 @@ $(function () { {% endfor %}
+
+
{% endblock %} -- 1.9.1