]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: remove links from time field on failed builds
authorElliot Smith <elliot.smith@intel.com>
Wed, 13 Jul 2016 10:37:01 +0000 (11:37 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 10 Aug 2016 23:08:17 +0000 (00:08 +0100)
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 <elliot.smith@intel.com>
lib/toaster/toastergui/tables.py
lib/toaster/toastergui/templates/builddashboard.html
lib/toaster/toastergui/templates/mrb_section.html

index 79673f5dab186661a5296f71ca6188a849792d3e..969eb04aaa9decfd7c92af852210a3ea0a699de6 100644 (file)
@@ -1197,9 +1197,13 @@ class BuildsTable(ToasterTable):
 
         time_template = '''
         {% load projecttags %}
-        <a href="{% url "buildtime" data.id %}">
+        {% if data.outcome == extra.Build.SUCCEEDED %}
+            <a href="{% url "buildtime" data.id %}">
+                {{data.timespent_seconds | sectohms}}
+            </a>
+        {% else %}
             {{data.timespent_seconds | sectohms}}
-        </a>
+        {% endif %}
         '''
 
         image_files_template = '''
index 07fc26c6dd2ebdca833399df5a99e15b37b2400d..61ae583d233cc572d95b6ada7099bdcbbc096c6c 100644 (file)
                        {% endif %}
                        <span class="pull-right">
                                Build time:
-                               <a class="alert-link" href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}</a>
-                       </span>
+                         <span data-build-field="buildtime">
+          {% if build.outcome == build.SUCCEEDED %}
+            <a href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}</a>
+          {% else %}
+            {{ build.timespent_seconds|sectohms }}
+          {% endif %}
+        </span>
+      </span>
+
                {%endif%}
 </div>
 
index 38a72f9afbae02bcca37148bc232997987c8dd47..b761ffe1dfe3ce93c1d000c141fe80ba51aa7c5a 100644 (file)
 
   <!-- build time -->
   <div class="col-md-3">
-    Build time: <a class="alert-link" href="<%:buildtime_url%>"><%:buildtime%></a>
+    Build time:
+
+    <span data-role="data-recent-build-buildtime-field">
+      <%if state == 'Succeeded'%>
+        <a class="alert-link" href="<%:buildtime_url%>"><%:buildtime%></a>
+      <%else%>
+        <%:buildtime%>
+      <%/if%>
+    </span>
 
     <!-- rebuild button -->
     <%include tmpl='#rebuild-template'/%>