summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templates/basetable_top.html
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/basetable_top.html')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/basetable_top.html87
1 files changed, 87 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/basetable_top.html b/bitbake/lib/toaster/toastergui/templates/basetable_top.html
new file mode 100644
index 0000000..22c3897
--- /dev/null
+++ b/bitbake/lib/toaster/toastergui/templates/basetable_top.html
@@ -0,0 +1,87 @@
1{% load projecttags %}
2<!-- component to display a generic table -->
3 <script>
4 function showhideTableColumn(clname, sh) {
5 if (sh) $('.' + clname).show(100);
6 else $('.' + clname).hide(100);
7
8 // save cookie for all checkboxes
9 save = '';
10 $('.chbxtoggle').each(function() { if ($(this).attr('id') != undefined) { save += ';' + $(this).attr('id') +':'+ $(this).is(':checked')} })
11 $.cookie('_displaycols_{{objectname}}', save);
12 save = '';
13 }
14
15
16 function filterTableRows(test) {
17 if (test.length > 0) {
18 var r = test.split(/[ ,]+/).map(function (e) { return new RegExp(e, 'i') });
19 $('tr.data').map( function (i, el) {
20 (! r.map(function (j) { return j.test($(el).html())}).reduce(function (c, p) { return c && p;} )) ? $(el).hide() : $(el).show();
21 });
22 } else
23 {
24 $('tr.data').show();
25 }
26 }
27 </script>
28
29<!-- control header -->
30<div class="navbar">
31 <div class="navbar-inner">
32 <form class="navbar-search input-append pull-left" id="searchform">
33 <input class="input-xxlarge" id="search" name="search" type="text" placeholder="Search {%if object_search_display %}{{object_search_display}}{%else%}{{objectname}}{%endif%}" value="{{request.GET.search}}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-remove"></i></a>{%endif%}
34 <input type="hidden" name="orderby" value="{{request.GET.orderby}}">
35 <input type="hidden" name="page" value="1">
36 <input type="hidden" name="count" value="{{request.GET.count}}">
37 <button class="btn" type="submit" value="Search">Search</button>
38 </form>
39 <div class="pull-right">
40{% if tablecols %}
41 <div class="btn-group">
42 <button class="btn dropdown-toggle" data-toggle="dropdown">Edit columns
43 <span class="caret"></span>
44 </button>
45<!--
46 {{tablecols|sortcols}}
47-->
48 <ul class="dropdown-menu">{% for i in tablecols|sortcols %}
49 <li>
50 <label {% if not i.clclass %} class="checkbox muted" {%else%} class="checkbox" {%endif%}>
51 <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}}
52 </label>
53 </li>{% endfor %}
54 </ul>
55 </div>
56{% endif %}
57 <div style="display:inline">
58 <span class="divider-vertical"></span>
59 <span class="help-inline" style="padding-top:5px;">Show rows:</span>
60 <select style="margin-top:5px;margin-bottom:0px;" class="pagesize">
61 {% with "2 5 10 25 50 100" as list%}
62{% for i in list.split %} <option{%if i == request.GET.count %} selected{%endif%}>{{i}}</option>
63 {% endfor %}
64 {% endwith %}
65 </select>
66 </div>
67 </div>
68 </div> <!-- navbar-inner -->
69</div>
70
71<!-- the actual rows of the table -->
72 <table class="table table-bordered table-hover tablesorter" id="otable">
73 <thead>
74 <!-- Table header row; generated from "tablecols" entry in the context dict -->
75 <tr>
76 {% for tc in tablecols %}<th class="{{tc.dclass}} {{tc.clclass}}">
77 {%if tc.qhelp%}<i class="icon-question-sign get-help" title="{{tc.qhelp}}"></i>{%endif%}
78 {%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%}
79 {%if tc.ordericon%} <i class="icon-caret-{{tc.ordericon}}"></i>{%endif%}
80 {%if tc.filter%}<div class="btn-group pull-right">
81 <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>
82 </div>{%endif%}
83 </th>{% endfor %}
84 </tr>
85 </thead>
86 <tbody>
87