From: Elliot Smith Date: Wed, 13 Jul 2016 10:37:01 +0000 (+0100) Subject: toaster: remove links from time field on failed builds X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f9c472d95ee800da079f6b828b956d9f8c67ce6;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git toaster: remove links from time field on failed builds Failed builds don't have any time data recorded for them, so the time field in the builds table, the time shown in the recent builds area, and the build time shown in the build dashboard should not be links for failed builds. [YOCTO #8443] Signed-off-by: Elliot Smith --- diff --git a/lib/toaster/toastergui/tables.py b/lib/toaster/toastergui/tables.py index 79673f5dab1..969eb04aaa9 100644 --- a/lib/toaster/toastergui/tables.py +++ b/lib/toaster/toastergui/tables.py @@ -1197,9 +1197,13 @@ class BuildsTable(ToasterTable): time_template = ''' {% load projecttags %} - + {% if data.outcome == extra.Build.SUCCEEDED %} + + {{data.timespent_seconds | sectohms}} + + {% else %} {{data.timespent_seconds | sectohms}} - + {% endif %} ''' image_files_template = ''' diff --git a/lib/toaster/toastergui/templates/builddashboard.html b/lib/toaster/toastergui/templates/builddashboard.html index 07fc26c6dd2..61ae583d233 100644 --- a/lib/toaster/toastergui/templates/builddashboard.html +++ b/lib/toaster/toastergui/templates/builddashboard.html @@ -38,8 +38,15 @@ {% endif %} Build time: - {{ build.timespent_seconds|sectohms }} - + + {% if build.outcome == build.SUCCEEDED %} + {{ build.timespent_seconds|sectohms }} + {% else %} + {{ build.timespent_seconds|sectohms }} + {% endif %} + + + {%endif%} diff --git a/lib/toaster/toastergui/templates/mrb_section.html b/lib/toaster/toastergui/templates/mrb_section.html index 38a72f9afba..b761ffe1dfe 100644 --- a/lib/toaster/toastergui/templates/mrb_section.html +++ b/lib/toaster/toastergui/templates/mrb_section.html @@ -198,7 +198,15 @@
- Build time: <%:buildtime%> + Build time: + + + <%if state == 'Succeeded'%> + <%:buildtime%> + <%else%> + <%:buildtime%> + <%/if%> + <%include tmpl='#rebuild-template'/%>