Merge lp:~salgado/summit/linaro into lp:summit

Proposed by Guilherme Salgado
Status: Merged
Approved by: Michael Hall
Approved revision: 84
Merged at revision: 94
Proposed branch: lp:~salgado/summit/linaro
Merge into: lp:summit
Diff against target: 135 lines (+39/-7)
7 files modified
.bzrignore (+1/-0)
INSTALL (+1/-0)
summit/linaro.wsgi (+11/-0)
summit/schedule/render.py (+13/-0)
summit/schedule/templates/schedule/schedule_list.html (+1/-1)
summit/schedule/views.py (+8/-6)
summit/settings.py (+4/-0)
To merge this branch: bzr merge lp:~salgado/summit/linaro
Reviewer Review Type Date Requested Status
Michael Hall Pending
Review via email: mp+58503@code.launchpad.net

Description of the change

This branch adds a new wsgi script to be used in summit.linaro.org. That wsgi script sets an environment variable that is picked up in settings.py to set LINARO_ONLY to true. That config in turn changes the daily/room schedule to show only linaro sessions and changes the main summit page (e.g. /uds-o) to only list the tracks that contain the string 'linaro' on their name.

There's also instructions to getting a copy of the light-django-theme branch that has the css/images for summit.linaro.org.

Although these changes are not ideal and we plan to implement support for co-located events before the next UDS, they will make it possible to have a single deployment of lp:summit serving both summit.l.o and summit.u.c without intrusive changes that would require more work and testing than we have time for.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2010-09-20 23:31:20 +0000
3+++ .bzrignore 2011-04-20 20:20:56 +0000
4@@ -3,3 +3,4 @@
5 summit/lp-cache
6 summit/summit.db
7 summit/ubuntu_website
8+summit/linaro_website
9
10=== modified file 'INSTALL'
11--- INSTALL 2011-04-01 15:08:33 +0000
12+++ INSTALL 2011-04-20 20:20:56 +0000
13@@ -11,6 +11,7 @@
14 - cp local_settings.py.sample local_settings.py
15 # edit local_settings.py and set DATABASE_USER, DATABASE_PASSWORD, SECRET_KEY
16 - bzr branch lp:ubuntu-community-webthemes/light-django-theme ubuntu_website
17+ - bzr branch lp:~salgado/ubuntu-community-webthemes/light-django-linaro-theme linaro_website
18 - ./manage.py syncdb
19 - ./manage.py migrate
20 - ./manage.py runserver
21
22=== added file 'summit/linaro.wsgi'
23--- summit/linaro.wsgi 1970-01-01 00:00:00 +0000
24+++ summit/linaro.wsgi 2011-04-20 20:20:56 +0000
25@@ -0,0 +1,11 @@
26+import os
27+import sys
28+
29+root = os.path.join(os.path.dirname(__file__), '..')
30+sys.path.append(root)
31+sys.path.append(os.path.join(root, 'summit'))
32+
33+os.environ['SUMMIT_LINARO'] = '1'
34+os.environ['DJANGO_SETTINGS_MODULE'] = 'summit.settings'
35+import django.core.handlers.wsgi
36+application = django.core.handlers.wsgi.WSGIHandler()
37
38=== modified file 'summit/schedule/render.py'
39--- summit/schedule/render.py 2011-04-18 19:24:13 +0000
40+++ summit/schedule/render.py 2011-04-20 20:20:56 +0000
41@@ -1067,3 +1067,16 @@
42 elif meeting not in linaro_meetings:
43 idx = meetings.index((room, meeting))
44 meetings[idx] = (room, None)
45+
46+
47+def schedule_factory(
48+ request, summit, attendee=None, date=None, room=None, track=None):
49+ """Create and return a Schedule instance with the given arguments.
50+
51+ If settings.LINARO_ONLY is True, create a LinaroSchedule instance instead.
52+ """
53+ schedule_class = Schedule
54+ if settings.LINARO_ONLY:
55+ schedule_class = LinaroSchedule
56+ return schedule_class(
57+ request, summit, attendee, room=room, date=date, track=track)
58
59=== modified file 'summit/schedule/templates/schedule/schedule_list.html'
60--- summit/schedule/templates/schedule/schedule_list.html 2010-10-16 16:38:18 +0000
61+++ summit/schedule/templates/schedule/schedule_list.html 2011-04-20 20:20:56 +0000
62@@ -14,7 +14,7 @@
63 <td>
64 By track:
65 <ul>
66- {% for track in summit.track_set.all %}
67+ {% for track in tracks %}
68 <li><a href="/{{ summit.name }}/track/{{ track.slug|lower }}">{{ track.title }}</a></li>
69 {% endfor %}
70 </ul>
71
72=== modified file 'summit/schedule/views.py'
73--- summit/schedule/views.py 2011-04-19 21:50:43 +0000
74+++ summit/schedule/views.py 2011-04-20 20:20:56 +0000
75@@ -32,7 +32,7 @@
76
77 from summit.schedule.forms import AttendeeInterestForm
78
79-from summit.schedule.render import LinaroSchedule, Schedule
80+from summit.schedule.render import schedule_factory, Schedule
81
82 __all__ = (
83 'index',
84@@ -64,10 +64,15 @@
85 if request.user.is_authenticated() \
86 and request.user.has_perm('schedule.change_agenda'):
87 edit = True
88+ tracks = summit.track_set.all()
89+ if settings.LINARO_ONLY:
90+ tracks = tracks.filter(slug__contains='linaro')
91+
92 context = {
93 'summit': summit,
94 'attendee': attendee,
95 'edit': edit,
96+ 'tracks': tracks,
97 }
98 return render_to_response("schedule/summit.html", context,
99 context_instance=RequestContext(request))
100@@ -96,10 +101,7 @@
101
102 @summit_required
103 def by_date(request, summit, attendee, date):
104- if 'linaro_only' in request.GET:
105- schedule = LinaroSchedule(request, summit, attendee, date=date)
106- else:
107- schedule = Schedule(request, summit, attendee, date=date)
108+ schedule = schedule_factory(request, summit, attendee, date=date)
109
110 if request.method == 'POST':
111 return schedule.save_change()
112@@ -148,7 +150,7 @@
113 except (ObjectDoesNotExist, MultipleObjectsReturned):
114 room = get_object_or_404(summit.room_set, name__exact=room_name)
115
116- schedule = Schedule(request, summit, attendee, room=room)
117+ schedule = schedule_factory(request, summit, attendee, room=room)
118
119 if request.method == 'POST':
120 return schedule.save_change()
121
122=== modified file 'summit/settings.py'
123--- summit/settings.py 2011-04-19 20:25:36 +0000
124+++ summit/settings.py 2011-04-20 20:20:56 +0000
125@@ -96,6 +96,10 @@
126
127 ROOT_URLCONF = 'summit.urls'
128
129+LINARO_ONLY = False
130+if os.environ.get('SUMMIT_LINARO'):
131+ LINARO_ONLY = True
132+
133 TEMPLATE_DIRS = (
134 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
135 # Always use forward slashes, even on Windows.

Subscribers

People subscribed via source and target branches