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 a detail table Search field and Rows per page.
|
|
|
|
Input:
|
|
|
|
objects, our boilerplated paginated with search fields set.
|
|
|
|
object_count, count of full, unfiltered, objects list
|
|
|
|
search_what, fills in "Search ___"
|
|
|
|
Only show the search form if we have more than 10 results,
|
|
|
|
or if return from a previous search.
|
|
|
|
{% endcomment %}
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
/* Clear the current search selection and reload the results */
|
|
|
|
$(".search-clear").click(function(){
|
|
|
|
$("#search").val("");
|
|
|
|
$(this).parents("form").submit();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
2016-04-12 14:56:43 +00:00
|
|
|
|
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.paginator.count > 10 or request.GET.search %}
|
|
|
|
{% if objects.paginator.count == 0 %}
|
|
|
|
<div class="alert">
|
|
|
|
<h3>No {{search_what}} found</h3>
|
|
|
|
<form id="searchform" class="input-append">
|
|
|
|
{% else %}
|
|
|
|
<form id="searchform" class="navbar-search input-append pull-left">
|
|
|
|
{% endif %}
|
|
|
|
|
2015-06-24 13:53:21 +00:00
|
|
|
<input id="search" class="input-xlarge" type="text" placeholder="Search {{search_what}}" name="search" value="{% if request.GET.search %}{{request.GET.search}}{% endif %}">
|
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
|
|
|
<input type="hidden" value="name:+" name="orderby">
|
|
|
|
<input type="hidden" value="l" name="page">
|
|
|
|
{% if request.GET.search %}
|
2016-04-12 14:56:43 +00:00
|
|
|
<a class="input-append-addon btn search-clear">
|
|
|
|
<i class="glyphicon glyphicon-remove"></i>
|
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
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
<button type="submit" class="btn">Search</button>
|
|
|
|
{% if objects.paginator.count == 0 %}
|
|
|
|
<button type="submit" class="btn btn-link search-clear">
|
|
|
|
Show all {{search_what}}
|
|
|
|
</button>
|
|
|
|
{% endif %}
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if objects.paginator.count == 0 %}
|
|
|
|
</div> {# end alert #}
|
|
|
|
{% else %}
|
|
|
|
{% if object_count > 10 %}
|
|
|
|
<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 "10 25 50 100 150" as list%}
|
|
|
|
{% for i in list.split %}
|
|
|
|
{% if request.session.limit == i %}
|
|
|
|
<option value="{{i}}" selected>{{i}}</option>
|
|
|
|
{% else %}
|
|
|
|
<option value="{{i}}">{{i}}</option>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endwith %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2016-04-12 14:56:43 +00:00
|
|
|
|