Skip to content

Commit

Permalink
Added filter_by parameter in paginator
Browse files Browse the repository at this point in the history
  • Loading branch information
capooti committed Oct 16, 2017
1 parent 28af539 commit 17fce09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions hypermap/aggregator/templates/aggregator/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@
</div>

<ul class="pagination">
<li><a href="?page=1">(1/{{ services.paginator.num_pages }}) &laquo;&laquo;&laquo;</a></li>
<li><a href="?page=1{% if filter_by %}&filter_by={{ filter_by }}{% endif %}">(1/{{ services.paginator.num_pages }}) &laquo;&laquo;&laquo;</a></li>
{% for i in services.paginator.page_range %}
{% if services.number == i %}
<li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
{% else %}
<li><a href="?page={{ i }}">{{ i }}</a></li>
<li><a href="?page={{ i }}{% if filter_by %}&filter_by={{ filter_by }}{% endif %}">{{ i }}</a></li>
{% endif %}
{% endfor %}
<li><a href="?page={{ services.paginator.num_pages }}">&raquo;&raquo;&raquo; ({{ services.paginator.num_pages }}/{{ services.paginator.num_pages }})</a></li>
<li><a href="?page={{ services.paginator.num_pages }}{% if filter_by %}&filter_by={{ filter_by }}{% endif %}">&raquo;&raquo;&raquo; ({{ services.paginator.num_pages }}/{{ services.paginator.num_pages }})</a></li>
</ul>

{% else %}
Expand Down
3 changes: 2 additions & 1 deletion hypermap/aggregator/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ def index(request, catalog_slug=None):
'types_list': types_list,
'layers_count': layers_count,
'services_count': services_count,
'catalogs': Catalog.objects.filter(url__isnull=False)
'catalogs': Catalog.objects.filter(url__isnull=False),
'filter_by': filter_by,
})
return HttpResponse(template.render(context))

Expand Down

0 comments on commit 17fce09

Please sign in to comment.