[gnome-continuous-yocto/gnomeostree-3.28-rocko: 1807/8267] bitbake: toaster: tweak styling and typos in recent builds area



commit 9ed45f79745207f96dbd3cb6d9ef40ea8fcde42a
Author: Elliot Smith <elliot smith intel com>
Date:   Tue Jul 12 16:38:06 2016 +0100

    bitbake: toaster: tweak styling and typos in recent builds area
    
    Help icons need to have the Bootstrap tooltip() method called on
    them so that the popups are correctly styled.
    
    Ensure that the colour of the help/error/warning icons is correct,
    depending on the build state.
    
    Fix pluralisation of errors and warnings shown.
    
    Add a div around the build state area so it's easy to pick up
    where the state is going to display (e.g. in tests).
    
    [YOCTO #9631]
    
    (Bitbake rev: 98a923ff14188832ac44e0dbafc73bcba10e25da)
    
    Signed-off-by: Elliot Smith <elliot smith intel com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 .../lib/toaster/toastergui/static/js/mrbsection.js |    8 +++-
 .../toaster/toastergui/templates/mrb_section.html  |   47 ++++++++++---------
 2 files changed, 32 insertions(+), 23 deletions(-)
---
diff --git a/bitbake/lib/toaster/toastergui/static/js/mrbsection.js 
b/bitbake/lib/toaster/toastergui/static/js/mrbsection.js
index e7fbf01..73d0935 100644
--- a/bitbake/lib/toaster/toastergui/static/js/mrbsection.js
+++ b/bitbake/lib/toaster/toastergui/static/js/mrbsection.js
@@ -84,14 +84,20 @@ function mrbSectionInit(ctx){
           }
           else if (stateChanged(build)) {
             // update the whole template
+            build.warnings_pluralise = (build.warnings !== 1 ? 's' : '');
+            build.errors_pluralise = (build.errors !== 1 ? 's' : '');
+
             tmpl = $.templates("#build-template");
 
-            html = tmpl.render(build);
+            html = $(tmpl.render(build));
 
             selector = '[data-latest-build-result="' + build.id + '"] ' +
               '[data-role="build-status-container"]';
             container = $(selector);
 
+            // initialize bootstrap tooltips in the new HTML
+            html.find('span.glyphicon-question-sign').tooltip();
+
             container.html(html);
           }
           else if (tasksProgressChanged(build)) {
diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html 
b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
index b74f723..38a72f9 100644
--- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html
+++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html
@@ -59,25 +59,27 @@
         <%:targets_abbreviated%>
       </span>
     <%else%>
-      ...targets not yet available...
+      Fetching recipe names...
     <%/if%>
   </div>
 
-  <%if state == 'Parsing'%>
-    <%include tmpl='#parsing-recipes-build-template'/%>
-  <%else state == 'Queued'%>
-    <%include tmpl='#queued-build-template'/%>
-  <%else state == 'Succeeded' || state == 'Failed'%>
-    <%include tmpl='#succeeded-or-failed-build-template'/%>
-  <%else state == 'Cancelling'%>
-    <%include tmpl='#cancelling-build-template'/%>
-  <%else state == 'Starting'%>
-    <%include tmpl='#starting-template'/%>
-  <%else state == 'In Progress'%>
-    <%include tmpl='#in-progress-build-template'/%>
-  <%else state == 'Cancelled'%>
-    <%include tmpl='#cancelled-build-template'/%>
-  <%/if%>
+  <div data-build-state="<%:state%>">
+    <%if state == 'Parsing'%>
+      <%include tmpl='#parsing-recipes-build-template'/%>
+    <%else state == 'Queued'%>
+      <%include tmpl='#queued-build-template'/%>
+    <%else state == 'Succeeded' || state == 'Failed'%>
+      <%include tmpl='#succeeded-or-failed-build-template'/%>
+    <%else state == 'Cancelling'%>
+      <%include tmpl='#cancelling-build-template'/%>
+    <%else state == 'Starting'%>
+      <%include tmpl='#starting-template'/%>
+    <%else state == 'In Progress'%>
+      <%include tmpl='#in-progress-build-template'/%>
+    <%else state == 'Cancelled'%>
+      <%include tmpl='#cancelled-build-template'/%>
+    <%/if%>
+  </div>
 </script>
 
 <!-- queued build -->
@@ -111,7 +113,8 @@
 
   <div class="col-md-4 progress-info">
     <!-- parse completion percentage -->
-    <span class="glyphicon glyphicon-question-sign get-help get-help-blue" title="BitBake is parsing the 
layers required for your build">
+    <span class="glyphicon glyphicon-question-sign get-help get-help-blue"
+          title="BitBake is parsing the layers required for your build">
     </span>
 
     Parsing <span id="recipes-parsed-percentage-<%:id%>"><%:recipes_parsed_percentage%></span>% complete
@@ -178,7 +181,7 @@
     <%if errors%>
       <span class="glyphicon glyphicon-minus-sign"></span>
       <a href="<%:dashboard_errors_url%>" class="alert-link">
-        <%:errors%> error<%:errors_pluralize%>
+        <%:errors%> error<%:errors_pluralise%>
       </a>
     <%/if%>
   </div>
@@ -186,9 +189,9 @@
   <!-- warnings -->
   <div class="col-md-2">
     <%if warnings%>
-      <span class="glyphicon glyphicon-minus-sign"></span>
-      <a href="<%:dashboard_warnings_url%>" class="alert-link">
-        <%:warnings%> warning<%:warnings_pluralize%>
+      <span class="glyphicon glyphicon-warning-sign build-warnings"></span>
+      <a href="<%:dashboard_warnings_url%>" class="alert-link build-warnings">
+        <%:warnings%> warning<%:warnings_pluralise%>
       </a>
     <%/if%>
   </div>
@@ -219,7 +222,7 @@
 <script id="rebuild-template" type="text/x-jsrender">
   <%if is_default_project_build%>
     <!-- no rebuild info icon -->
-    <span class="pull-right glyphicon glyphicon-question-sign get-help <%if state == 
'Success'%>get-help-green<%else state == 'Failed'%>get-help-red<%else%>get-help-blue<%/if%>"
+    <span class="pull-right glyphicon glyphicon-question-sign get-help <%if state == 
'Succeeded'%>get-help-green<%else state == 'Failed'%>get-help-red<%else%>get-help-blue<%/if%>"
     title="Builds in this project cannot be started from Toaster: they are started from the command line">
     </span>
   <%else%>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]