From 9ed45f79745207f96dbd3cb6d9ef40ea8fcde42a Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Tue, 12 Jul 2016 16:38:06 +0100 Subject: [PATCH] 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 Signed-off-by: Richard Purdie --- .../toastergui/static/js/mrbsection.js | 8 +++- .../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 e7fbf01731..73d0935fa5 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 b74f723932..38a72f9afb 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%> <%else%> - ...targets not yet available... + Fetching recipe names... <%/if%> - <%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%> +
+ <%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%> +
@@ -111,7 +113,8 @@
- + Parsing <%:recipes_parsed_percentage%>% complete @@ -178,7 +181,7 @@ <%if errors%> - <%:errors%> error<%:errors_pluralize%> + <%:errors%> error<%:errors_pluralise%> <%/if%>
@@ -186,9 +189,9 @@ @@ -219,7 +222,7 @@