mirror of
https://git.yoctoproject.org/poky
synced 2026-04-26 09:32:14 +02:00
bitbake: toaster: layerdetails Fix pagination controls
Bring the pagination controls into line with others in toaster by limiting the number of page buttons to 5 [YOCTO #7195] (Bitbake rev: 0b35eed7ca758476f20d6875291ee31fad35b7d3) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
00e3545029
commit
4742ae94a9
@@ -287,7 +287,7 @@
|
||||
{%else%}
|
||||
<li class="disabled"><a href="#">«</a></li>
|
||||
{%endif%}
|
||||
{% for i in targets.paginator.page_range %}
|
||||
{% for i in targets.page_range %}
|
||||
<li {%if i == targets.number %} class="active" {%endif%}><a href="?tpage={{i}}#targets">{{i}}</a></li>
|
||||
{% endfor %}
|
||||
{%if targets.has_next%}
|
||||
@@ -418,7 +418,7 @@
|
||||
{%else%}
|
||||
<li class="disabled"><a href="#">«</a></li>
|
||||
{%endif%}
|
||||
{% for i in machines.paginator.page_range %}
|
||||
{% for i in machines.page_range %}
|
||||
<li {%if i == machines.number %} class="active" {%endif%}><a href="?mpage={{i}}#machines">{{i}}</a></li>
|
||||
{% endfor %}
|
||||
{%if machines.has_next%}
|
||||
|
||||
@@ -2630,15 +2630,7 @@ if toastermain.settings.MANAGED:
|
||||
Q(name__icontains=request.GET['targets_search']) |
|
||||
Q(summary__icontains=request.GET['targets_search']))
|
||||
|
||||
targets = Paginator(targets_query.order_by("name"), limit)
|
||||
|
||||
if request.GET.has_key("tpage"):
|
||||
try:
|
||||
targets = targets.page(request.GET['tpage'])
|
||||
except EmptyPage:
|
||||
targets = targets.page(targets.num_pages)
|
||||
else:
|
||||
targets = targets.page(1)
|
||||
targets = _build_page_range(Paginator(targets_query.order_by("name"), limit), request.GET.get('tpage', 1))
|
||||
|
||||
machines_query = Machine.objects.filter(layer_version=layer_version)
|
||||
|
||||
@@ -2648,15 +2640,7 @@ if toastermain.settings.MANAGED:
|
||||
Q(name__icontains=request.GET['machines_search']) |
|
||||
Q(description__icontains=request.GET['machines_search']))
|
||||
|
||||
machines = Paginator(machines_query.order_by("name"), limit)
|
||||
|
||||
if request.GET.has_key("mpage"):
|
||||
try:
|
||||
machines = machines.page(request.GET['mpage'])
|
||||
except EmptyPage:
|
||||
machines = machines.page(machines.num_pages)
|
||||
else:
|
||||
machines = machines.page(1)
|
||||
machines = _build_page_range(Paginator(machines_query.order_by("name"), limit), request.GET.get('mpage', 1))
|
||||
|
||||
context = {
|
||||
'layerversion': layer_version,
|
||||
|
||||
Reference in New Issue
Block a user