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

Commit d8841cb

Browse files
committed
Replaced value of parameter for past events
1 parent 9317cb6 commit d8841cb

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

web/forms/event_form.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class SearchEventForm(forms.Form):
168168
required=False,
169169
widget=forms.TextInput(attrs={'placeholder': 'Search for event name or tag', 'class': 'form-control'})
170170
)
171-
past_events = forms.BooleanField(
171+
past = forms.BooleanField(
172172
label='Include past events',
173173
required=False,
174174
widget=forms.CheckboxInput(attrs={'class': 'search-form-element'}),
@@ -205,7 +205,7 @@ def __init__(self, *args, **kwargs):
205205

206206
if country_code:
207207
self.fields['country'].initial = country_code
208-
self.fields['past_events'].initial = past_events
208+
self.fields['past'].initial = past_events
209209
if search_query:
210210
self.fields['q'].initial = search_query
211211
if theme:

web/templates/pages/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333

3434
<div class="container index-content">
3535
<div id="past-events">
36-
{% if past == 'yes' %}
36+
{% if past == 'on' %}
3737
<a id="past-link" href="{% url 'web.index' %}"><i class="fa fa-check-square-o"></i>
3838
{% else %}
39-
<a id="past-link" href="{% url 'web.index' %}?past=yes"><i class="fa fa-square-o"></i>
39+
<a id="past-link" href="{% url 'web.index' %}?past=on"><i class="fa fa-square-o"></i>
4040
{% endif %}
4141
Show past events</a>
4242
</div>

web/templates/pages/scoreboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h1>#codeEU Events Scoreboard</h1>
1111
<img src="/static/flags/{{ country.country_code|lower }}.png" alt="{{ country.country_name }}" />
1212
<span class="icon-flag">
1313
<span class="country-name">{{ country.country_name }}</span> is participating with
14-
<span class="event-number"><a href="{% url 'web.search_events' %}?country_code={{ country.country_code }}&amp;past=yes">{{ country.events }}</span> event{% if country.events != 1 %}s{% endif %}</a>
14+
<span class="event-number"><a href="{% url 'web.search_events' %}?country_code={{ country.country_code }}&amp;past=on">{{ country.events }}</span> event{% if country.events != 1 %}s{% endif %}</a>
1515
</span>
1616
</div>
1717
{% endfor %}

web/templates/pages/search_events.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
{{ form.country }}
2727
<div class="search-checkbox">
2828
<hr>
29-
{{ form.past_events }}
30-
<label for="{{ form.past_events.id_for_label }}">{{ form.past_events.label }}</label>
29+
{{ form.past }}
30+
<label for="{{ form.past.id_for_label }}">{{ form.past.label }}</label>
3131
</div>
3232
<div class="search-checkbox">
3333
<hr>

web/views/events.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
def index(request):
5050
template = 'pages/index.html'
5151

52-
past = request.GET.get('past', 'no')
52+
past = request.GET.get('past', 'off')
5353

5454
user_ip = get_client_ip(forwarded=request.META.get('HTTP_X_FORWARDED_FOR'),
5555
remote=request.META.get('REMOTE_ADDR'))
@@ -264,7 +264,7 @@ def search_events(request):
264264
country = get_country(country_filter, user_ip)
265265
country_filter = country['country_code']
266266

267-
past = request.GET.get('past_events', 'off')
267+
past = request.GET.get('past', False)
268268
if past == 'on':
269269
past_events = True
270270
else:
@@ -282,7 +282,7 @@ def search_events(request):
282282
country_filter = form.cleaned_data.get('country', None)
283283
theme_filter = form.cleaned_data.get('theme', None)
284284
audience_filter = form.cleaned_data.get('audience', None)
285-
past_events = form.cleaned_data.get('past_events',None)
285+
past_events = form.cleaned_data.get('past',None)
286286

287287
events = get_filtered_events(search_filter, country_filter, theme_filter, audience_filter, past_events)
288288
else:

0 commit comments

Comments
 (0)