mirror of
https://git.yoctoproject.org/poky
synced 2026-06-06 03:52:39 +02:00
This patch implements table searching, filtering and ordering, in a
generic mode reusable for all tables.
The search operates list of fields defined in the corresponding
class for each model, search_allowed_fields.
The search expression and filters are sent through GET requests
using a QuerySet-like input. The inputs are filtered and
validated before usage to prevent inadvertent or malicious use.
Filters and table headers are defined in the views for each table,
and rendered by generic code which is easily modified for various
tables.
The Build table and Configuration table are implemented using this
framework as an example of how it should be used.
[YOCTO #4249]
[YOCTO #4254]
[YOCTO #4255]
[YOCTO #4256]
[YOCTO #4257]
[YOCTO #4259]
[YOCTO #4260]
(Bitbake rev: 2ca15117e4bbda38cda07511d0ff317273f91528)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
68 lines
2.2 KiB
HTML
68 lines
2.2 KiB
HTML
</tbody>
|
|
</table>
|
|
|
|
<!-- Show pagination controls -->
|
|
<div class="pagination pagination-centered">
|
|
<div class="pull-left">
|
|
Showing {{objects.start_index}} to {{objects.end_index}} out of {{objects.paginator.count}} entries.
|
|
</div>
|
|
|
|
<ul class="pagination" style="display: block-inline">
|
|
{%if objects.has_previous %}
|
|
<li><a href="javascript:reload_params({'page':{{objects.previous_page_number}}})">«</a></li>
|
|
{%else%}
|
|
<li class="disabled"><a href="#">«</a></li>
|
|
{%endif%}
|
|
{% for i in objects.page_range %}
|
|
<li{%if i == objects.number %} class="active" {%endif%}><a href="javascript:reload_params({'page':{{i}}})">{{i}}</a></li>
|
|
{% endfor %}
|
|
{%if objects.has_next%}
|
|
<li><a href="javascript:reload_params({'page':{{objects.next_page_number}}})">»</a></li>
|
|
{%else%}
|
|
<li class="disabled"><a href="#">»</a></li>
|
|
{%endif%}
|
|
</ul>
|
|
<div class="pull-right">
|
|
<span class="help-inline" style="padding-top:5px;">Show rows:</span>
|
|
<select style="margin-top:5px;margin-bottom:0px;" class="pagesize">
|
|
{% with "2 5 10 25 50 100" as list%}
|
|
{% for i in list.split %}<option{%if i == request.GET.count %} selected{%endif%}>{{i}}</option>
|
|
{% endfor %}
|
|
{% endwith %}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Update page display settings -->
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
|
|
$('.chbxtoggle').each(function () {
|
|
showhideTableColumn($(this).attr('id'), $(this).is(':checked'))
|
|
});
|
|
|
|
//turn edit columns dropdown into a multi-select menu
|
|
$('.dropdown-menu input, .dropdown-menu label').click(function(e) {
|
|
e.stopPropagation();
|
|
});
|
|
|
|
//show tooltip with applied filter
|
|
$('#filtered').tooltip({container:'table', placement:'bottom', delay:{hide:1500}, html:true});
|
|
|
|
//progress bar tooltip
|
|
$('.progress, .lead span').tooltip({container:'table', placement:'top'});
|
|
|
|
$(".pagesize").change(function () {
|
|
console.log("page size change");
|
|
reload_params({"count":$(this).val()}); ;
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<!-- modal filter boxes -->
|
|
{% for tc in tablecols %}{% if tc.filter %}{% with f=tc.filter %}
|
|
{% include "filtersnippet.html" %}
|
|
{% endwith %}{% endif %} {% endfor %}
|
|
<!-- end modals -->
|