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
=== modified file '.bzrignore'
--- .bzrignore 2011-05-15 01:11:24 +0000
+++ .bzrignore 2011-08-12 14:28:26 +0000
@@ -4,9 +4,5 @@
4summit/summit.db4summit/summit.db
5summit/ubuntu_website5summit/ubuntu_website
6summit/linaro_website6summit/linaro_website
7summit/docs7bzr_apps
8summit/south8summit/media/js/twidenash
9summit/.hgignore
10summit/.hg_archival.txt
11summit/.hgtags
12summit/setup.py
139
=== modified file 'summit/media/css/twidenash.css'
--- summit/media/css/twidenash.css 2010-08-30 14:30:29 +0000
+++ summit/media/css/twidenash.css 2011-08-12 14:28:26 +0000
@@ -1,20 +1,38 @@
1ul.twidenash li {1/*
2 list-style-type: none;2 * twidenash.css
3 clear: both;3 *
4 padding: 3px;4 * twidenash CSS stuff.
5 font-size: 100%;5 *
6}6 * Author: Michael Hall ( mhall119 )
7ul.twidenash li img {7 */
8 float: left;8
9 vertical-align: top;9
10 padding-right: 10px;10.twidenash li {
11}11 list-style-type: none;
12ul.twidenash li .comment {12 clear: both;
13 margin-left: 5px;13 padding: 3px;
14 display: block;14 font-size: 0.75em;
15}15}
1616
17ul.twidenash li .nick {17.twidenash li img {
18 font-weight: bold;18 float: left;
19 vertical-align: top;
20 padding-right: 10px;
21 margin-top: 3px;
22}
23
24.twidenash li .comment {
25 margin-left: 5px;
26 display: block;
27 overflow: auto;
28}
29
30.twidenash li .nick {
31 font-weight: bold;
32}
33
34.twidenash li .time {
35 font-size: 0.75em;
36 color: #555;
19}37}
2038
2139
=== added directory 'summit/media/jquery'
=== added directory 'summit/media/jquery-ui'
=== added directory 'summit/media/js'
=== removed file 'summit/media/twidenash.js'
--- summit/media/twidenash.js 2010-08-30 14:30:29 +0000
+++ summit/media/twidenash.js 1970-01-01 00:00:00 +0000
@@ -1,122 +0,0 @@
1/*
2*
3* Copyright (c) 2010 Stuart Langridge
4*
5* Permission is hereby granted, free of charge, to any person obtaining a copy
6* of this software and associated documentation files (the "Software"), to deal
7* in the Software without restriction, including without limitation the rights
8* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9* copies of the Software, and to permit persons to whom the Software is
10* furnished to do so, subject to the following conditions:
11*
12* The above copyright notice and this permission notice shall be included in
13* all copies or substantial portions of the Software.
14*
15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21* THE SOFTWARE.
22*
23* Website: http://code.google.com/p/twidenash/
24*/
25
26/*
27* With modification by Michael Hall for use in loco.ubuntu.com
28*/
29
30twidenash = {
31 init: function() {
32 if (!twidenash.hashtag) return;
33 // request hashtag search values for both twitter and identica
34 twidenash.callbacks = 0;
35 twidenash.items = [];
36 twidenash.add_script("http://locoteams.status.net/api/search.json?" +
37 "callback=twidenash.cb&rpp=10&q=%23" + twidenash.hashtag);
38 twidenash.add_script("http://identi.ca/api/search.json?" +
39 "callback=twidenash.cb&rpp=10&q=%23" + twidenash.hashtag);
40 twidenash.add_script("http://search.twitter.com/search.json?" +
41 "callback=twidenash.cb&rpp=10&q=%23" + twidenash.hashtag);
42 twidenash.printed = 0;
43 },
44 add_script: function(url) {
45 var scr = document.createElement("script");
46 scr.src = url;
47 document.getElementsByTagName("head")[0].appendChild(scr);
48 },
49 cb: function(data) {
50 for (var i=0; i<data.results.length; i++) {
51 var dupe = false;
52 for (var j=0; j<twidenash.items.length; j++) {
53 // Strip characters that may be specific to networks
54 var comp1 = data.results[i].text.replace(/[♺\!\#\@]/g, '');
55 var comp2 = twidenash.items[j].text.replace(/[♺\!\#\@]/g, '');
56 var compdate = Date.parse(data.results[i].created_at);
57 var datediff = Math.abs(Date.parse(data.results[i].created_at) - twidenash.items[j].dt)
58 if (comp1 == comp2 && datediff < 120000) {
59 dupe = true;
60 break;
61 }
62 }
63 if (dupe) continue;
64 twidenash.items.push({ text: data.results[i].text,
65 img: data.results[i].profile_image_url,
66 dt: Date.parse(data.results[i].created_at),
67 user: data.results[i].from_user })
68 }
69 twidenash.callbacks += 1;
70 if (twidenash.callbacks == 2) {
71 twidenash.items.sort(function(a,b) { return b.dt - a.dt });
72 var ul = document.createElement("ul");
73 ul.className = "twidenash";
74 for (i=0; i<twidenash.items.length && twidenash.printed < 5; i++) {
75 var li = document.createElement("li");
76 var img = document.createElement("img");
77 img.src = twidenash.items[i].img;
78 img.width = 48;
79 var span = document.createElement("span");
80 span.className = 'comment';
81 var nick = document.createElement("span");
82 nick.className = 'nick';
83 nick.appendChild(document.createTextNode(twidenash.items[i].user +
84 ": "));
85 var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi;
86 span.innerHTML = twidenash.items[i].text.replace(exp,"<a href='$1' target='_blank'>$1</a>");
87 li.appendChild(img);
88 li.appendChild(nick);
89 li.appendChild(span);
90 ul.appendChild(li);
91 twidenash.printed++;
92 }
93 twidenash.scriptelement.parentNode.insertBefore(ul, twidenash.scriptelement);
94 }
95 },
96 cache_scriptname: function() {
97 // called before page load so we can find our own name
98 var scr = document.getElementsByTagName("script");
99 var url = scr[scr.length-1].getAttribute("src");
100 if (!url) {
101 var twidenash_script = document.getElementById("twidenash_script");
102 if (twidenash_script) url = twidenash_script.getAttribute("src");
103 }
104 if (url && url.lastIndexOf('?') != -1) {
105 twidenash.hashtag = url.substr(url.lastIndexOf('?')+1);
106 if (twidenash_script) {
107 twidenash.scriptelement = twidenash_script;
108 } else {
109 twidenash.scriptelement = scr[scr.length-1];
110 }
111 }
112 }
113};
114(function(i) {var u =navigator.userAgent;var e=/*@cc_on!@*/false; var st =
115setTimeout;if(/webkit/i.test(u)){st(function(){var dr=document.readyState;
116if(dr=="loaded"||dr=="complete"){i()}else{st(arguments.callee,10);}},10);}
117else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
118document.addEventListener("DOMContentLoaded",i,false); } else if(e){ (
119function(){var t=document.createElement('doc:rdy');try{t.doScroll('left');
120i();t=null;}catch(e){st(arguments.callee,0);}})();}else{window.onload=i;}})(twidenash.init);
121twidenash.cache_scriptname();
122
1230
=== added file 'summit/schedule/management/commands/init-summit.py'
--- summit/schedule/management/commands/init-summit.py 1970-01-01 00:00:00 +0000
+++ summit/schedule/management/commands/init-summit.py 2011-08-12 14:28:26 +0000
@@ -0,0 +1,28 @@
1#!/usr/bin/python
2
3from django.core.management.base import NoArgsCommand
4from django.contrib.auth.models import Group
5
6import settings
7
8import subprocess
9import sys
10import os
11
12class Command(NoArgsCommand):
13 help = "Make sure Summit is set up properly."
14
15 def handle_noargs(self, **options):
16 path = settings.PROJECT_PATH
17
18 print " * Adding Bzr Apps:",
19 if os.path.isdir(os.path.join(path, "bzr_apps", ".bzr")):
20 print "not necessary."
21 else:
22 subprocess.call(["bzr", "branch", "-q", "--use-existing-dir",
23 "lp:ubuntu-django-foundations/bzr-apps",
24 "bzr_apps"])
25 print "added."
26
27 print " * Pulling Bzr Apps:",
28 subprocess.call(["./manage.py", "pullapps"])
029
=== modified file 'summit/schedule/templates/schedule/index.html'
--- summit/schedule/templates/schedule/index.html 2011-07-19 01:57:02 +0000
+++ summit/schedule/templates/schedule/index.html 2011-08-12 14:28:26 +0000
@@ -1,7 +1,17 @@
1{% extends "base.html" %}1{% extends "base.html" %}
2{% load datetime %}2{% load datetime %}
3{% load i18n %}3{% load i18n %}
44{% block extrahead %}{{block.super}}
5 <script type="text/javascript" src="{{MEDIA_URL}}jquery/jquery.js"></script>
6 <script type="text/javascript" src="{{MEDIA_URL}}js/twidenash/jquery-twidenash.js"></script>
7 <script type="text/javascript">
8 //<![CDATA[
9 $(function() {
10 $('.twidenash').twidenash();
11 });
12 //]]>
13 </script>
14{% endblock %}
5{% block sub_nav %}{% endblock %}15{% block sub_nav %}{% endblock %}
6{% block content %}16{% block content %}
7<article class="minor-content">17<article class="minor-content">
@@ -16,6 +26,6 @@
16</article>26</article>
17<article class="minor-content alone">27<article class="minor-content alone">
18 <h2>Microblogging #UDS</h2>28 <h2>Microblogging #UDS</h2>
19 <p><script src="/media/twidenash.js?uds"></script></p>29 <div class="twidenash" id="uds"></div>
20</article>30</article>
21{% endblock %}31{% endblock %}
2232
=== modified file 'summit/settings.py'
--- summit/settings.py 2011-06-16 18:12:32 +0000
+++ summit/settings.py 2011-08-12 14:28:26 +0000
@@ -19,7 +19,14 @@
19import os19import os
20import sys20import sys
2121
22THIS_DIR = os.path.dirname(__file__)22try:
23 import ubuntu_website
24 uw_import = True
25except ImportError:
26 print "You will need to run ./manage.py init-summit to make Summit fully work."
27 uw_import = False
28
29PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
2330
24DEBUG = False31DEBUG = False
25TEMPLATE_DEBUG = DEBUG32TEMPLATE_DEBUG = DEBUG
@@ -64,7 +71,7 @@
6471
65# Absolute path to the directory that holds media.72# Absolute path to the directory that holds media.
66# Example: "/home/media/media.lawrence.com/"73# Example: "/home/media/media.lawrence.com/"
67MEDIA_ROOT = os.path.join(THIS_DIR, 'media')74MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
6875
69# URL that handles the media served from MEDIA_ROOT. Make sure to use a76# URL that handles the media served from MEDIA_ROOT. Make sure to use a
70# trailing slash if there is a path component (optional in other cases).77# trailing slash if there is a path component (optional in other cases).
@@ -113,11 +120,10 @@
113 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".120 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
114 # Always use forward slashes, even on Windows.121 # Always use forward slashes, even on Windows.
115 # Don't forget to use absolute paths, not relative paths.122 # Don't forget to use absolute paths, not relative paths.
116 os.path.join(THIS_DIR, 'templates'),123 os.path.join(PROJECT_PATH, 'templates'),
117)124)
118125
119try:126if uw_import:
120 import ubuntu_website
121 TEMPLATE_CONTEXT_PROCESSORS += (127 TEMPLATE_CONTEXT_PROCESSORS += (
122 "ubuntu_website.media_processor",128 "ubuntu_website.media_processor",
123 "ubuntu_website.popup_check",129 "ubuntu_website.popup_check",
@@ -125,10 +131,10 @@
125 TEMPLATE_DIRS += (131 TEMPLATE_DIRS += (
126 ubuntu_website.TEMPLATE_DIR,132 ubuntu_website.TEMPLATE_DIR,
127 )133 )
128except ImportError:134#except ImportError:
129 print "You will need to include lp:ubuntu-community-webthemes/light-django-theme into ./ubuntu_website for the theme to fully work."135# print "You will need to include lp:ubuntu-community-webthemes/light-django-theme into ./ubuntu_website for the theme to fully work."
130136
131INSTALLED_APPS = (137INSTALLED_APPS = [
132 'django.contrib.auth',138 'django.contrib.auth',
133 'django.contrib.contenttypes',139 'django.contrib.contenttypes',
134 'django.contrib.sessions',140 'django.contrib.sessions',
@@ -137,7 +143,7 @@
137 'summit.schedule',143 'summit.schedule',
138 'summit.sponsor',144 'summit.sponsor',
139 'south',145 'south',
140)146]
141147
142AUTHENTICATION_BACKENDS = (148AUTHENTICATION_BACKENDS = (
143 'django_openid_auth.auth.OpenIDBackend',149 'django_openid_auth.auth.OpenIDBackend',
@@ -162,7 +168,7 @@
162LOGIN_URL = '/openid/login'168LOGIN_URL = '/openid/login'
163LOGIN_REDIRECT_URL = '/'169LOGIN_REDIRECT_URL = '/'
164170
165LAUNCHPAD_CACHE = os.path.join(THIS_DIR, 'lp-cache')171LAUNCHPAD_CACHE = os.path.join(PROJECT_PATH, 'lp-cache')
166172
167CACHE_BACKEND = 'locmem:///'173CACHE_BACKEND = 'locmem:///'
168174
@@ -170,6 +176,24 @@
170# could include a port and prefix if required176# could include a port and prefix if required
171ETHERPAD_HOST = 'http://pad.ubuntu.com/'177ETHERPAD_HOST = 'http://pad.ubuntu.com/'
172178
179# Manage apps from bzr branches
180try:
181 import bzr_apps
182 INSTALLED_APPS.append('bzr_apps')
183except:
184 pass
185
186BZR_APPS = {
187 ## ubuntu-django-foundations app management
188 'bzr_apps': ('bzr+ssh://bazaar.launchpad.net/%2Bbranch/ubuntu-django-foundations/bzr-apps/', '3'),
189
190 ## ubuntu-website supplied templates and styles
191 'ubuntu_website': ('bzr+ssh://bazaar.launchpad.net/~ubuntu-community-webthemes/ubuntu-community-webthemes/light-django-theme', '35'),
192
193 ## twidenash supplied microblog embedding javascript
194 'media/js/twidenash': ('bzr+ssh://bazaar.launchpad.net/~django-foundations-dev/twidenash/2.0/', '3'),
195}
196
173import logging197import logging
174try:198try:
175 from local_settings import *199 from local_settings import *
176200
=== modified file 'summit/urls.py'
--- summit/urls.py 2011-07-22 01:34:00 +0000
+++ summit/urls.py 2011-08-12 14:28:26 +0000
@@ -16,6 +16,7 @@
1616
17from django.conf.urls.defaults import *17from django.conf.urls.defaults import *
18from django.conf import settings18from django.conf import settings
19import ubuntu_website
1920
20from django.contrib import admin21from django.contrib import admin
21admin.autodiscover()22admin.autodiscover()
@@ -72,7 +73,6 @@
72)73)
7374
74if settings.DEBUG or settings.SERVE_STATIC:75if settings.DEBUG or settings.SERVE_STATIC:
75 import ubuntu_website
76 urlpatterns += patterns('',76 urlpatterns += patterns('',
77 (r'^media/(?P<path>.*)$', 'django.views.static.serve',77 (r'^media/(?P<path>.*)$', 'django.views.static.serve',
78 {'document_root': settings.MEDIA_ROOT}),78 {'document_root': settings.MEDIA_ROOT}),

Subscribers

People subscribed via source and target branches