bitbake: toaster: add sort, search, paging to recipe package page
When selecting the packages tab on a recipe detail page, the page now
includes:
column sort on package name and size columns,
search on the package name, and
pagination.
Column sort is added by splitting the recipe view/html for a recipe's
package list into a new url path, view name and template, so that
the sorting routine, views.reload_params(), interfaces similar to other
views.
Search, sorting, and pagination are implemented for this detail page
using three new templates.
templates/detail_pagination_bottom.html
templates/detail_search_header.html
templates/detail_sorted_header.html
views.recipe() is optimized since the recipe's package list is no
longer needed by the recipe template, only the recipe's package count
is required for the first page.
The recipe view and template also changes to support tabbing to the
right context on the recipe detail page from the recipe-package page.
[YOCTO #6154]
(Bitbake rev: 6cb9e853d05c2c71467af22ef459ffbe6f41de36)
Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24 22:14:41 +00:00
|
|
|
{% comment %}
|
|
|
|
Show pagination controls as per search/pagination table detail spec.
|
|
|
|
Input: objects, setup for pagination using the standard method in views.
|
|
|
|
object_count, count for complete list of objects, (all pages, no pattern)
|
|
|
|
{% endcomment %}
|
|
|
|
|
|
|
|
{# only paginate if 10 or more rows unfiltered, all pages #}
|
|
|
|
{% if object_count >= 10 %}
|
2016-06-02 13:26:16 +00:00
|
|
|
<div id="pagination-detail">
|
2016-04-12 14:56:43 +00:00
|
|
|
<ul class="pagination">
|
bitbake: toaster: add sort, search, paging to recipe package page
When selecting the packages tab on a recipe detail page, the page now
includes:
column sort on package name and size columns,
search on the package name, and
pagination.
Column sort is added by splitting the recipe view/html for a recipe's
package list into a new url path, view name and template, so that
the sorting routine, views.reload_params(), interfaces similar to other
views.
Search, sorting, and pagination are implemented for this detail page
using three new templates.
templates/detail_pagination_bottom.html
templates/detail_search_header.html
templates/detail_sorted_header.html
views.recipe() is optimized since the recipe's package list is no
longer needed by the recipe template, only the recipe's package count
is required for the first page.
The recipe view and template also changes to support tabbing to the
right context on the recipe detail page from the recipe-package page.
[YOCTO #6154]
(Bitbake rev: 6cb9e853d05c2c71467af22ef459ffbe6f41de36)
Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24 22:14:41 +00:00
|
|
|
{%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>
|
|
|
|
|
2016-06-02 13:26:16 +00:00
|
|
|
<form class="navbar-form navbar-right">
|
|
|
|
<div class=form-group">
|
|
|
|
<label>Show rows:</label>
|
|
|
|
<select class="pagesize form-control">
|
|
|
|
{% with "10 25 50 100 150" as list%}
|
bitbake: toaster: add sort, search, paging to recipe package page
When selecting the packages tab on a recipe detail page, the page now
includes:
column sort on package name and size columns,
search on the package name, and
pagination.
Column sort is added by splitting the recipe view/html for a recipe's
package list into a new url path, view name and template, so that
the sorting routine, views.reload_params(), interfaces similar to other
views.
Search, sorting, and pagination are implemented for this detail page
using three new templates.
templates/detail_pagination_bottom.html
templates/detail_search_header.html
templates/detail_sorted_header.html
views.recipe() is optimized since the recipe's package list is no
longer needed by the recipe template, only the recipe's package count
is required for the first page.
The recipe view and template also changes to support tabbing to the
right context on the recipe detail page from the recipe-package page.
[YOCTO #6154]
(Bitbake rev: 6cb9e853d05c2c71467af22ef459ffbe6f41de36)
Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24 22:14:41 +00:00
|
|
|
{% for i in list.split %}
|
2016-06-02 13:26:16 +00:00
|
|
|
<option value="{{i}}">{{i}}</option>
|
bitbake: toaster: add sort, search, paging to recipe package page
When selecting the packages tab on a recipe detail page, the page now
includes:
column sort on package name and size columns,
search on the package name, and
pagination.
Column sort is added by splitting the recipe view/html for a recipe's
package list into a new url path, view name and template, so that
the sorting routine, views.reload_params(), interfaces similar to other
views.
Search, sorting, and pagination are implemented for this detail page
using three new templates.
templates/detail_pagination_bottom.html
templates/detail_search_header.html
templates/detail_sorted_header.html
views.recipe() is optimized since the recipe's package list is no
longer needed by the recipe template, only the recipe's package count
is required for the first page.
The recipe view and template also changes to support tabbing to the
right context on the recipe detail page from the recipe-package page.
[YOCTO #6154]
(Bitbake rev: 6cb9e853d05c2c71467af22ef459ffbe6f41de36)
Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24 22:14:41 +00:00
|
|
|
{% endfor %}
|
2016-06-02 13:26:16 +00:00
|
|
|
{% endwith %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</form>
|
bitbake: toaster: add sort, search, paging to recipe package page
When selecting the packages tab on a recipe detail page, the page now
includes:
column sort on package name and size columns,
search on the package name, and
pagination.
Column sort is added by splitting the recipe view/html for a recipe's
package list into a new url path, view name and template, so that
the sorting routine, views.reload_params(), interfaces similar to other
views.
Search, sorting, and pagination are implemented for this detail page
using three new templates.
templates/detail_pagination_bottom.html
templates/detail_search_header.html
templates/detail_sorted_header.html
views.recipe() is optimized since the recipe's package list is no
longer needed by the recipe template, only the recipe's package count
is required for the first page.
The recipe view and template also changes to support tabbing to the
right context on the recipe detail page from the recipe-package page.
[YOCTO #6154]
(Bitbake rev: 6cb9e853d05c2c71467af22ef459ffbe6f41de36)
Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24 22:14:41 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Update page display settings -->
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
2015-05-19 15:14:29 +00:00
|
|
|
// load data for number of entries to be displayed on page
|
bitbake: toaster: add sort, search, paging to recipe package page
When selecting the packages tab on a recipe detail page, the page now
includes:
column sort on package name and size columns,
search on the package name, and
pagination.
Column sort is added by splitting the recipe view/html for a recipe's
package list into a new url path, view name and template, so that
the sorting routine, views.reload_params(), interfaces similar to other
views.
Search, sorting, and pagination are implemented for this detail page
using three new templates.
templates/detail_pagination_bottom.html
templates/detail_search_header.html
templates/detail_sorted_header.html
views.recipe() is optimized since the recipe's package list is no
longer needed by the recipe template, only the recipe's package count
is required for the first page.
The recipe view and template also changes to support tabbing to the
right context on the recipe detail page from the recipe-package page.
[YOCTO #6154]
(Bitbake rev: 6cb9e853d05c2c71467af22ef459ffbe6f41de36)
Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-24 22:14:41 +00:00
|
|
|
if ({{request.GET.count}} != "") {
|
|
|
|
pagesize = {{request.GET.count}};
|
|
|
|
}
|
|
|
|
$('.pagesize option').prop('selected', false)
|
|
|
|
.filter('[value="' + pagesize + '"]')
|
|
|
|
.attr('selected', true);
|
|
|
|
|
|
|
|
$(".pagesize").change(function () {
|
|
|
|
reload_params({"count":$(this).val()});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endif %}
|
|
|
|
|