summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html60
1 files changed, 60 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html b/bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html
new file mode 100644
index 0000000000..355ae9073c
--- /dev/null
+++ b/bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html
@@ -0,0 +1,60 @@
1{% comment %}
2 Show pagination controls as per search/pagination table detail spec.
3 Input: objects, setup for pagination using the standard method in views.
4 object_count, count for complete list of objects, (all pages, no pattern)
5{% endcomment %}
6
7{# only paginate if 10 or more rows unfiltered, all pages #}
8{% if object_count >= 10 %}
9<div class="pagination">
10 <ul>
11{%if objects.has_previous %}
12 <li><a href="javascript:reload_params({'page':{{objects.previous_page_number}}})">&laquo;</a></li>
13{%else%}
14 <li class="disabled"><a href="#">&laquo;</a></li>
15{%endif%}
16{% for i in objects.page_range %}
17 <li{%if i == objects.number %} class="active" {%endif%}><a href="javascript:reload_params({'page':{{i}}})">{{i}}</a></li>
18{% endfor %}
19{%if objects.has_next%}
20 <li><a href="javascript:reload_params({'page':{{objects.next_page_number}}})">&raquo;</a></li>
21{%else%}
22 <li class="disabled"><a href="#">&raquo;</a></li>
23{%endif%}
24 </ul>
25
26 <div class="pull-right">
27 <span class="help-inline" style="padding-bottom:10px;">Show rows:</span>
28 <select class="pagesize">
29 {% with "10 25 50 100 150" as list%}
30 {% for i in list.split %}
31 <option value="{{i}}">{{i}}</option>
32 {% endfor %}
33 {% endwith %}
34 </select>
35 </div>
36</div>
37
38<!-- Update page display settings -->
39<script>
40 $(document).ready(function() {
41 // load cookie for number of entries to be displayed on page
42 if ({{request.GET.count}} != "") {
43 pagesize = {{request.GET.count}};
44 } else {
45 pagesize = $.cookie('_count');
46 }
47
48 $('.pagesize option').prop('selected', false)
49 .filter('[value="' + pagesize + '"]')
50 .attr('selected', true);
51
52 $(".pagesize").change(function () {
53 // save cookie with pagesize
54 $.cookie("_count", $(this).val(), { path : $(location).attr('pathname') });
55 reload_params({"count":$(this).val()});
56 });
57});
58</script>
59{% endif %}
60