Patchwork [bitbake-devel,09/14] toaster: Fix "Recent builds" links

login
register
mail settings
Submitter Alexandru DAMIAN
Date April 4, 2014, 2:10 p.m.
Message ID <04ad8ad2067fd283c8040bfa52a71b1b823fac8f.1396620556.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/70133/
State New
Headers show

Comments

Alexandru DAMIAN - April 4, 2014, 2:10 p.m.
From: Belen Barros Pena <belen.barros.pena@intel.com>

* Link the number of errors to the #errors section in the
build dashboard

* Link the number of warnigns to the #warnings section in
the build dashboard

* Link the build time to the build time page

* Move some javascript that applies only to builddashboard.html
to that template from main.js

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
---
 lib/toaster/toastergui/templates/build.html          | 6 +++---
 lib/toaster/toastergui/templates/builddashboard.html | 9 +++++++++
 2 files changed, 12 insertions(+), 3 deletions(-)

Patch

diff --git a/lib/toaster/toastergui/templates/build.html b/lib/toaster/toastergui/templates/build.html
index afa390f..faabd22 100644
--- a/lib/toaster/toastergui/templates/build.html
+++ b/lib/toaster/toastergui/templates/build.html
@@ -48,16 +48,16 @@ 
     {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
             <div class="span2 lead">
     {% if  build.errors_no %}
-                <i class="icon-minus-sign red"></i> <a href="{%url 'builddashboard' build.pk%}" class="error">{{build.errors_no}} error{{build.errors_no|pluralize}}</a>
+                <i class="icon-minus-sign red"></i> <a href="{%url 'builddashboard' build.pk%}#errors" class="error">{{build.errors_no}} error{{build.errors_no|pluralize}}</a>
     {% endif %}
             </div>
             <div class="span2 lead">
     {% if  build.warnings_no %}
-                <i class="icon-warning-sign yellow"></i> <a href="{%url 'builddashboard' build.pk%}" class="warning">{{build.warnings_no}} warning{{build.warnings_no|pluralize}}</a>
+                <i class="icon-warning-sign yellow"></i> <a href="{%url 'builddashboard' build.pk%}#warnings" class="warning">{{build.warnings_no}} warning{{build.warnings_no|pluralize}}</a>
     {% endif %}
             </div>
             <div class="lead pull-right">
-                Build time: <a href="build-time.html">{{ build.timespent|sectohms }}</a>
+                Build time: <a href="{% url 'buildtime' build.pk %}">{{ build.timespent|sectohms }}</a>
             </div>
     {%endif%}{%if build.outcome == build.IN_PROGRESS %}
             <div class="span4">
diff --git a/lib/toaster/toastergui/templates/builddashboard.html b/lib/toaster/toastergui/templates/builddashboard.html
index 6cce788..cc92af5 100644
--- a/lib/toaster/toastergui/templates/builddashboard.html
+++ b/lib/toaster/toastergui/templates/builddashboard.html
@@ -186,4 +186,13 @@ 
 </div>
 {% endif %}
 
+<script type="text/javascript">
+    $(document).ready(function() {
+        //show warnings section when requested from the previous page
+        if (location.href.search('#warnings') > -1) {
+            $('#collapse-warnings').addClass('in');
+        }
+    });
+</script>
+
 {% endblock %}