Skip to content
Browse files

fix bug 834384: Include demo search terms in pagination links when ne…

…eded
  • Loading branch information...
1 parent 0ffa318 commit 80ab6312a57ed44169b972bd709f6c851558ef4f @lmorchard lmorchard committed Feb 8, 2013
Showing with 8 additions and 4 deletions.
  1. +8 −4 apps/demos/templates/demos/elements/submission_listing.html
View
12 apps/demos/templates/demos/elements/submission_listing.html
@@ -49,18 +49,22 @@ <h2 class="count">{{ ngettext('{count} Demo', '{count} Demos', paginator.count)
<p class="showing">{{_('{start}&ndash;{end} of {total}') | f(start=page_obj.start_index(),end=page_obj.end_index(),total=paginator.count) | safe }}</p>
{% endif %}
{% if is_paginated %}
+ {% set page_state_url = pagination_base_url ~ '?sort=' ~ current_sort %}
+ {% if query %}
+ {% set page_state_url = page_state_url ~ '&q=' ~ query %}
+ {% endif %}
<ul class="paging">
{% if page_obj.number != 1 %}
- <li class="first"><a href="{{ pagination_base_url }}?page=1&sort={{current_sort}}" title="{{_('Go to the first page')}}">First</a></li>
+ <li class="first"><a href="{{ page_state_url }}&page=1" title="{{_('Go to the first page')}}">First</a></li>
{% endif %}
{% if page_obj.has_previous() %}
- <li class="prev"><a href="{{ pagination_base_url }}?page={{ page_obj.previous_page_number() }}&sort={{current_sort}}" title="{{_('Go to the previous page')}}">{{_('Previous')}}</a></li>
+ <li class="prev"><a href="{{ page_state_url }}&page={{ page_obj.previous_page_number() }}" title="{{_('Go to the previous page')}}">{{_('Previous')}}</a></li>
{% endif %}
{% if page_obj.has_next() %}
- <li class="next"><a href="{{ pagination_base_url }}?page={{ page_obj.next_page_number() }}&sort={{current_sort}}" title="{{_('Go to the next page')}}">{{_('Next')}}</a></li>
+ <li class="next"><a href="{{ page_state_url }}&page={{ page_obj.next_page_number() }}" title="{{_('Go to the next page')}}">{{_('Next')}}</a></li>
{% endif %}
{% if page_obj.number != paginator.num_pages %}
- <li class="last"><a href="{{ pagination_base_url }}?page={{ paginator.num_pages }}&sort={{current_sort}}" title="{{_('Go to the last page')}}">{{_('Last')}}</a></li>
+ <li class="last"><a href="{{ page_state_url }}&page={{ paginator.num_pages }}" title="{{_('Go to the last page')}}">{{_('Last')}}</a></li>
{% endif %}
</ul>
{% endif %}

0 comments on commit 80ab631

Please sign in to comment.
Something went wrong with that request. Please try again.