Files
poky/bitbake/lib/toaster/toastergui/templates/toastertable-simple.html
Alexandru DAMIAN d9341d1a77 bitbake: toaster: toastertables REST refactoring
This patch refactors the ToasterTables to bring them in line
with REST principles -

- all table pages now support the "format=json" GET parameter
that returns the data in JSON format
- the tables themselves

This cleans up the URL namespace by aleviating the need to
have two URLS for each table (one for the template and one for
the data loading), and fixes minor things in the ToasterTable
implementation.

(Bitbake rev: 1778dac9fd39dae75c55bf2cf836cdd488dbc265)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-12 00:01:47 +01:00

95 lines
3.1 KiB
HTML

{% load static %}
{% load projecttags %}
<script src="{% static 'js/table.js' %}"></script>
<script src="{% static 'js/layerBtn.js' %}"></script>
<script>
$(document).ready(function() {
(function(){
var ctx = {
tableName : "{{table_name}}",
url : "{{ xhr_table_url }}?format=json",
title : "{{title}}",
projectLayers : {{projectlayers|json}},
};
try {
tableInit(ctx);
} catch (e) {
document.write("Problem loading table widget: " + e);
}
})();
});
</script>
{% include 'toastertable-filter.html' %}
<div class="row-fluid" id="no-results-{{table_name}}" style="display:none">
<div class="alert">
<form class="no-results input-append">
<input class="input-xlarge" id="new-search-input-{{table_name}}" name="search" type="text" placeholder="Search {{title|lower}}" value="{{request.GET.search}}"/>
<a href="#" class="add-on btn remove-search-btn-{{table_name}}" tabindex="-1">
<i class="icon-remove"></i>
</a>
<button class="btn search-submit-{{table_name}}" >Search</button>
<button class="btn btn-link remove-search-btn-{{table_name}}">Show {{title|lower}}
</button>
</form>
</div>
</div>
<div id="table-container-{{table_name}}" style="visibility: hidden">
<!-- control header -->
<div class="row-fluid" id="table-chrome-{{table_name}}">
<div class="navbar-search input-append pull-left">
<input class="input-xlarge" id="search-input-{{table_name}}" name="search" type="text" placeholder="Search {{title|lower}}" value="{{request.GET.search}}"/>
<a href="#" style="display:none" class="add-on btn remove-search-btn-{{table_name}}" tabindex="-1">
<i class="icon-remove"></i>
</a>
<button class="btn" id="search-submit-{{table_name}}" >Search</button>
</div>
<div class="pull-right">
<div style="display:inline">
<span class="divider-vertical"></span>
<span class="help-inline" style="padding-top:5px;">Show rows:</span>
<select style="margin-top:5px;margin-bottom:0px;" class="pagesize-{{table_name}}">
{% with "10 25 50 100 150" as list%}
{% for i in list.split %}
<option value="{{i}}">{{i}}</option>
{% endfor %}
{% endwith %}
</select>
</div>
</div>
</div>
<!-- The actual table -->
<table class="table table-bordered table-hover tablesorter" id="{{table_name}}">
<thead>
<tr><th></th></tr>
</thead>
<tbody></tbody>
</table>
<!-- Pagination controls -->
<div class="pagination pagination-centered" id="pagination-{{table_name}}">
<ul class="pagination" style="display: block-inline">
</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-{{table_name}}">
{% with "10 25 50 100 150" as list%}
{% for i in list.split %}
<option value="{{i}}">{{i}}</option>
{% endfor %}
{% endwith %}
</select>
</div>
</div>
</div>