Skip to content
This repository was archived by the owner on Sep 19, 2018. It is now read-only.

Commit 1f50fe7

Browse files
committed
Fixed duplication of results counter for ajax calls
1 parent 05d9c6d commit 1f50fe7

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

web/templates/pages/ajax_faceted_search_events.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{% load endless %}
22

33
{% if events %}
4+
{% if not page %}
45
<div class="search-counter">{{ events|length }} {% if events|length > 1 %}events match{% else %}event matches{% endif %} your search criteria:</div>
5-
{% lazy_paginate 6 events as pag_events %}
6+
{% endif %}
7+
8+
{% lazy_paginate 10 events as pag_events %}
69
{% for event in pag_events %}
710
{% include 'layout/event_tile_long.html' %}
811
{% endfor %}

web/views/events.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ def search_events(request):
279279
past_events = True if past and past=='yes' else False
280280

281281
search_query = request.GET.get('q', '')
282+
page = request.GET.get('page', None)
282283

283284
template = 'pages/search_events.html'
284285
page_template = 'pages/ajax_faceted_search_events.html'
@@ -302,7 +303,10 @@ def search_events(request):
302303
if request.is_ajax():
303304
return render_to_response(
304305
page_template,
305-
{'events':events},
306+
{
307+
'events':events,
308+
'page': page
309+
},
306310
context_instance=RequestContext(request))
307311

308312
return render_to_response(

0 commit comments

Comments
 (0)