Patchwork [bitbake-devel,2/9] toaster: blocks for custom/highlighted navigation and breadcrumb links

login
register
mail settings
Submitter Alexandru DAMIAN
Date March 27, 2014, 4:49 p.m.
Message ID <2cb1b8be0d3e6df3b9f46fd52d8b51e25b6d84ee.1395938903.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/69421/
State New
Headers show

Comments

Alexandru DAMIAN - March 27, 2014, 4:49 p.m.
From: David Reyna <David.Reyna@windriver.com>

Implement the navigation links as blocks so that each page can override and have
its respective link appear highlighted. Make the build breadcrumb a block so that
it is customizable to not be a link for the dashboard page. Reorder the page headers
to be consistent order for extends, projecttags, localbreadcrumb, nav-links.

[YOCTO #5916]
[YOCTO #4258]

Signed-off-by: David Reyna <David.Reyna@windriver.com>
---
 .../toastergui/templates/basebuildpage.html        | 50 ++++++++++++++++------
 lib/toaster/toastergui/templates/bpackage.html     |  6 ++-
 .../toastergui/templates/builddashboard.html       |  4 ++
 .../toastergui/templates/configuration.html        |  6 ++-
 lib/toaster/toastergui/templates/configvars.html   | 10 +++--
 lib/toaster/toastergui/templates/recipes.html      |  4 ++
 lib/toaster/toastergui/templates/target.html       | 10 +++++
 lib/toaster/toastergui/templates/tasks.html        | 30 +++++++++++++
 8 files changed, 101 insertions(+), 19 deletions(-)

Patch

diff --git a/lib/toaster/toastergui/templates/basebuildpage.html b/lib/toaster/toastergui/templates/basebuildpage.html
index 0ce5dbd..778c4d4 100644
--- a/lib/toaster/toastergui/templates/basebuildpage.html
+++ b/lib/toaster/toastergui/templates/basebuildpage.html
@@ -9,7 +9,13 @@ 
     <div class="section">
         <ul class="breadcrumb" id="breadcrumb">
 <li><a href="{% url 'all-builds' %}">All builds</a></li>
-<li><a href="{%url 'builddashboard' build.pk%}">{{build.get_sorted_target_list.0.target}} {%if build.target_set.all.count > 1%}(+ {{build.target_set.all.count|add:"-1"}}){%endif%} {{build.machine}} ({{build.completed_on|date:"d/m/y H:i"}})</a></li>
+            <li>
+            {% block parentbreadcrumb %}
+            <a href="{%url 'builddashboard' build.pk%}">
+                {{build.get_sorted_target_list.0.target}} {%if build.target_set.all.count > 1%}(+ {{build.target_set.all.count|add:"-1"}}){%endif%} {{build.machine}} ({{build.completed_on|date:"d/m/y H:i"}})
+            </a>
+            {% endblock %}
+            </li>
             {% block localbreadcrumb %}{% endblock %}
         </ul>
         <script>
@@ -28,19 +34,35 @@ 
             <ul class="nav nav-list well">
               {% if build.target_set.all.0.is_image %}
                 <li class="nav-header">Images</li>
-            {% for t in build.get_sorted_target_list %}
-                <li><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
-            {% endfor %}
-                  {% endif %}
-                <li class="nav-header">Build</li>
-                <li><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
-                <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
-                <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
-                <li><a href="{% url 'packages' build.pk %}">Packages</a></li>
-                <li class="nav-header">Performance</li>
-                <li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
-                <li><a href="{% url 'cpuusage' build.pk %}">CPU usage</a></li>
-                <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
+                {% block nav-target %}
+                  {% for t in build.get_sorted_target_list %}
+                    <li><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
+                  {% endfor %}
+                {% endblock %}
+              {% endif %}
+              <li class="nav-header">Build</li>
+              {% block nav-configuration %}
+                  <li><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
+              {% endblock %}
+              {% block nav-tasks %}
+                  <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
+              {% endblock %}
+              {% block nav-recipes %}
+                  <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
+              {% endblock %}
+              {% block nav-packages %}
+                  <li><a href="{% url 'packages' build.pk %}">Packages</a></li>
+              {% endblock %}
+                  <li class="nav-header">Performance</li>
+              {% block nav-buildtime %}
+                  <li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
+              {% endblock %}
+              {% block nav-cpuusage %}
+                  <li><a href="{% url 'cpuusage' build.pk %}">CPU usage</a></li>
+              {% endblock %}
+              {% block nav-diskio %}
+                  <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
+              {% endblock %}
             </ul>
         </div>
         <!-- end left sidebar container -->
diff --git a/lib/toaster/toastergui/templates/bpackage.html b/lib/toaster/toastergui/templates/bpackage.html
index dad0d7f..77f7894 100644
--- a/lib/toaster/toastergui/templates/bpackage.html
+++ b/lib/toaster/toastergui/templates/bpackage.html
@@ -6,6 +6,10 @@ 
 <li>Packages</li>
 {% endblock %}
 
+{% block nav-packages %}
+  <li class="active"><a href="{% url 'packages' build.pk %}">Packages</a></li>
+{% endblock %}
+
 {% block buildinfomain %}
 <div class="span10">
 <div class="page-header">
@@ -30,7 +34,7 @@ 
         </form>
       </div>
   </div>
-  
+
 {% else %}
 {% include "basetable_top.html" %}
 
diff --git a/lib/toaster/toastergui/templates/builddashboard.html b/lib/toaster/toastergui/templates/builddashboard.html
index 9d91f40..6563128 100644
--- a/lib/toaster/toastergui/templates/builddashboard.html
+++ b/lib/toaster/toastergui/templates/builddashboard.html
@@ -2,6 +2,10 @@ 
 {% load humanize %}
 {% load projecttags %}
 
+{% block parentbreadcrumb %}
+{{build.get_sorted_target_list.0.target}} {%if build.target_set.all.count > 1%}(+ {{build.target_set.all.count|add:"-1"}}){%endif%} {{build.machine}} ({{build.completed_on|date:"d/m/y H:i"}})
+{% endblock %}
+
 {% block buildinfomain %}
 <!-- page title -->
 <div class="row-fluid span10">
diff --git a/lib/toaster/toastergui/templates/configuration.html b/lib/toaster/toastergui/templates/configuration.html
index 674f896..49a6a89 100644
--- a/lib/toaster/toastergui/templates/configuration.html
+++ b/lib/toaster/toastergui/templates/configuration.html
@@ -1,9 +1,13 @@ 
 {% extends "basebuildpage.html" %}
+{% load projecttags %}
+
 {% block localbreadcrumb %}
 <li>Configuration</li>
 {% endblock %}
 
-{% load projecttags %}
+{% block nav-configuration %}
+  <li class="active"><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
+{% endblock %}
 
 {% block buildinfomain %}
 <!-- page title -->
diff --git a/lib/toaster/toastergui/templates/configvars.html b/lib/toaster/toastergui/templates/configvars.html
index 24cb2a5..de4940e 100644
--- a/lib/toaster/toastergui/templates/configvars.html
+++ b/lib/toaster/toastergui/templates/configvars.html
@@ -1,9 +1,13 @@ 
 {% extends "basebuildpage.html" %}
+{% load projecttags %}
+
 {% block localbreadcrumb %}
 <li>Configuration</li>
 {% endblock %}
 
-{% load projecttags %}
+{% block nav-configuration %}
+  <li class="active"><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
+{% endblock %}
 
 {% block buildinfomain %}
 <!-- page title -->
@@ -30,7 +34,7 @@ 
 
   <!-- variables -->
   <div id="variables" class="tab-pane">
-  
+
   {% if objects.paginator.count == 0 %}
   <div class="row-fluid">
       <div class="alert">
@@ -41,7 +45,7 @@ 
         </form>
       </div>
   </div>
-  
+
   {% else %}
   {% include "basetable_top.html" %}
 
diff --git a/lib/toaster/toastergui/templates/recipes.html b/lib/toaster/toastergui/templates/recipes.html
index 22c3d1a..907b83d 100755
--- a/lib/toaster/toastergui/templates/recipes.html
+++ b/lib/toaster/toastergui/templates/recipes.html
@@ -6,6 +6,10 @@ 
 <li>Recipes</li>
 {% endblock %}
 
+{% block nav-recipes %}
+  <li class="active"><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
+{% endblock %}
+
 {% block buildinfomain %}
 <div class="span10">
 <div class="page-header">
diff --git a/lib/toaster/toastergui/templates/target.html b/lib/toaster/toastergui/templates/target.html
index 5396b17..ceffada 100644
--- a/lib/toaster/toastergui/templates/target.html
+++ b/lib/toaster/toastergui/templates/target.html
@@ -5,6 +5,16 @@ 
 
 {% load projecttags %}
 
+{% block nav-target %}
+  {% for t in build.get_sorted_target_list %}
+    {% ifequal target.pk t.pk %}
+      <li class="active"><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
+    {% else %}
+      <li><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
+    {% endifequal %}
+  {% endfor %}
+{% endblock %}
+
 {% block buildinfomain %}
 
 <div class="row-fluid span10">
diff --git a/lib/toaster/toastergui/templates/tasks.html b/lib/toaster/toastergui/templates/tasks.html
index ace30de..8c73dc2 100644
--- a/lib/toaster/toastergui/templates/tasks.html
+++ b/lib/toaster/toastergui/templates/tasks.html
@@ -1,9 +1,39 @@ 
 {% extends "basebuildpage.html" %}
 {% load projecttags %}
+
 {% block localbreadcrumb %}
 <li>{{title}}</li>
 {% endblock %}
 
+{% block nav-tasks %}
+  {% if 'Tasks' == title %}
+    <li class="active"><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
+  {% else %}
+    <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
+  {% endif %}
+{% endblock %}
+{% block nav-buildtime %}
+  {% if 'Time' == title %}
+    <li class="active"><a href="{% url 'buildtime' build.pk %}">Time</a></li>
+  {% else %}
+    <li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
+  {% endif %}
+{% endblock %}
+{% block nav-cpuusage %}
+  {% if 'CPU usage' == title %}
+    <li class="active"><a href="{% url 'cpuusage' build.pk %}">CPU usage</a></li>
+  {% else %}
+    <li><a href="{% url 'cpuusage' build.pk %}">CPU usage</a></li>
+  {% endif %}
+{% endblock %}
+{% block nav-diskio %}
+  {% if 'Disk I/O' == title %}
+    <li class="active"><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
+  {% else %}
+    <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
+  {% endif %}
+{% endblock %}
+
 {% block buildinfomain %}
 <div class="span10">
 <div class="page-header">