diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-02-21 15:23:52 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-09 12:22:35 -0700 |
commit | 47196039bd8bac2eddb1c19ad4fc2e285dc23ee3 (patch) | |
tree | 78b0a9d6920d98abb10b0de80b936edb718f86e9 /lib | |
parent | 777458a20a7f686881e525a4d81b286c486ead6a (diff) | |
download | bitbake-47196039bd8bac2eddb1c19ad4fc2e285dc23ee3.tar.gz |
toaster: fix issues in the build table
This patches fixes minor issues in the sorting functionality
of the build table.
[YOCTO #5455]
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/toaster/toastergui/templates/basetable_top.html | 2 | ||||
-rw-r--r-- | lib/toaster/toastergui/templates/build.html | 2 | ||||
-rw-r--r-- | lib/toaster/toastergui/views.py | 11 |
3 files changed, 12 insertions, 3 deletions
diff --git a/lib/toaster/toastergui/templates/basetable_top.html b/lib/toaster/toastergui/templates/basetable_top.html index 23fb04dec..0cd948cc2 100644 --- a/lib/toaster/toastergui/templates/basetable_top.html +++ b/lib/toaster/toastergui/templates/basetable_top.html @@ -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> diff --git a/lib/toaster/toastergui/templates/build.html b/lib/toaster/toastergui/templates/build.html index 3b0c61450..85de98aae 100644 --- a/lib/toaster/toastergui/templates/build.html +++ b/lib/toaster/toastergui/templates/build.html @@ -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> diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py index 8383e7343..ccf95855a 100644 --- a/lib/toaster/toastergui/views.py +++ b/lib/toaster/toastergui/views.py @@ -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", |