summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templates/basetable_top.html
diff options
context:
space:
mode:
authorMarius Avram <marius.avram@intel.com>2014-08-29 15:51:01 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-05 10:14:25 +0100
commit69e5cbdac50418738d72987b6ee943933f6bfd51 (patch)
tree71a234c7d815c51730b5798f33729ed793a66d44 /bitbake/lib/toaster/toastergui/templates/basetable_top.html
parenta6f1e3172173ac0a77c27ae410a786521e6391d3 (diff)
downloadpoky-69e5cbdac50418738d72987b6ee943933f6bfd51.tar.gz
bitbake: toaster: use cookies for count and sorting in templates tables
Until now cookies were used to save which columns were shown and which were hidden in toaster tables. The tables from the templates also have functionalities like sorting the entries on a certain column and limiting the number of entries displayed on a page. The later however were not saved using cookies. This patch brings this new feature. The cookies are not saved only in the front-end. They are saved both in the frontend in case the user uses the inputs/buttons to change a parameter and also in the backend in case the user specifies manually using GET variables the value of the parameters. When no GET parameters are given the views will redirect the url to one containg the parameters saved as cookies. When no cookies exist, default values will be used. [YOCTO #6126] (Bitbake rev: 880b58c845e3a501fa90d24e1bd89c87ca84b709) Signed-off-by: Marius Avram <marius.avram@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/basetable_top.html')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/basetable_top.html11
1 files changed, 9 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/basetable_top.html b/bitbake/lib/toaster/toastergui/templates/basetable_top.html
index 1231e1f924..037554b627 100644
--- a/bitbake/lib/toaster/toastergui/templates/basetable_top.html
+++ b/bitbake/lib/toaster/toastergui/templates/basetable_top.html
@@ -156,6 +156,13 @@
156 showhideImmediateTableAction( clname, sh, orderkey ); 156 showhideImmediateTableAction( clname, sh, orderkey );
157 } 157 }
158 158
159 //
160 // saves a cookie with selected order field
161 //
162 function saveOrderCookie( orderfield ) {
163 $.cookie("orderby", orderfield, { path: $(location).attr('pathname') });
164 }
165
159 </script> 166 </script>
160 167
161<!-- control header --> 168<!-- control header -->
@@ -205,7 +212,7 @@
205 <span class="help-inline" style="padding-top:5px;">Show rows:</span> 212 <span class="help-inline" style="padding-top:5px;">Show rows:</span>
206 <select style="margin-top:5px;margin-bottom:0px;" class="pagesize"> 213 <select style="margin-top:5px;margin-bottom:0px;" class="pagesize">
207 {% with "2 5 10 25 50 100" as list%} 214 {% with "2 5 10 25 50 100" as list%}
208{% for i in list.split %} <option{%if i == request.GET.count %} selected{%endif%}>{{i}}</option> 215{% for i in list.split %} <option value="{{i}}">{{i}}</option>
209 {% endfor %} 216 {% endfor %}
210 {% endwith %} 217 {% endwith %}
211 </select> 218 </select>
@@ -221,7 +228,7 @@
221 <tr> 228 <tr>
222 {% for tc in tablecols %}<th class="{{tc.dclass}} {{tc.clclass}}"> 229 {% for tc in tablecols %}<th class="{{tc.dclass}} {{tc.clclass}}">
223 {%if tc.qhelp%}<i class="icon-question-sign get-help" title="{{tc.qhelp}}"></i>{%endif%} 230 {%if tc.qhelp%}<i class="icon-question-sign get-help" title="{{tc.qhelp}}"></i>{%endif%}
224 {%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%} 231 {%if tc.orderfield%}<a {%if tc.ordericon%} class="sorted" {%endif%}href="javascript:reload_params({'page': 1, 'orderby' : '{{tc.orderfield}}' })" onclick="saveOrderCookie('{{tc.orderfield}}')">{{tc.name}}</a>{%else%}<span class="muted">{{tc.name}}</span>{%endif%}
225 {%if tc.ordericon%} <i class="icon-caret-{{tc.ordericon}}"></i>{%endif%} 232 {%if tc.ordericon%} <i class="icon-caret-{{tc.ordericon}}"></i>{%endif%}
226 {%if tc.filter%}<div class="btn-group pull-right"> 233 {%if tc.filter%}<div class="btn-group pull-right">
227 <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 and tc.filter.options|filtered_tooltip: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 {% if filter_search_display %}{{filter_search_display}}{% else %}{{objectname}}{% endif %}</a></p>" {%endif%} data-toggle="modal"> <i class="icon-filter filtered"></i> </a> 234 <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 and tc.filter.options|filtered_tooltip: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 {% if filter_search_display %}{{filter_search_display}}{% else %}{{objectname}}{% endif %}</a></p>" {%endif%} data-toggle="modal"> <i class="icon-filter filtered"></i> </a>