Merge lp:~cjohnston/summit/bzr_apps into lp:summit

Proposed by Chris Johnston
Status: Merged
Approved by: Nigel Babu
Approved revision: 142
Merged at revision: 142
Proposed branch: lp:~cjohnston/summit/bzr_apps
Merge into: lp:summit
Diff against target: 390 lines (+113/-159)
7 files modified
.bzrignore (+2/-6)
summit/media/css/twidenash.css (+36/-18)
summit/media/twidenash.js (+0/-122)
summit/schedule/management/commands/init-summit.py (+28/-0)
summit/schedule/templates/schedule/index.html (+12/-2)
summit/settings.py (+34/-10)
summit/urls.py (+1/-1)
To merge this branch: bzr merge lp:~cjohnston/summit/bzr_apps
Reviewer Review Type Date Requested Status
Nigel Babu (community) Approve
Chris Johnston Needs Resubmitting
Review via email: mp+65924@code.launchpad.net

Commit message

Switches summit to using bzr_apps by running init-summit.

To post a comment you must log in.
lp:~cjohnston/summit/bzr_apps updated
126. By Chris Johnston

[r=][] Fixes minor spelling error

127. By Chris Johnston

[r=][] Updates required version of south

128. By Chris Johnston

[r=chrisjohnston][] Fixes a minor spelling issue in fields.py

129. By Michael Hall

[r=mhall119][781117] Changes /today url to /summit_name/today

130. By Chris Johnston

[r=mhall119][793020] Modifies links to match uds.ubuntu.com

131. By Chris Johnston

[r=mhall119][765031] Adds private room as an option for a room status.

132. By Chris Johnston

[r=mhall119][] Adds update-openids script to summit to fix usernames.

133. By Michael Hall

Merge from 1.x

134. By Michael Hall

Merge from 1.x

135. By Michael Hall

Merge from 1.x

136. By Chris Johnston

[r=mhall119][] Removes old migrations and adds new initial migration

Revision history for this message
Nigel Babu (nigelbabu) wrote :

Why are we checking in .hg files?

lp:~cjohnston/summit/bzr_apps updated
137. By Nigel Babu

[r=][] Create a docs so that it shows up in rtfd.org

138. By Chris Johnston

[r=nigelbabu][] Remove translation tags, summit is not translated.

139. By Nigel Babu

[r=mhall119] Reset the theme of the documentation to default.

140. By Chris Johnston

Updating trunk from 1.x

141. By Chris Johnston

[r=nigelbabu] Adds a link to the page for editing an etherpad

Revision history for this message
Chris Johnston (cjohnston) wrote :

We aren't.. That's bzrignore

Revision history for this message
Chris Johnston (cjohnston) wrote :

We don't need it though now that we use a current version of south.

Revision history for this message
Nigel Babu (nigelbabu) wrote :

11 +summit/.hgignore
12 +summit/.hgtags

Those are hg dotfiles. If we don't need them, remove and update the MP.

review: Needs Fixing
Revision history for this message
Chris Johnston (cjohnston) :
review: Needs Resubmitting
lp:~cjohnston/summit/bzr_apps updated
142. By Chris Johnston

Removes conflicts

Revision history for this message
Nigel Babu (nigelbabu) wrote :

When, I do ./manage.py init-summit, I get

You will need to run ./manage.py init-summit to make Summit fully work.
You will need to run ./manage.py init-summit to make Summit fully work.

I think we shouldn't show this if you're actually calling the init-summit command.

Revision history for this message
Chris Johnston (cjohnston) wrote :

LoCo Directory has done the same thing for a year.. I filed a bug against it. https://bugs.launchpad.net/loco-directory/+bug/722224

Revision history for this message
Nigel Babu (nigelbabu) wrote :

Ok, approve.

review: Approve
Revision history for this message
Nigel Babu (nigelbabu) wrote :

Could you also add a summit task to that bug?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2011-05-15 01:11:24 +0000
3+++ .bzrignore 2011-08-12 14:28:26 +0000
4@@ -4,9 +4,5 @@
5 summit/summit.db
6 summit/ubuntu_website
7 summit/linaro_website
8-summit/docs
9-summit/south
10-summit/.hgignore
11-summit/.hg_archival.txt
12-summit/.hgtags
13-summit/setup.py
14+bzr_apps
15+summit/media/js/twidenash
16
17=== modified file 'summit/media/css/twidenash.css'
18--- summit/media/css/twidenash.css 2010-08-30 14:30:29 +0000
19+++ summit/media/css/twidenash.css 2011-08-12 14:28:26 +0000
20@@ -1,20 +1,38 @@
21-ul.twidenash li {
22- list-style-type: none;
23- clear: both;
24- padding: 3px;
25- font-size: 100%;
26-}
27-ul.twidenash li img {
28- float: left;
29- vertical-align: top;
30- padding-right: 10px;
31-}
32-ul.twidenash li .comment {
33- margin-left: 5px;
34- display: block;
35-}
36-
37-ul.twidenash li .nick {
38- font-weight: bold;
39+/*
40+ * twidenash.css
41+ *
42+ * twidenash CSS stuff.
43+ *
44+ * Author: Michael Hall ( mhall119 )
45+ */
46+
47+
48+.twidenash li {
49+ list-style-type: none;
50+ clear: both;
51+ padding: 3px;
52+ font-size: 0.75em;
53+}
54+
55+.twidenash li img {
56+ float: left;
57+ vertical-align: top;
58+ padding-right: 10px;
59+ margin-top: 3px;
60+}
61+
62+.twidenash li .comment {
63+ margin-left: 5px;
64+ display: block;
65+ overflow: auto;
66+}
67+
68+.twidenash li .nick {
69+ font-weight: bold;
70+}
71+
72+.twidenash li .time {
73+ font-size: 0.75em;
74+ color: #555;
75 }
76
77
78=== added directory 'summit/media/jquery'
79=== added directory 'summit/media/jquery-ui'
80=== added directory 'summit/media/js'
81=== removed file 'summit/media/twidenash.js'
82--- summit/media/twidenash.js 2010-08-30 14:30:29 +0000
83+++ summit/media/twidenash.js 1970-01-01 00:00:00 +0000
84@@ -1,122 +0,0 @@
85-/*
86-*
87-* Copyright (c) 2010 Stuart Langridge
88-*
89-* Permission is hereby granted, free of charge, to any person obtaining a copy
90-* of this software and associated documentation files (the "Software"), to deal
91-* in the Software without restriction, including without limitation the rights
92-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
93-* copies of the Software, and to permit persons to whom the Software is
94-* furnished to do so, subject to the following conditions:
95-*
96-* The above copyright notice and this permission notice shall be included in
97-* all copies or substantial portions of the Software.
98-*
99-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
100-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
101-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
102-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
103-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
104-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
105-* THE SOFTWARE.
106-*
107-* Website: http://code.google.com/p/twidenash/
108-*/
109-
110-/*
111-* With modification by Michael Hall for use in loco.ubuntu.com
112-*/
113-
114-twidenash = {
115- init: function() {
116- if (!twidenash.hashtag) return;
117- // request hashtag search values for both twitter and identica
118- twidenash.callbacks = 0;
119- twidenash.items = [];
120- twidenash.add_script("http://locoteams.status.net/api/search.json?" +
121- "callback=twidenash.cb&rpp=10&q=%23" + twidenash.hashtag);
122- twidenash.add_script("http://identi.ca/api/search.json?" +
123- "callback=twidenash.cb&rpp=10&q=%23" + twidenash.hashtag);
124- twidenash.add_script("http://search.twitter.com/search.json?" +
125- "callback=twidenash.cb&rpp=10&q=%23" + twidenash.hashtag);
126- twidenash.printed = 0;
127- },
128- add_script: function(url) {
129- var scr = document.createElement("script");
130- scr.src = url;
131- document.getElementsByTagName("head")[0].appendChild(scr);
132- },
133- cb: function(data) {
134- for (var i=0; i<data.results.length; i++) {
135- var dupe = false;
136- for (var j=0; j<twidenash.items.length; j++) {
137- // Strip characters that may be specific to networks
138- var comp1 = data.results[i].text.replace(/[♺\!\#\@]/g, '');
139- var comp2 = twidenash.items[j].text.replace(/[♺\!\#\@]/g, '');
140- var compdate = Date.parse(data.results[i].created_at);
141- var datediff = Math.abs(Date.parse(data.results[i].created_at) - twidenash.items[j].dt)
142- if (comp1 == comp2 && datediff < 120000) {
143- dupe = true;
144- break;
145- }
146- }
147- if (dupe) continue;
148- twidenash.items.push({ text: data.results[i].text,
149- img: data.results[i].profile_image_url,
150- dt: Date.parse(data.results[i].created_at),
151- user: data.results[i].from_user })
152- }
153- twidenash.callbacks += 1;
154- if (twidenash.callbacks == 2) {
155- twidenash.items.sort(function(a,b) { return b.dt - a.dt });
156- var ul = document.createElement("ul");
157- ul.className = "twidenash";
158- for (i=0; i<twidenash.items.length && twidenash.printed < 5; i++) {
159- var li = document.createElement("li");
160- var img = document.createElement("img");
161- img.src = twidenash.items[i].img;
162- img.width = 48;
163- var span = document.createElement("span");
164- span.className = 'comment';
165- var nick = document.createElement("span");
166- nick.className = 'nick';
167- nick.appendChild(document.createTextNode(twidenash.items[i].user +
168- ": "));
169- var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi;
170- span.innerHTML = twidenash.items[i].text.replace(exp,"<a href='$1' target='_blank'>$1</a>");
171- li.appendChild(img);
172- li.appendChild(nick);
173- li.appendChild(span);
174- ul.appendChild(li);
175- twidenash.printed++;
176- }
177- twidenash.scriptelement.parentNode.insertBefore(ul, twidenash.scriptelement);
178- }
179- },
180- cache_scriptname: function() {
181- // called before page load so we can find our own name
182- var scr = document.getElementsByTagName("script");
183- var url = scr[scr.length-1].getAttribute("src");
184- if (!url) {
185- var twidenash_script = document.getElementById("twidenash_script");
186- if (twidenash_script) url = twidenash_script.getAttribute("src");
187- }
188- if (url && url.lastIndexOf('?') != -1) {
189- twidenash.hashtag = url.substr(url.lastIndexOf('?')+1);
190- if (twidenash_script) {
191- twidenash.scriptelement = twidenash_script;
192- } else {
193- twidenash.scriptelement = scr[scr.length-1];
194- }
195- }
196- }
197-};
198-(function(i) {var u =navigator.userAgent;var e=/*@cc_on!@*/false; var st =
199-setTimeout;if(/webkit/i.test(u)){st(function(){var dr=document.readyState;
200-if(dr=="loaded"||dr=="complete"){i()}else{st(arguments.callee,10);}},10);}
201-else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
202-document.addEventListener("DOMContentLoaded",i,false); } else if(e){ (
203-function(){var t=document.createElement('doc:rdy');try{t.doScroll('left');
204-i();t=null;}catch(e){st(arguments.callee,0);}})();}else{window.onload=i;}})(twidenash.init);
205-twidenash.cache_scriptname();
206-
207
208=== added file 'summit/schedule/management/commands/init-summit.py'
209--- summit/schedule/management/commands/init-summit.py 1970-01-01 00:00:00 +0000
210+++ summit/schedule/management/commands/init-summit.py 2011-08-12 14:28:26 +0000
211@@ -0,0 +1,28 @@
212+#!/usr/bin/python
213+
214+from django.core.management.base import NoArgsCommand
215+from django.contrib.auth.models import Group
216+
217+import settings
218+
219+import subprocess
220+import sys
221+import os
222+
223+class Command(NoArgsCommand):
224+ help = "Make sure Summit is set up properly."
225+
226+ def handle_noargs(self, **options):
227+ path = settings.PROJECT_PATH
228+
229+ print " * Adding Bzr Apps:",
230+ if os.path.isdir(os.path.join(path, "bzr_apps", ".bzr")):
231+ print "not necessary."
232+ else:
233+ subprocess.call(["bzr", "branch", "-q", "--use-existing-dir",
234+ "lp:ubuntu-django-foundations/bzr-apps",
235+ "bzr_apps"])
236+ print "added."
237+
238+ print " * Pulling Bzr Apps:",
239+ subprocess.call(["./manage.py", "pullapps"])
240
241=== modified file 'summit/schedule/templates/schedule/index.html'
242--- summit/schedule/templates/schedule/index.html 2011-07-19 01:57:02 +0000
243+++ summit/schedule/templates/schedule/index.html 2011-08-12 14:28:26 +0000
244@@ -1,7 +1,17 @@
245 {% extends "base.html" %}
246 {% load datetime %}
247 {% load i18n %}
248-
249+{% block extrahead %}{{block.super}}
250+ <script type="text/javascript" src="{{MEDIA_URL}}jquery/jquery.js"></script>
251+ <script type="text/javascript" src="{{MEDIA_URL}}js/twidenash/jquery-twidenash.js"></script>
252+ <script type="text/javascript">
253+ //<![CDATA[
254+ $(function() {
255+ $('.twidenash').twidenash();
256+ });
257+ //]]>
258+ </script>
259+{% endblock %}
260 {% block sub_nav %}{% endblock %}
261 {% block content %}
262 <article class="minor-content">
263@@ -16,6 +26,6 @@
264 </article>
265 <article class="minor-content alone">
266 <h2>Microblogging #UDS</h2>
267- <p><script src="/media/twidenash.js?uds"></script></p>
268+ <div class="twidenash" id="uds"></div>
269 </article>
270 {% endblock %}
271
272=== modified file 'summit/settings.py'
273--- summit/settings.py 2011-06-16 18:12:32 +0000
274+++ summit/settings.py 2011-08-12 14:28:26 +0000
275@@ -19,7 +19,14 @@
276 import os
277 import sys
278
279-THIS_DIR = os.path.dirname(__file__)
280+try:
281+ import ubuntu_website
282+ uw_import = True
283+except ImportError:
284+ print "You will need to run ./manage.py init-summit to make Summit fully work."
285+ uw_import = False
286+
287+PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
288
289 DEBUG = False
290 TEMPLATE_DEBUG = DEBUG
291@@ -64,7 +71,7 @@
292
293 # Absolute path to the directory that holds media.
294 # Example: "/home/media/media.lawrence.com/"
295-MEDIA_ROOT = os.path.join(THIS_DIR, 'media')
296+MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
297
298 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
299 # trailing slash if there is a path component (optional in other cases).
300@@ -113,11 +120,10 @@
301 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
302 # Always use forward slashes, even on Windows.
303 # Don't forget to use absolute paths, not relative paths.
304- os.path.join(THIS_DIR, 'templates'),
305+ os.path.join(PROJECT_PATH, 'templates'),
306 )
307
308-try:
309- import ubuntu_website
310+if uw_import:
311 TEMPLATE_CONTEXT_PROCESSORS += (
312 "ubuntu_website.media_processor",
313 "ubuntu_website.popup_check",
314@@ -125,10 +131,10 @@
315 TEMPLATE_DIRS += (
316 ubuntu_website.TEMPLATE_DIR,
317 )
318-except ImportError:
319- print "You will need to include lp:ubuntu-community-webthemes/light-django-theme into ./ubuntu_website for the theme to fully work."
320+#except ImportError:
321+# print "You will need to include lp:ubuntu-community-webthemes/light-django-theme into ./ubuntu_website for the theme to fully work."
322
323-INSTALLED_APPS = (
324+INSTALLED_APPS = [
325 'django.contrib.auth',
326 'django.contrib.contenttypes',
327 'django.contrib.sessions',
328@@ -137,7 +143,7 @@
329 'summit.schedule',
330 'summit.sponsor',
331 'south',
332-)
333+]
334
335 AUTHENTICATION_BACKENDS = (
336 'django_openid_auth.auth.OpenIDBackend',
337@@ -162,7 +168,7 @@
338 LOGIN_URL = '/openid/login'
339 LOGIN_REDIRECT_URL = '/'
340
341-LAUNCHPAD_CACHE = os.path.join(THIS_DIR, 'lp-cache')
342+LAUNCHPAD_CACHE = os.path.join(PROJECT_PATH, 'lp-cache')
343
344 CACHE_BACKEND = 'locmem:///'
345
346@@ -170,6 +176,24 @@
347 # could include a port and prefix if required
348 ETHERPAD_HOST = 'http://pad.ubuntu.com/'
349
350+# Manage apps from bzr branches
351+try:
352+ import bzr_apps
353+ INSTALLED_APPS.append('bzr_apps')
354+except:
355+ pass
356+
357+BZR_APPS = {
358+ ## ubuntu-django-foundations app management
359+ 'bzr_apps': ('bzr+ssh://bazaar.launchpad.net/%2Bbranch/ubuntu-django-foundations/bzr-apps/', '3'),
360+
361+ ## ubuntu-website supplied templates and styles
362+ 'ubuntu_website': ('bzr+ssh://bazaar.launchpad.net/~ubuntu-community-webthemes/ubuntu-community-webthemes/light-django-theme', '35'),
363+
364+ ## twidenash supplied microblog embedding javascript
365+ 'media/js/twidenash': ('bzr+ssh://bazaar.launchpad.net/~django-foundations-dev/twidenash/2.0/', '3'),
366+}
367+
368 import logging
369 try:
370 from local_settings import *
371
372=== modified file 'summit/urls.py'
373--- summit/urls.py 2011-07-22 01:34:00 +0000
374+++ summit/urls.py 2011-08-12 14:28:26 +0000
375@@ -16,6 +16,7 @@
376
377 from django.conf.urls.defaults import *
378 from django.conf import settings
379+import ubuntu_website
380
381 from django.contrib import admin
382 admin.autodiscover()
383@@ -72,7 +73,6 @@
384 )
385
386 if settings.DEBUG or settings.SERVE_STATIC:
387- import ubuntu_website
388 urlpatterns += patterns('',
389 (r'^media/(?P<path>.*)$', 'django.views.static.serve',
390 {'document_root': settings.MEDIA_ROOT}),

Subscribers

People subscribed via source and target branches