summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templates/basetable_top.html
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-01-07 13:10:42 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-10 15:20:26 +0000
commit1b636173ca88e5ccca1992f9a12367a1189fa674 (patch)
tree0220e98e7b7a4027fb8c146bab9b3f81306fc9fe /bitbake/lib/toaster/toastergui/templates/basetable_top.html
parent5482409a370552809de75150350defef04ac7144 (diff)
downloadpoky-1b636173ca88e5ccca1992f9a12367a1189fa674.tar.gz
bitbake: toaster: Toaster GUI, generic search, filter and order
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>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/basetable_top.html')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/basetable_top.html79
1 files changed, 43 insertions, 36 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/basetable_top.html b/bitbake/lib/toaster/toastergui/templates/basetable_top.html
index b9277b4a3d..34e0cd7210 100644
--- a/bitbake/lib/toaster/toastergui/templates/basetable_top.html
+++ b/bitbake/lib/toaster/toastergui/templates/basetable_top.html
@@ -21,46 +21,53 @@
21 21
22<!-- control header --> 22<!-- control header -->
23<div class="navbar"> 23<div class="navbar">
24 <div class="navbar-inner"> 24 <div class="navbar-inner">
25 <form class="navbar-search input-append pull-left"> 25 <form class="navbar-search input-append pull-left" >
26 <input class="input-xxlarge" type="text" placeholder="Search {{objectname}}" /> 26 <input class="input-xxlarge" name="search" type="text" placeholder="Search {{objectname}}" value="{{request.GET.search}}"/>
27 <button class="btn" type="button">Search</button> 27 <input class="btn" type="submit" value="Search"/>
28 </form> 28 </form>
29 <div class="pull-right"> 29 <div class="pull-right">
30 30{% if tablecols %}
31 {% if tablecols %} 31 <div class="btn-group">
32 <div class="btn-group"> 32 <button class="btn dropdown-toggle" data-toggle="dropdown">Edit columns
33 <button class="btn dropdown-toggle" data-toggle="dropdown"> 33 <span class="caret"></span>
34 Edit columns 34 </button>
35 <span class="caret"></span> 35 <ul class="dropdown-menu">{% for i in tablecols %}
36 </button> 36 <li>
37 <ul class="dropdown-menu"> 37 <label class="checkbox">
38 38 <input type="checkbox" class="chbxtoggle" {% if i.clclass %}id="{{i.clclass}}" value="ct{{i.name}}" {% if not i.hidden %}checked="checked"{%endif%} onchange="showhideTableColumn($(this).attr('id'), $(this).is(':checked'))" {%else%} checked disabled{% endif %}/> {{i.name}}
39 {% for i in tablecols %} 39 </label>
40 <li> 40 </li>{% endfor %}
41 <label class="checkbox"> 41 </ul>
42<input type="checkbox" class="chbxtoggle" id="{{i.clclass}}" value="ct{{i.name}}" {% if i.clclass %}{% if not i.hidden %}checked="checked"{%endif%} onchange="showhideTableColumn($(this).attr('id'), $(this).is(':checked'))" {%else%} disabled{% endif %}/> {{i.name}} 42 </div>
43 </label> 43{% endif %}
44 </li> 44 <div style="display:inline">
45 {% endfor %} 45 <span class="divider-vertical"></span>
46 </ul> 46 <span class="help-inline" style="padding-top:5px;">Show rows:</span>
47 </div> 47 <select style="margin-top:5px;margin-bottom:0px;" class="pagesize">
48 {% endif %}
49
50 <div style="display:inline">
51 <span class="divider-vertical"></span>
52 <span class="help-inline" style="padding-top:5px;">Show rows:</span>
53 <select style="margin-top:5px;margin-bottom:0px;" class="pagesize">
54 {% with "2 5 10 25 50 100" as list%} 48 {% with "2 5 10 25 50 100" as list%}
55 {% for i in list.split %}<option{%if i == request.GET.count %} selected{%endif%}>{{i}}</option> 49{% for i in list.split %} <option{%if i == request.GET.count %} selected{%endif%}>{{i}}</option>
56 {% endfor %} 50 {% endfor %}
57 {% endwith %} 51 {% endwith %}
58 </select> 52 </select>
59 </div> 53 </div>
60 </div> 54 </div>
61 </div> 55 </div> <!-- navbar-inner -->
62 </div> 56</div>
63 57
64<!-- the actual rows of the table --> 58<!-- the actual rows of the table -->
65 <table class="table table-bordered table-hover tablesorter" id="otable"> 59 <table class="table table-bordered table-hover tablesorter" id="otable">
60 <thead>
61 <!-- Table header row; generated from "tablecols" entry in the context dict -->
62 <tr>
63 {% for tc in tablecols %}<th class="{{tc.dclass}} {{tc.clclass}}">
64 {%if tc.qhelp%}<i class="icon-question-sign get-help" data-toggle="tooltip" title="{{tc.qhelp}}"></i>{%endif%}
65 <a href="javascript:reload_params({'orderby' : '{{tc.orderfield}}' })" style="font-weight:normal;">{{tc.name}}</a>
66 {%if tc.filter%}<div class="btn-group pull-right">
67 <a href="#filter_{{tc.filter.class}}" role="button" class="btn btn-mini{%if request.GET.filter in tc.filter.options.values%} btn-primary{%endif%}" data-toggle="modal"> <i class="icon-filter filtered"></i> </a>
68 </div>{%endif%}
69 </th>{% endfor %}
70 </tr>
71 </thead>
72 <tbody>
66 73