From 6f9c472d95ee800da079f6b828b956d9f8c67ce6 Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Wed, 13 Jul 2016 11:37:01 +0100 Subject: [PATCH] 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 --- lib/toaster/toastergui/tables.py | 8 ++++++-- lib/toaster/toastergui/templates/builddashboard.html | 11 +++++++++-- lib/toaster/toastergui/templates/mrb_section.html | 10 +++++++++- 3 files changed, 24 insertions(+), 5 deletions(-) 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'/%> -- 2.47.2