Merge lp:~mhall119/loco-team-portal/site-search into lp:loco-team-portal

Proposed by Michael Hall
Status: Merged
Merged at revision: 325
Proposed branch: lp:~mhall119/loco-team-portal/site-search
Merge into: lp:loco-team-portal
Diff against target: 742 lines (+153/-132)
41 files modified
loco_directory/common/context_processors.py (+5/-0)
loco_directory/common/forms.py (+11/-0)
loco_directory/common/views.py (+58/-0)
loco_directory/events/forms.py (+0/-10)
loco_directory/events/views.py (+0/-8)
loco_directory/settings.py (+1/-0)
loco_directory/teams/forms.py (+0/-9)
loco_directory/teams/views.py (+0/-7)
loco_directory/templates/about.html (+0/-2)
loco_directory/templates/about_loco.html (+0/-2)
loco_directory/templates/base.html (+7/-0)
loco_directory/templates/events/event_list.html (+0/-7)
loco_directory/templates/events/global_event_delete_confirm.html (+0/-3)
loco_directory/templates/events/global_event_detail.html (+0/-3)
loco_directory/templates/events/global_event_new.html (+0/-3)
loco_directory/templates/events/global_event_update.html (+0/-3)
loco_directory/templates/events/team_event_comment_new.html (+0/-3)
loco_directory/templates/events/team_event_delete_confirm.html (+0/-3)
loco_directory/templates/events/team_event_detail.html (+0/-3)
loco_directory/templates/events/team_event_new.html (+0/-3)
loco_directory/templates/events/team_event_new_select.html (+0/-3)
loco_directory/templates/events/team_event_register.html (+0/-3)
loco_directory/templates/events/team_event_update.html (+0/-3)
loco_directory/templates/index.html (+0/-2)
loco_directory/templates/irc_chat.html (+0/-2)
loco_directory/templates/loco_council.html (+0/-2)
loco_directory/templates/site_search.html (+67/-0)
loco_directory/templates/teams/merge_teams.html (+0/-1)
loco_directory/templates/teams/select_other_team.html (+0/-1)
loco_directory/templates/teams/team_detail.html (+0/-1)
loco_directory/templates/teams/team_event_history.html (+0/-2)
loco_directory/templates/teams/team_event_list.html (+0/-1)
loco_directory/templates/teams/team_list.html (+0/-7)
loco_directory/templates/teams/team_reapprovals.html (+0/-1)
loco_directory/templates/using_locodir.html (+0/-2)
loco_directory/templates/venues/venue_detail.html (+0/-3)
loco_directory/templates/venues/venue_list.html (+0/-7)
loco_directory/templates/venues/venue_update.html (+0/-3)
loco_directory/urls.py (+1/-0)
loco_directory/venues/forms.py (+0/-9)
loco_directory/venues/views.py (+3/-10)
To merge this branch: bzr merge lp:~mhall119/loco-team-portal/site-search
Reviewer Review Type Date Requested Status
Daniel Holbach (community) Approve
Review via email: mp+41401@code.launchpad.net

Description of the change

Leave the sub-nav bar and search box on all pages (except 500.html), and search for teams, events and venues all at the same time for the same search text.

To post a comment you must log in.
326. By Michael Hall

Cleanup to remove old per-page search forms and filters

327. By Michael Hall

Oops, forgot to add this

328. By Michael Hall

Add venue city to search results listing

Revision history for this message
Daniel Holbach (dholbach) wrote :

Great work!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/common/context_processors.py'
2--- loco_directory/common/context_processors.py 2010-08-27 00:04:00 +0000
3+++ loco_directory/common/context_processors.py 2010-11-20 18:36:42 +0000
4@@ -43,3 +43,8 @@
5 def url_base(request):
6 url = request.get_full_path().split('/')
7 return {'url_base': url[1]}
8+
9+def site_search(request):
10+ from common.forms import SiteSearchForm
11+ search_form = SiteSearchForm(data=request.GET)
12+ return {'search_form': search_form}
13
14=== modified file 'loco_directory/common/forms.py'
15--- loco_directory/common/forms.py 2010-10-21 16:13:05 +0000
16+++ loco_directory/common/forms.py 2010-11-20 18:36:42 +0000
17@@ -1,5 +1,6 @@
18 from django.template import Context, loader
19 from django import forms
20+from django.utils.translation import ugettext as _
21
22 # Taken from http://djangosnippets.org/snippets/1732/
23 class RenderableMixin(object):
24@@ -39,3 +40,13 @@
25 Context(context_dict)
26 )
27
28+class SiteSearchForm(forms.Form):
29+ """
30+ A Search form for the whole site
31+ """
32+ q = forms.CharField(label=_('Search'), required=False, max_length=100)
33+
34+ def as_line(self):
35+ "Returns this form rendered. Only the fields. Nothing else HTML."
36+ return self._html_output(u'%(label)s %(errors)s%(field)s%(help_text)s', u'%s', '', u'%s', False)
37+
38
39=== modified file 'loco_directory/common/views.py'
40--- loco_directory/common/views.py 2010-08-26 00:00:52 +0000
41+++ loco_directory/common/views.py 2010-11-20 18:36:42 +0000
42@@ -60,3 +60,61 @@
43 request.session['django_language'] = lang
44 response.set_cookie(settings.LANGUAGE_COOKIE_NAME,lang)
45 return response
46+
47+def site_search(request):
48+ from common.forms import SiteSearchForm
49+ from common.utils import simple_iterator
50+ teams = []
51+ global_events = []
52+ team_events = []
53+ venues = []
54+ q = None
55+ form = SiteSearchForm(data=request.GET)
56+ if form.is_valid():
57+ q = form.cleaned_data.get('q', None)
58+ if q is not None:
59+ teams = search_teams(q)
60+ global_events = search_global_events(q)
61+ team_events = search_team_events(q)
62+ venues = search_venues(q)
63+ context = {
64+ 'teams': teams,
65+ 'global_events': global_events,
66+ 'team_events': team_events,
67+ 'venues': venues,
68+ 'q': q,
69+ 'colcycle' : simple_iterator('col_left', 'col_right'),
70+ }
71+ return render_to_response('site_search.html', context,
72+ RequestContext(request))
73+
74+def search_teams(q):
75+ from teams.models import Team
76+ from django.db.models import Q
77+ team_list = Team.objects.all().order_by('name')
78+ team_list = team_list.filter(Q(name__icontains=q) | Q(countries__name__icontains=q) | Q(city__icontains=q) | Q(languages__name__icontains=q))
79+ return team_list
80+
81+def search_global_events(q):
82+ from events.models import GlobalEvent
83+ from django.db.models import Q
84+ global_event_list = GlobalEvent.objects.next_events()
85+ global_event_list = global_event_list.filter(Q(name__icontains=q))
86+ return global_event_list
87+
88+def search_team_events(q):
89+ from events.models import TeamEvent
90+ from django.db.models import Q
91+ team_event_list = TeamEvent.objects.next_events()
92+ team_event_list = team_event_list.filter(Q(name__icontains=q) | Q(teams__name__icontains=q) | Q(venue__name__icontains=q) | Q(venue__city__icontains=q) | Q(venue__country__name__icontains=q) | Q(global_event__name__icontains=q))
93+ return team_event_list
94+
95+def search_venues(q):
96+ from venues.models import Venue
97+ from django.db.models import Q
98+ venue_list = Venue.objects.all().order_by('name')
99+ venue_list = venue_list.filter(Q(name__icontains=q) | Q(country__name__icontains=q) | Q(city__icontains=q) | Q(address__icontains=q))
100+ return venue_list
101+
102+
103+
104
105=== modified file 'loco_directory/events/forms.py'
106--- loco_directory/events/forms.py 2010-10-21 16:13:05 +0000
107+++ loco_directory/events/forms.py 2010-11-20 18:36:42 +0000
108@@ -134,14 +134,4 @@
109 '/media/js/colortip-1.0-jquery.js',
110 )
111
112-class EventSearchForm(forms.Form):
113- """
114- A Search form for events
115- """
116- q = forms.CharField(label=_('Search'), required=False, max_length=100)
117-
118- def as_line(self):
119- "Returns this form rendered. Only the fields. Nothing else HTML."
120- return self._html_output(u'%(label)s %(errors)s%(field)s%(help_text)s', u'%s', '', u'%s', False)
121-
122
123
124=== modified file 'loco_directory/events/views.py'
125--- loco_directory/events/views.py 2010-11-15 08:17:02 +0000
126+++ loco_directory/events/views.py 2010-11-20 18:36:42 +0000
127@@ -14,7 +14,6 @@
128 from forms import TeamEventCommentForm
129 from forms import GlobalEventForm
130 from forms import AttendeeRegistrationForm
131-from forms import EventSearchForm
132 from django.db.models import Q
133
134 from common.utils import redirect, simple_iterator
135@@ -28,18 +27,11 @@
136 """
137 team_event_list = TeamEvent.objects.next_events()
138 global_event_list = GlobalEvent.objects.next_events()
139- form = EventSearchForm(data=request.GET)
140- if form.is_valid():
141- if form.cleaned_data['q']:
142- q = form.cleaned_data['q']
143- global_event_list = global_event_list.filter(Q(name__icontains=q))
144- team_event_list = team_event_list.filter(Q(name__icontains=q) | Q(teams__name__icontains=q) | Q(venue__name__icontains=q) | Q(venue__city__icontains=q) | Q(venue__country__name__icontains=q) | Q(global_event__name__icontains=q))
145 is_on_lc = launchpad.is_user_on_loco_council(request.user)
146 context = {
147 'team_event_list': team_event_list,
148 'global_event_list': global_event_list,
149 'user_is_on_lc': is_on_lc,
150- 'form': form,
151 }
152 return render_to_response('events/event_list.html', context,
153 RequestContext(request))
154
155=== modified file 'loco_directory/settings.py'
156--- loco_directory/settings.py 2010-09-01 15:50:09 +0000
157+++ loco_directory/settings.py 2010-11-20 18:36:42 +0000
158@@ -87,6 +87,7 @@
159 "common.context_processors.flickr_api_key",
160 "common.context_processors.login_redirect",
161 "common.context_processors.url_base",
162+ "common.context_processors.site_search",
163 )
164
165 ROOT_URLCONF = 'loco_directory.urls'
166
167=== modified file 'loco_directory/teams/forms.py'
168--- loco_directory/teams/forms.py 2010-10-21 16:13:05 +0000
169+++ loco_directory/teams/forms.py 2010-11-20 18:36:42 +0000
170@@ -32,13 +32,4 @@
171 '/media/js/colortip-1.0-jquery.js',
172 )
173
174-class TeamSearchForm(forms.Form):
175- """
176- A Search form for teams
177- """
178- q = forms.CharField(label=_('Search'), required=False, max_length=100)
179-
180- def as_line(self):
181- "Returns this form rendered. Only the fields. Nothing else HTML."
182- return self._html_output(u'%(label)s %(errors)s%(field)s%(help_text)s', u'%s', '', u'%s', False)
183
184
185=== modified file 'loco_directory/teams/views.py'
186--- loco_directory/teams/views.py 2010-10-08 09:10:43 +0000
187+++ loco_directory/teams/views.py 2010-11-20 18:36:42 +0000
188@@ -45,15 +45,8 @@
189 def team_list(request):
190 team_list = Team.objects.all().order_by('name')
191
192- form = forms.TeamSearchForm(data=request.GET)
193- if form.is_valid():
194- if form.cleaned_data['q']:
195- q = form.cleaned_data['q']
196- team_list = team_list.filter(Q(name__icontains=q) | Q(countries__name__icontains=q) | Q(city__icontains=q) | Q(languages__name__icontains=q))
197-
198 context = {
199 'team_list': team_list,
200- 'form': form,
201 'continents': Continent.objects.all().order_by('name'),
202 'countries_without_continent': countries_without_continent().order_by('name'),
203 'countries_without_continent_have_teams': countries_without_continent_have_teams(),
204
205=== modified file 'loco_directory/templates/about.html'
206--- loco_directory/templates/about.html 2010-08-20 13:05:47 +0000
207+++ loco_directory/templates/about.html 2010-11-20 18:36:42 +0000
208@@ -3,8 +3,6 @@
209
210 {% block title %} {% trans "About the LoCo Team Directory" %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}
211
212-{% block sub_nav %}{% endblock %}
213-
214 {% block content %}
215
216
217
218=== modified file 'loco_directory/templates/about_loco.html'
219--- loco_directory/templates/about_loco.html 2010-09-24 00:53:51 +0000
220+++ loco_directory/templates/about_loco.html 2010-11-20 18:36:42 +0000
221@@ -3,8 +3,6 @@
222
223 {% block title %} {% trans "About Local Community (LoCo) Teams" %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}
224
225-{% block sub_nav %}{% endblock %}
226-
227 {% block content %}
228
229 <article class="main-content">
230
231=== modified file 'loco_directory/templates/base.html'
232--- loco_directory/templates/base.html 2010-09-09 19:06:22 +0000
233+++ loco_directory/templates/base.html 2010-11-20 18:36:42 +0000
234@@ -26,6 +26,13 @@
235 {% block sub_nav_links %}
236 {% endblock %}
237
238+{% block search_box %}
239+<form id="site_search_form" action="{% url common.views.site_search %}" method="get">
240+ {{ search_form.q }}
241+ <input type="image" src="/media/img/search.png" title="{% trans "Search" %}" />
242+</form>
243+{% endblock %}
244+
245 {% block messages %}
246 {% if messages %}
247 {% for message in messages %}
248
249=== modified file 'loco_directory/templates/events/event_list.html'
250--- loco_directory/templates/events/event_list.html 2010-11-12 11:26:24 +0000
251+++ loco_directory/templates/events/event_list.html 2010-11-20 18:36:42 +0000
252@@ -12,13 +12,6 @@
253 <a class="sub-nav-item" href="{% url event-history-list %}">{% trans "Past Events" %}</a>
254 {% endblock %}
255
256-{% block search_box %}
257-<form action="." method="get">
258- {{ form.as_line }}
259- <input type="image" src="/media/img/search.png" title="{% trans "Search" %}" />
260-</form>
261-{% endblock %}
262-
263 {% block content %}
264 <article class="main-content">
265 <h2>{% trans "Ubuntu LoCo Global Events" %}
266
267=== modified file 'loco_directory/templates/events/global_event_delete_confirm.html'
268--- loco_directory/templates/events/global_event_delete_confirm.html 2010-08-21 21:07:34 +0000
269+++ loco_directory/templates/events/global_event_delete_confirm.html 2010-11-20 18:36:42 +0000
270@@ -7,9 +7,6 @@
271 {{form.media}}
272 {% endblock %}
273
274-{% block sub_nav %}
275-{% endblock %}
276-
277 {% block content %}
278 <article class="main-content">
279 <h2>{% trans "Delete global Event" %}</h2>
280
281=== modified file 'loco_directory/templates/events/global_event_detail.html'
282--- loco_directory/templates/events/global_event_detail.html 2010-09-09 19:06:22 +0000
283+++ loco_directory/templates/events/global_event_detail.html 2010-11-20 18:36:42 +0000
284@@ -18,9 +18,6 @@
285 {% endif %}
286 {% endblock %}
287
288-{% block search %}
289-{% endblock %}
290-
291 {% block content %}
292
293 {% include "events/global_event_detail.inc.html" %}
294
295=== modified file 'loco_directory/templates/events/global_event_new.html'
296--- loco_directory/templates/events/global_event_new.html 2010-10-08 21:43:14 +0000
297+++ loco_directory/templates/events/global_event_new.html 2010-11-20 18:36:42 +0000
298@@ -17,9 +17,6 @@
299 --></script>
300 {% endblock %}
301
302-{% block sub_nav %}
303-{% endblock %}
304-
305 {% block content %}
306 <article class="main-content">
307 <h2>{% trans "Add new Global Event" %}</h2>
308
309=== modified file 'loco_directory/templates/events/global_event_update.html'
310--- loco_directory/templates/events/global_event_update.html 2010-10-08 21:43:14 +0000
311+++ loco_directory/templates/events/global_event_update.html 2010-11-20 18:36:42 +0000
312@@ -15,9 +15,6 @@
313 --></script>
314 {% endblock %}
315
316-{% block sub_nav %}
317-{% endblock %}
318-
319 {% block content %}
320 <article class="main-content">
321 <h2>{% trans "Update Global Event" %}</h2>
322
323=== modified file 'loco_directory/templates/events/team_event_comment_new.html'
324--- loco_directory/templates/events/team_event_comment_new.html 2010-10-08 21:43:14 +0000
325+++ loco_directory/templates/events/team_event_comment_new.html 2010-11-20 18:36:42 +0000
326@@ -7,9 +7,6 @@
327 {{form.media}}
328 {% endblock %}
329
330-{% block sub_nav %}
331-{% endblock %}
332-
333 {% block extrafooter %}
334 <script type="text/javascript"><!--
335 $(document).ready(function(){
336
337=== modified file 'loco_directory/templates/events/team_event_delete_confirm.html'
338--- loco_directory/templates/events/team_event_delete_confirm.html 2010-08-21 21:07:34 +0000
339+++ loco_directory/templates/events/team_event_delete_confirm.html 2010-11-20 18:36:42 +0000
340@@ -7,9 +7,6 @@
341 {{form.media}}
342 {% endblock %}
343
344-{% block sub_nav %}
345-{% endblock %}
346-
347 {% block content %}
348 <article class="main-content">
349 <h2>{% trans "Delete Team Event" %}</h2>
350
351=== modified file 'loco_directory/templates/events/team_event_detail.html'
352--- loco_directory/templates/events/team_event_detail.html 2010-11-12 11:26:24 +0000
353+++ loco_directory/templates/events/team_event_detail.html 2010-11-20 18:36:42 +0000
354@@ -16,9 +16,6 @@
355 <a class="sub-nav-item" href="{% url event-ical team_event_object.id %}">{% trans "iCal Feed" %}</a>
356 {% endblock %}
357
358-{% block search %}
359-{% endblock %}
360-
361 {% block content %}
362
363 {% include "events/team_event_detail.inc.html" %}
364
365=== modified file 'loco_directory/templates/events/team_event_new.html'
366--- loco_directory/templates/events/team_event_new.html 2010-10-08 21:43:14 +0000
367+++ loco_directory/templates/events/team_event_new.html 2010-11-20 18:36:42 +0000
368@@ -23,9 +23,6 @@
369 --></script>
370 {% endblock %}
371
372-{% block sub_nav %}
373-{% endblock %}
374-
375 {% block content %}
376 <article class="main-content">
377 <h2>{% trans "Add new Team Event for " %}{{ team_object.name}}</h2>
378
379=== modified file 'loco_directory/templates/events/team_event_new_select.html'
380--- loco_directory/templates/events/team_event_new_select.html 2010-08-21 21:07:34 +0000
381+++ loco_directory/templates/events/team_event_new_select.html 2010-11-20 18:36:42 +0000
382@@ -3,9 +3,6 @@
383
384 {% block title %}{% trans "New Team Event" %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}
385
386-{% block sub_nav %}
387-{% endblock %}
388-
389 {% block content %}
390 <article class="main-content alone">
391 <h2>{% trans "Select a Team to add an Event for" %}:</h2>
392
393=== modified file 'loco_directory/templates/events/team_event_register.html'
394--- loco_directory/templates/events/team_event_register.html 2010-10-08 21:43:14 +0000
395+++ loco_directory/templates/events/team_event_register.html 2010-11-20 18:36:42 +0000
396@@ -7,9 +7,6 @@
397 {{form.media}}
398 {% endblock %}
399
400-{% block sub_nav %}
401-{% endblock %}
402-
403 {% block content %}
404 <article class="main-content">
405 <h2>{% trans "Register for event " %}</h2>
406
407=== modified file 'loco_directory/templates/events/team_event_update.html'
408--- loco_directory/templates/events/team_event_update.html 2010-10-08 21:43:14 +0000
409+++ loco_directory/templates/events/team_event_update.html 2010-11-20 18:36:42 +0000
410@@ -15,9 +15,6 @@
411 --></script>
412 {% endblock %}
413
414-{% block sub_nav %}
415-{% endblock %}
416-
417 {% block content %}
418 <article class="main-content">
419 <h2>{% trans "Update Team Event" %}</h2>
420
421=== modified file 'loco_directory/templates/index.html'
422--- loco_directory/templates/index.html 2010-09-09 19:06:22 +0000
423+++ loco_directory/templates/index.html 2010-11-20 18:36:42 +0000
424@@ -6,8 +6,6 @@
425 <a class="sub-nav-item" href="{% url using_locodir %}">{% trans "Using the LoCo Team Directory" %}</a>
426 {% endblock %}
427
428-{% block search %}{% endblock %}
429-
430 {% block extrahead %}{{block.super}}
431 <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/css/twidenash.css" />
432 <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/css/continents.css" />
433
434=== modified file 'loco_directory/templates/irc_chat.html'
435--- loco_directory/templates/irc_chat.html 2010-09-13 22:20:52 +0000
436+++ loco_directory/templates/irc_chat.html 2010-11-20 18:36:42 +0000
437@@ -3,8 +3,6 @@
438
439 {% block title %} {% trans "Ubuntu LoCo Teams IRC Chat" %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}
440
441-{% block sub_nav %}{% endblock %}
442-
443 {% block content %}
444
445 <h1>{% trans "Ubuntu LoCo Teams IRC Chat" %}</h1>
446
447=== modified file 'loco_directory/templates/loco_council.html'
448--- loco_directory/templates/loco_council.html 2010-09-26 21:10:01 +0000
449+++ loco_directory/templates/loco_council.html 2010-11-20 18:36:42 +0000
450@@ -7,8 +7,6 @@
451 <a class="sub-nav-item" href="approved">{% trans "Approved Teams" %}</a>
452 {% endblock %}
453
454-{% block search %}{% endblock %}
455-
456 {% block content %}
457
458 <h1>{% trans "Ubuntu LoCo Council" %}</h1>
459
460=== added file 'loco_directory/templates/site_search.html'
461--- loco_directory/templates/site_search.html 1970-01-01 00:00:00 +0000
462+++ loco_directory/templates/site_search.html 2010-11-20 18:36:42 +0000
463@@ -0,0 +1,67 @@
464+{% extends "base.html" %}
465+{% load i18n %}
466+
467+{% block content %}
468+
469+{% if q %}
470+
471+{% if teams %}
472+<article class="main-content">
473+ <h2>{% trans "Teams" %}</h2>
474+ <ul>
475+ {{colcycle.reset}}
476+ {% for team in teams %}
477+ <li title="{% if team.approved %}{% blocktrans with team.name as teamname %}{{ teamname }} approved{% endblocktrans %}{% else %}{% blocktrans with team.name as teamname %}{{ teamname }} not approved{% endblocktrans %}{% endif %}" class="{% if team.approved %}approved{% else %}unapproved{% endif %} {{colcycle.next}}"><a href="{{ team.get_absolute_url }}">{{ team.name }}</a></li>
478+ {% endfor %}
479+ </ul>
480+</article>
481+<hr class="divide" />
482+{% endif %}
483+
484+{% if global_events %}
485+<article class="main-content">
486+ <h2>{% trans "Global Events" %}</h2>
487+ {{colcycle.reset}}
488+ <ul>
489+ {% for event in global_events %}
490+ <li class="{{colcycle.next}}"><a href="{{ event.get_absolute_url }}">{{ event.name }}</a> {{event.date_begin|date}} - {{event.date_end|date}}</li>
491+ {% endfor %}
492+ </ul>
493+</article>
494+<hr class="divide" />
495+{% endif %}
496+
497+{% if team_events %}
498+<article class="main-content">
499+ <h2>{% trans "Team Events" %}</h2>
500+ {{colcycle.reset}}
501+ <ul>
502+ {% for event in team_events %}
503+ <li class="{{colcycle.next}}"><a href="{{ event.get_absolute_url }}">{{ event.name }}</a>{% if event.venue.city %}, {{ event.venue.city }}{% endif %} - {% for team in event.teams.all %}<a title="{% trans "more information about this team" %}" href="{{ team.get_absolute_url }}">{{ team.name }}</a>{% endfor %}</li>
504+ {% endfor %}
505+ </ul>
506+</article>
507+<hr class="divide" />
508+{% endif %}
509+
510+{% if venues %}
511+<article class="main-content">
512+ <h2>{% trans "Venues" %}</h2>
513+ {{colcycle.reset}}
514+ <ul>
515+ {% for venue in venues %}
516+ <li class="{{colcycle.next}}"><a href="{{ venue.get_absolute_url }}">{{ venue.name }}</a>{% if venue.city %}, {{ venue.city }}{% endif %}</li>
517+ {% endfor %}
518+ </ul>
519+</article>
520+<hr class="divide" />
521+{% endif %}
522+
523+{% else %}
524+<article class="main-content alone">
525+ <center>
526+ <h3>{% trans "No search terms provided" %}</h3>
527+ </center>
528+</article>
529+{% endif %}
530+{% endblock %}
531
532=== modified file 'loco_directory/templates/teams/merge_teams.html'
533--- loco_directory/templates/teams/merge_teams.html 2010-09-30 16:14:48 +0000
534+++ loco_directory/templates/teams/merge_teams.html 2010-11-20 18:36:42 +0000
535@@ -5,7 +5,6 @@
536 {% block extrahead %}{{ block.super }}
537 <link rel="stylesheet" type="text/css" href="/media/css/newstyle.css" />
538 {% endblock %}
539-{% block sub_nav %}{% endblock %}
540
541 {% block content %}
542
543
544=== modified file 'loco_directory/templates/teams/select_other_team.html'
545--- loco_directory/templates/teams/select_other_team.html 2010-10-01 05:29:29 +0000
546+++ loco_directory/templates/teams/select_other_team.html 2010-11-20 18:36:42 +0000
547@@ -5,7 +5,6 @@
548 {% block extrahead %}{{ block.super }}
549 <link rel="stylesheet" type="text/css" href="/media/css/newstyle.css" />
550 {% endblock %}
551-{% block sub_nav %}{% endblock %}
552
553 {% block content %}
554
555
556=== modified file 'loco_directory/templates/teams/team_detail.html'
557--- loco_directory/templates/teams/team_detail.html 2010-10-09 14:10:42 +0000
558+++ loco_directory/templates/teams/team_detail.html 2010-11-20 18:36:42 +0000
559@@ -11,7 +11,6 @@
560 {% if is_member %}<a class="sub-nav-item" href="{% url team-event-new team.lp_name %}" title="{% trans "Add New Event" %}">{% trans "Add New Event" %}</a>{% endif %}
561 {% endblock %}
562
563-{% block search %}{% endblock %}
564
565 {% block extrahead %}{{ block.super }}
566 {% if team.flickr_id or team.picasa_id or team.pixie_id %}
567
568=== modified file 'loco_directory/templates/teams/team_event_history.html'
569--- loco_directory/templates/teams/team_event_history.html 2010-08-23 08:18:37 +0000
570+++ loco_directory/templates/teams/team_event_history.html 2010-11-20 18:36:42 +0000
571@@ -8,8 +8,6 @@
572 <a class="sub-nav-item" href="{% url team-event-list team_object.lp_name %}">{% trans "Upcoming Events" %}</a>
573 {% endblock %}
574
575-{% block search %}{% endblock %}
576-
577 {% block content %}
578 <article class="main-content">
579 <h1>{% blocktrans with team_object.name as teamname %}{{teamname}} Events History{% endblocktrans %}</h1>
580
581=== modified file 'loco_directory/templates/teams/team_event_list.html'
582--- loco_directory/templates/teams/team_event_list.html 2010-09-09 19:06:22 +0000
583+++ loco_directory/templates/teams/team_event_list.html 2010-11-20 18:36:42 +0000
584@@ -9,7 +9,6 @@
585 <a class="sub-nav-item" href="{% url team-events-rss team_object.lp_name %}" title="{% trans "Team Events (RSS)" %}"">{% trans "Team Events (RSS)" %}</a>
586 {% endblock %}
587
588-{% block search %}{% endblock %}
589
590 {% block extrahead %}{{ block.super }}
591 <link type="application/rss+xml" rel="alternate" title="Team Events (RSS)" href="{% url team-events-rss team_object.lp_name %}" />
592
593=== modified file 'loco_directory/templates/teams/team_list.html'
594--- loco_directory/templates/teams/team_list.html 2010-08-23 15:05:57 +0000
595+++ loco_directory/templates/teams/team_list.html 2010-11-20 18:36:42 +0000
596@@ -10,13 +10,6 @@
597 {% block sub_nav_links %}
598 {% endblock %}
599
600-{% block search_box %}
601-<form action="." method="get">
602- {{ form.as_line }}
603- <input type="image" src="/media/img/search.png" title="{% trans "Search" %}" />
604-</form>
605-{% endblock %}
606-
607 {% block content %}
608 {% if team_list %}
609 {% for continent in continents %}{% if continent.related_teams %}
610
611=== modified file 'loco_directory/templates/teams/team_reapprovals.html'
612--- loco_directory/templates/teams/team_reapprovals.html 2010-09-10 01:07:12 +0000
613+++ loco_directory/templates/teams/team_reapprovals.html 2010-11-20 18:36:42 +0000
614@@ -5,7 +5,6 @@
615 {% block extrahead %}{{ block.super }}
616 <link rel="stylesheet" type="text/css" href="/media/css/newstyle.css" />
617 {% endblock %}
618-{% block sub_nav %}{% endblock %}
619
620 {% block content %}
621
622
623=== modified file 'loco_directory/templates/using_locodir.html'
624--- loco_directory/templates/using_locodir.html 2010-08-20 09:58:11 +0000
625+++ loco_directory/templates/using_locodir.html 2010-11-20 18:36:42 +0000
626@@ -3,8 +3,6 @@
627
628 {% block title %} {% trans "Using the LoCo Team Directory" %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}
629
630-{% block sub_nav %}{% endblock %}
631-
632 {% block content %}
633
634 <article class="main-content">
635
636=== modified file 'loco_directory/templates/venues/venue_detail.html'
637--- loco_directory/templates/venues/venue_detail.html 2010-11-12 11:26:24 +0000
638+++ loco_directory/templates/venues/venue_detail.html 2010-11-20 18:36:42 +0000
639@@ -15,9 +15,6 @@
640 <a class="sub-nav-item" href="{% url venue-update venue_object.id %}">{% trans "Edit Venue Details" %}</a>
641 {% endblock %}
642
643-{% block search %}
644-{% endblock %}
645-
646 {% block content %}
647
648 {% include "venues/venue_detail.inc.html" %}
649
650=== modified file 'loco_directory/templates/venues/venue_list.html'
651--- loco_directory/templates/venues/venue_list.html 2010-11-12 11:26:24 +0000
652+++ loco_directory/templates/venues/venue_list.html 2010-11-20 18:36:42 +0000
653@@ -7,13 +7,6 @@
654 <a class="sub-nav-item" href="{% url venue-new %}">{% trans "Add New Venue" %}</a>
655 {% endblock %}
656
657-{% block search_box %}
658-<form action="." method="get">
659- {{ form.as_line }}
660- <input type="image" src="/media/img/search.png" title="{% trans "Search" %}" />
661-</form>
662-{% endblock %}
663-
664 {% block content %}
665 <article id="main-content" class="main-content">
666
667
668=== modified file 'loco_directory/templates/venues/venue_update.html'
669--- loco_directory/templates/venues/venue_update.html 2010-10-13 20:56:02 +0000
670+++ loco_directory/templates/venues/venue_update.html 2010-11-20 18:36:42 +0000
671@@ -3,9 +3,6 @@
672
673 {% block title %}{% if venue_object %}{% trans "Update Venue" %}{% else %}{% trans "New Venue" %}{% endif %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}
674
675-{% block sub_nav %}
676-{% endblock %}
677-
678 {% block extrahead %}{{block.super}}
679 {{ form.media }}
680 {% endblock %}
681
682=== modified file 'loco_directory/urls.py'
683--- loco_directory/urls.py 2010-09-10 01:07:12 +0000
684+++ loco_directory/urls.py 2010-11-20 18:36:42 +0000
685@@ -23,6 +23,7 @@
686 url(r'^logout$', 'common.views.site_logout'),
687 url(r'^jsi18n', 'django.views.i18n.javascript_catalog', name='jsi18n'),
688 url(r'^services/', include('services.urls')),
689+ url(r'^search/', 'common.views.site_search', name='site_search'),
690 )
691
692 if settings.STATIC_SERVE:
693
694=== modified file 'loco_directory/venues/forms.py'
695--- loco_directory/venues/forms.py 2010-10-21 16:13:05 +0000
696+++ loco_directory/venues/forms.py 2010-11-20 18:36:42 +0000
697@@ -40,13 +40,4 @@
698 self.cleaned_data['name'] = validate_name(self.cleaned_data.get('name'))
699 return super(VenueForm, self).clean()
700
701-class VenueSearchForm(forms.Form):
702- """
703- A Search form for venues
704- """
705- q = forms.CharField(label=_('Search'), required=False, max_length=100)
706-
707- def as_line(self):
708- "Returns this form rendered. Only the fields. Nothing else HTML."
709- return self._html_output(u'%(label)s %(errors)s%(field)s%(help_text)s', u'%s', '', u'%s', False)
710
711
712=== modified file 'loco_directory/venues/views.py'
713--- loco_directory/venues/views.py 2010-08-02 14:43:27 +0000
714+++ loco_directory/venues/views.py 2010-11-20 18:36:42 +0000
715@@ -10,7 +10,7 @@
716
717 from teams.models import Continent, countries_without_continent, countries_without_continent_have_venues
718 from models import Venue, venues_without_country
719-from forms import VenueForm, VenueSearchForm
720+from forms import VenueForm
721
722 from common.utils import simple_iterator
723
724@@ -18,16 +18,9 @@
725 """
726 a list with all venues
727 """
728- venue_list = Venue.objects.all()
729- form = VenueSearchForm(data=request.GET)
730- if form.is_valid():
731- if form.cleaned_data['q']:
732- q = form.cleaned_data['q']
733- venue_list = venue_list.filter(Q(name__icontains=q) | Q(country__name__icontains=q) | Q(city__icontains=q) | Q(address__icontains=q))
734-
735- venue_list = venue_list.order_by('country')
736+ venue_list = Venue.objects.all().order_by('country')
737+
738 context = {
739- 'form': form,
740 'venue_list': venue_list,
741 'continents': Continent.objects.all().order_by('name'),
742 'countries_without_continent': countries_without_continent().order_by('name'),

Subscribers

People subscribed via source and target branches