bitbake: toaster: fix issues in the build table
authorAlexandru DAMIAN <alexandru.damian@intel.com>
Fri, 21 Feb 2014 15:23:52 +0000 (15:23 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 9 Mar 2014 19:24:01 +0000 (12:24 -0700)
This patches fixes minor issues in the sorting functionality
of the build table.

[YOCTO #5455]

(Bitbake rev: 47196039bd8bac2eddb1c19ad4fc2e285dc23ee3)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/toaster/toastergui/templates/basetable_top.html
bitbake/lib/toaster/toastergui/templates/build.html
bitbake/lib/toaster/toastergui/views.py

index 23fb04d..0cd948c 100644 (file)
@@ -76,7 +76,7 @@
         <tr>
             {% for tc in tablecols %}<th class="{{tc.dclass}} {{tc.clclass}}">
                 {%if tc.qhelp%}<i class="icon-question-sign get-help" data-toggle="tooltip" title="{{tc.qhelp}}"></i>{%endif%}
-                {%if tc.orderfield%}<a {%if tc.ordericon%} class="sorted" {%endif%}href="javascript:reload_params({'orderby' : '{{tc.orderfield}}' })" >{{tc.name}}</a>{%else%}<span class="muted">{{tc.name}}</span>{%endif%}
+                {%if tc.orderfield%}<a {%if tc.ordericon%} class="sorted" {%endif%}href="javascript:reload_params({'page': 1, 'orderby' : '{{tc.orderfield}}' })" >{{tc.name}}</a>{%else%}<span class="muted">{{tc.name}}</span>{%endif%}
                 {%if tc.ordericon%} <i class="icon-caret-{{tc.ordericon}}"></i>{%endif%}
                 {%if tc.filter%}<div class="btn-group pull-right">
                     <a href="#filter_{{tc.filter.class}}" role="button" class="btn btn-mini {%if request.GET.filter%}{{tc.filter.options|filtered_icon:request.GET.filter}} {%endif%}" {%if request.GET.filter%} title="<p>{{tc.filter.options|filtered_tooltip:request.GET.filter}}</p><p><a class='btn btn-small btn-primary' href=javascript:reload_params({'filter':''})>Show all {{objectname}}</a></p>" {%endif%} data-toggle="modal"> <i class="icon-filter filtered"></i> </a>
index 3b0c614..85de98a 100644 (file)
@@ -70,7 +70,7 @@
       <div class="alert">
       <form class="no-results" id="searchform">
           <div class="input-append">
-              <input id="search" name="search" class="input-xxlarge" type="text" placeholder="{{request.GET.search}}" /><a href="javascript:$('#search').val('');searchform.submit()" class="add-on"><i class="icon-remove"></i></a>
+              <input id="search" name="search" class="input-xxlarge" type="text" placeholder="{{request.GET.search}}" />{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on"><i class="icon-remove"></i></a>{% endif %}
               <input class="btn" type="submit" value="Search"/>
               <button class="btn btn-link" onclick="javascript:reload_params({'search':'', 'filter':''})">Show all builds</button>
           </div>
index 8383e73..ccf9585 100644 (file)
@@ -199,7 +199,7 @@ def builds(request):
     # define here what parameters the view needs in the GET portion in order to
     # be able to display something.  'count' and 'page' are mandatory for all views
     # that use paginators.
-    mandatory_parameters = { 'count': 10,  'page' : 1};
+    mandatory_parameters = { 'count': 10,  'page' : 1, 'orderby' : 'completed_on:-' };
     retval = _verify_parameters( request.GET, mandatory_parameters )
     if retval:
         return _redirect_parameters( 'all-builds', request.GET, mandatory_parameters)
@@ -241,6 +241,7 @@ def builds(request):
                  'qhelp' : "The outcome tells you if a build completed successfully or failed",     # the help button content
                  'dclass' : "span2",                                                # indication about column width; comes from the design
                  'orderfield': _get_toggle_order(request, "outcome"),               # adds ordering by the field value; default ascending unless clicked from ascending into descending
+                 'ordericon':_get_toggle_order_icon(request, "outcome"),
                   # filter field will set a filter on that column with the specs in the filter description
                   # the class field in the filter has no relation with clclass; the control different aspects of the UI
                   # still, it is recommended for the values to be identical for easy tracking in the generated HTML
@@ -255,15 +256,18 @@ def builds(request):
                 {'name': 'Target ',                                                 # default column, disabled box, with just the name in the list
                  'qhelp': "This is the build target(s): one or more recipes or image recipes",
                  'orderfield': _get_toggle_order(request, "target__target"),
+                 'ordericon':_get_toggle_order_icon(request, "target__target"),
                 },
                 {'name': 'Machine ',
                  'qhelp': "The machine is the hardware for which you are building",
                  'orderfield': _get_toggle_order(request, "machine"),
+                 'ordericon':_get_toggle_order_icon(request, "machine"),
                  'dclass': 'span3'
                 },                           # a slightly wider column
                 {'name': 'Started on ', 'clclass': 'started_on', 'hidden' : 1,      # this is an unchecked box, which hides the column
                  'qhelp': "The date and time you started the build",
                  'orderfield': _get_toggle_order(request, "started_on", True),
+                 'ordericon':_get_toggle_order_icon(request, "started_on"),
                  'filter' : {'class' : 'started_on',
                              'label': 'Show:',
                              'options' : [
@@ -276,6 +280,7 @@ def builds(request):
                 {'name': 'Completed on ',
                  'qhelp': "The date and time the build finished",
                  'orderfield': _get_toggle_order(request, "completed_on", True),
+                 'ordericon':_get_toggle_order_icon(request, "completed_on"),
                  'filter' : {'class' : 'completed_on', 
                              'label': 'Show:', 
                              'options' : [
@@ -298,6 +303,7 @@ def builds(request):
                 {'name': 'Errors ', 'clclass': 'errors_no',
                  'qhelp': "How many errors were encountered during the build (if any)",
                  'orderfield': _get_toggle_order(request, "errors_no", True),
+                 'ordericon':_get_toggle_order_icon(request, "errors_no"),
                  'filter' : {'class' : 'errors_no', 
                              'label': 'Show:', 
                              'options' : [
@@ -309,6 +315,7 @@ def builds(request):
                 {'name': 'Warnings', 'clclass': 'warnings_no',
                  'qhelp': "How many warnigns were encountered during the build (if any)",
                  'orderfield': _get_toggle_order(request, "warnings_no", True),
+                 'ordericon':_get_toggle_order_icon(request, "warnings_no"),
                  'filter' : {'class' : 'warnings_no', 
                              'label': 'Show:', 
                              'options' : [
@@ -320,12 +327,14 @@ def builds(request):
                 {'name': 'Time ', 'clclass': 'time', 'hidden' : 1,
                  'qhelp': "How long it took the build to finish",
                  'orderfield': _get_toggle_order(request, "timespent", True),
+                 'ordericon':_get_toggle_order_icon(request, "timespent"),
                 },
                 {'name': 'Log',
                  'dclass': "span4",
                  'qhelp': "The location in disk of the build main log file",
                  'clclass': 'log', 'hidden': 1,
                  'orderfield': _get_toggle_order(request, "cooker_log_path"),
+                 'ordericon':_get_toggle_order_icon(request, "cooker_log_path"),
                 },
                 {'name': 'Output', 'clclass': 'output',
                  'qhelp': "The root file system types produced by the build. You can find them in your <code>/build/tmp/deploy/images/</code> directory",