Merge lp:~mhall119/loco-team-portal/bzr-apps-upgrades into lp:loco-team-portal

Proposed by Michael Hall
Status: Merged
Approved by: Chris Johnston
Approved revision: 427
Merged at revision: 426
Proposed branch: lp:~mhall119/loco-team-portal/bzr-apps-upgrades
Merge into: lp:loco-team-portal
Diff against target: 361 lines (+55/-159)
8 files modified
loco_directory/media/css/twidenash.css (+6/-6)
loco_directory/media/js/twidenash.js (+0/-140)
loco_directory/settings.py (+20/-2)
loco_directory/teams/management/commands/init-ld.py (+8/-5)
loco_directory/templates/events/global_event_detail.html (+2/-0)
loco_directory/templates/events/global_event_detail.inc.html (+1/-1)
loco_directory/templates/index.html (+9/-1)
loco_directory/templates/teams/team_detail.html (+9/-4)
To merge this branch: bzr merge lp:~mhall119/loco-team-portal/bzr-apps-upgrades
Reviewer Review Type Date Requested Status
Chris Johnston Approve
Review via email: mp+54010@code.launchpad.net

Description of the change

Use bzr_apps to get and manage the latest light-django-theme and twidenash

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

bzr-apps version bump

426. By Michael Hall

Version bump for twidenash

427. By Michael Hall

Solves the case of the missing </script>

Revision history for this message
Ronnie (ronnie.vd.c) wrote :

Change the twidenash script to rev3 (which contains a twitter fix) then ill approve

Revision history for this message
Chris Johnston (cjohnston) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'loco_directory/media/css/twidenash.css'
--- loco_directory/media/css/twidenash.css 2010-09-28 17:21:02 +0000
+++ loco_directory/media/css/twidenash.css 2011-03-18 22:26:31 +0000
@@ -7,30 +7,30 @@
7 */7 */
88
99
10ul.twidenash li {10.twidenash li {
11 list-style-type: none;11 list-style-type: none;
12 clear: both;12 clear: both;
13 padding: 3px;13 padding: 3px;
14 font-size: 100%;14 font-size: 0.75em;
15}15}
1616
17ul.twidenash li img {17.twidenash li img {
18 float: left;18 float: left;
19 vertical-align: top;19 vertical-align: top;
20 padding-right: 10px;20 padding-right: 10px;
21}21}
2222
23ul.twidenash li .comment {23.twidenash li .comment {
24 margin-left: 5px;24 margin-left: 5px;
25 display: block;25 display: block;
26 overflow: auto;26 overflow: auto;
27}27}
2828
29ul.twidenash li .nick {29.twidenash li .nick {
30 font-weight: bold;30 font-weight: bold;
31}31}
3232
33ul.twidenash li .time {33.twidenash li .time {
34 font-size: 0.75em;34 font-size: 0.75em;
35 color: #555;35 color: #555;
36}36}
3737
=== removed file 'loco_directory/media/js/twidenash.js'
--- loco_directory/media/js/twidenash.js 2010-09-28 17:21:02 +0000
+++ loco_directory/media/js/twidenash.js 1970-01-01 00:00:00 +0000
@@ -1,140 +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 relative_to = (arguments.length > 1) ? arguments[1] : new Date();
80 var delta = parseInt((relative_to.getTime() - twidenash.items[i].dt) / 1000);
81 var pluralize = function (singular, n) {
82 return '' + n + ' ' + singular + (n == 1 ? '' : 's');
83 };
84 if(delta < 60) {
85 date_msg = 'less than a minute ago ';
86 } else if(delta < (45*60)) {
87 date_msg = 'about ' + pluralize("minute", parseInt(delta / 60)) + ' ago ';
88 } else if(delta < (24*60*60)) {
89 date_msg = 'about ' + pluralize("hour", parseInt(delta / 3600)) + ' ago ';
90 } else {
91 date_msg = 'about ' + pluralize("day", parseInt(delta / 86400)) + ' ago ';
92 }
93 var span = document.createElement("span");
94 span.className = 'comment';
95 var nick = document.createElement("span");
96 nick.className = 'nick';
97 nick.appendChild(document.createTextNode(twidenash.items[i].user));
98 var time = document.createElement("span");
99 time.className = 'time';
100 time.appendChild(document.createTextNode(" ( "+ date_msg +" ) "));
101
102 var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi;
103 span.innerHTML = twidenash.items[i].text.replace(exp,"<a href='$1' target='_blank'>$1</a>");
104 li.appendChild(img);
105 li.appendChild(nick);
106 li.appendChild(time);
107 li.appendChild(span);
108 ul.appendChild(li);
109 twidenash.printed++;
110 }
111 twidenash.scriptelement.parentNode.insertBefore(ul, twidenash.scriptelement);
112 }
113 },
114 cache_scriptname: function() {
115 // called before page load so we can find our own name
116 var scr = document.getElementsByTagName("script");
117 var url = scr[scr.length-1].getAttribute("src");
118 if (!url) {
119 var twidenash_script = document.getElementById("twidenash_script");
120 if (twidenash_script) url = twidenash_script.getAttribute("src");
121 }
122 if (url && url.lastIndexOf('?') != -1) {
123 twidenash.hashtag = url.substr(url.lastIndexOf('?')+1);
124 if (twidenash_script) {
125 twidenash.scriptelement = twidenash_script;
126 } else {
127 twidenash.scriptelement = scr[scr.length-1];
128 }
129 }
130 }
131};
132(function(i) {var u =navigator.userAgent;var e=/*@cc_on!@*/false; var st =
133setTimeout;if(/webkit/i.test(u)){st(function(){var dr=document.readyState;
134if(dr=="loaded"||dr=="complete"){i()}else{st(arguments.callee,10);}},10);}
135else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
136document.addEventListener("DOMContentLoaded",i,false); } else if(e){ (
137function(){var t=document.createElement('doc:rdy');try{t.doScroll('left');
138i();t=null;}catch(e){st(arguments.callee,0);}})();}else{window.onload=i;}})(twidenash.init);
139twidenash.cache_scriptname();
140
1410
=== modified file 'loco_directory/settings.py'
--- loco_directory/settings.py 2010-12-07 21:42:01 +0000
+++ loco_directory/settings.py 2011-03-18 22:26:31 +0000
@@ -113,7 +113,7 @@
113 ubuntu_website.TEMPLATE_DIR,113 ubuntu_website.TEMPLATE_DIR,
114 )114 )
115115
116INSTALLED_APPS = (116INSTALLED_APPS = [
117 'django.contrib.auth',117 'django.contrib.auth',
118 'django.contrib.contenttypes',118 'django.contrib.contenttypes',
119 'django.contrib.sessions',119 'django.contrib.sessions',
@@ -126,7 +126,7 @@
126 'userprofiles',126 'userprofiles',
127 'django_openid_auth',127 'django_openid_auth',
128 'south',128 'south',
129)129]
130130
131AUTHENTICATION_BACKENDS = (131AUTHENTICATION_BACKENDS = (
132 'django_openid_auth.auth.OpenIDBackend',132 'django_openid_auth.auth.OpenIDBackend',
@@ -159,6 +159,24 @@
159159
160FLICKR_API_KEY = '8c969a1e8a49629bb89b411930ab1cc8'160FLICKR_API_KEY = '8c969a1e8a49629bb89b411930ab1cc8'
161161
162# Manage apps from bzr branches
163try:
164 import bzr_apps
165 INSTALLED_APPS.append('bzr_apps')
166except:
167 pass
168
169BZR_APPS = {
170 ## ubuntu-django-foundations app management
171 'bzr_apps': ('bzr+ssh://bazaar.launchpad.net/%2Bbranch/ubuntu-django-foundations/bzr-apps/', '3'),
172
173 ## ubuntu-website supplied templates and styles
174 'ubuntu_website': ('bzr+ssh://bazaar.launchpad.net/~ubuntu-community-webthemes/ubuntu-community-webthemes/light-django-theme', '32'),
175
176 ## twidenash supplied microblog embedding javascript
177 'media/js/twidenash': ('bzr+ssh://bazaar.launchpad.net/~django-foundations-dev/twidenash/2.0/', '2'),
178}
179
162import logging180import logging
163try:181try:
164 from local_settings import *182 from local_settings import *
165183
=== modified file 'loco_directory/teams/management/commands/init-ld.py'
--- loco_directory/teams/management/commands/init-ld.py 2011-03-15 13:08:01 +0000
+++ loco_directory/teams/management/commands/init-ld.py 2011-03-18 22:26:31 +0000
@@ -44,11 +44,14 @@
44 else:44 else:
45 print " * Creating jquery symlinks: not necessary."45 print " * Creating jquery symlinks: not necessary."
4646
47 print " * Adding ubuntu_website media:",47 print " * Adding Bzr Apps:",
48 if os.path.isdir(os.path.join(path, "ubuntu_website")):48 if os.path.isdir(os.path.join(path, "bzr_apps", ".bzr")):
49 print "not necessary."49 print "not necessary."
50 else:50 else:
51 subprocess.call(["bzr", "branch", "-q",51 subprocess.call(["bzr", "branch", "-q", "--use-existing-dir",
52 "lp:ubuntu-community-webthemes/light-django-theme", 52 "lp:ubuntu-django-foundations/bzr-apps",
53 "ubuntu_website"])53 "bzr_apps"])
54 print "added."54 print "added."
55
56 print " * Pulling Bzr Apps:",
57 subprocess.call(["./manage.py", "pullapps"])
5558
=== modified file 'loco_directory/templates/events/global_event_detail.html'
--- loco_directory/templates/events/global_event_detail.html 2011-02-17 20:05:03 +0000
+++ loco_directory/templates/events/global_event_detail.html 2011-03-18 22:26:31 +0000
@@ -6,9 +6,11 @@
6 <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language={% trans 'en' %}&region={% trans 'US' %}"></script>6 <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language={% trans 'en' %}&region={% trans 'US' %}"></script>
7 <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/src/markerclusterer_packed.js"></script>7 <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/src/markerclusterer_packed.js"></script>
8 <script type="text/javascript" src="{{MEDIA_URL}}js/jquery-ubuntu-maps.js"></script>8 <script type="text/javascript" src="{{MEDIA_URL}}js/jquery-ubuntu-maps.js"></script>
9 <script type="text/javascript" src="{{MEDIA_URL}}js/twidenash/jquery-twidenash.js"></script>
9 <script type="text/javascript"> 10 <script type="text/javascript">
10 //<![CDATA[11 //<![CDATA[
11 $(function(){12 $(function(){
13 $('.twidenash').twidenash();
12 $('#venue-map').showLocations({markers_url:'{% url global-event-locations global_event_id=global_event_object.id %}',14 $('#venue-map').showLocations({markers_url:'{% url global-event-locations global_event_id=global_event_object.id %}',
13 marker_icon: '{{ MEDIA_URL }}/img/marker.png'});15 marker_icon: '{{ MEDIA_URL }}/img/marker.png'});
14 });16 });
1517
=== modified file 'loco_directory/templates/events/global_event_detail.inc.html'
--- loco_directory/templates/events/global_event_detail.inc.html 2011-02-17 20:05:03 +0000
+++ loco_directory/templates/events/global_event_detail.inc.html 2011-03-18 22:26:31 +0000
@@ -100,7 +100,7 @@
100{% if global_event_object.microbloghashtag %}100{% if global_event_object.microbloghashtag %}
101 <article class="minor-content alone">101 <article class="minor-content alone">
102 <h2>{% trans "Microblogging" %} #{{global_event_object.microbloghashtag}}</h2>102 <h2>{% trans "Microblogging" %} #{{global_event_object.microbloghashtag}}</h2>
103 <p><script src="{{MEDIA_URL}}js/twidenash.js?{{global_event_object.microbloghashtag}}"></script></p>103 <div class="twidenash" id="{{ global_event_object.microbloghashtag }}"></div>
104 </article>104 </article>
105{% endif %}105{% endif %}
106106
107107
=== modified file 'loco_directory/templates/index.html'
--- loco_directory/templates/index.html 2011-02-18 03:16:32 +0000
+++ loco_directory/templates/index.html 2011-03-18 22:26:31 +0000
@@ -9,6 +9,14 @@
9{% block extrahead %}{{block.super}}9{% block extrahead %}{{block.super}}
10 <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/css/twidenash.css" />10 <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/css/twidenash.css" />
11 <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/css/continents.css" />11 <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/css/continents.css" />
12 <script type="text/javascript" src="{{MEDIA_URL}}js/twidenash/jquery-twidenash.js"></script>
13 <script type="text/javascript">
14 //<![CDATA[
15 $(function() {
16 $('.twidenash').twidenash();
17 });
18 //]]>
19 </script>
12{% endblock %}20{% endblock %}
1321
14{% block content %}22{% block content %}
@@ -79,7 +87,7 @@
7987
80<article class="minor-content alone">88<article class="minor-content alone">
81 <h2>{% trans "Microblogging" %} #locoteams</h2>89 <h2>{% trans "Microblogging" %} #locoteams</h2>
82 <p><script src="{{MEDIA_URL}}js/twidenash.js?locoteams"></script></p>90 <div class="twidenash" id="locoteams"></div>
83</article>91</article>
8492
85{% endblock %}93{% endblock %}
8694
=== modified file 'loco_directory/templates/teams/team_detail.html'
--- loco_directory/templates/teams/team_detail.html 2011-03-02 22:34:34 +0000
+++ loco_directory/templates/teams/team_detail.html 2011-03-18 22:26:31 +0000
@@ -14,16 +14,21 @@
1414
1515
16{% block extrahead %}{{ block.super }}16{% block extrahead %}{{ block.super }}
17<link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/css/twidenash.css" />
18{% if team.flickr_id or team.picasa_id or team.pixie_id %}17{% if team.flickr_id or team.picasa_id or team.pixie_id %}
19<script type="text/javascript" src="{{MEDIA_URL}}jquery/jquery.js"></script>18<script type="text/javascript" src="{{MEDIA_URL}}jquery/jquery.js"></script>
20<script type="text/javascript" src="{{MEDIA_URL}}js/jquery.lightbox-0.5.min.js"></script>19<script type="text/javascript" src="{{MEDIA_URL}}js/jquery.lightbox-0.5.min.js"></script>
21<link rel="stylesheet" href="{{MEDIA_URL}}css/jquery.lightbox-0.5.css" type="text/css" media="screen" />20<link rel="stylesheet" href="{{MEDIA_URL}}css/jquery.lightbox-0.5.css" type="text/css" media="screen" />
22<script type="text/javascript" src="{{MEDIA_URL}}js/jquery-flickr.js"></script>21<script type="text/javascript" src="{{MEDIA_URL}}js/jquery-flickr.js"></script>
22{% endif %}
23
24<link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/css/twidenash.css" />
25<script type="text/javascript" src="{{MEDIA_URL}}js/twidenash/jquery-twidenash.js"></script>
23<script type="text/javascript"> 26<script type="text/javascript">
24$(function() {27$(function() {
25 var perPage = '16';28 var perPage = '16';
26{% endif %}29 $('.twidenash').twidenash();
30
31
27{% if team.flickr_id %}32{% if team.flickr_id %}
28 $('#flickr').flickr({ key: "{{ flickr_api_key }}", id: "{{ team.flickr_id }}", amount: perPage });33 $('#flickr').flickr({ key: "{{ flickr_api_key }}", id: "{{ team.flickr_id }}", amount: perPage });
29{% endif %}34{% endif %}
@@ -65,10 +70,10 @@
65 $("a.lightbox").lightBox();70 $("a.lightbox").lightBox();
66 });71 });
67{% endif %}72{% endif %}
68{% if team.flickr_id or team.picasa_id or team.pixie_id %}
69});73});
7074
71</script>75</script>
76{% if team.flickr_id or team.picasa_id or team.pixie_id %}
72<style type="text/css"> 77<style type="text/css">
73div#flickr a.lightbox img {78div#flickr a.lightbox img {
74 border: 5px solid #b3aaa4;79 border: 5px solid #b3aaa4;
@@ -208,7 +213,7 @@
208{% if team.microbloghashtag %}213{% if team.microbloghashtag %}
209<article class="minor-content alone">214<article class="minor-content alone">
210 <h2>{% trans "Microblogging" %} #{{team.microbloghashtag}}</h2>215 <h2>{% trans "Microblogging" %} #{{team.microbloghashtag}}</h2>
211 <p><script src="{{MEDIA_URL}}js/twidenash.js?{{team.microbloghashtag}}"></script></p>216 <div class="twidenash" id="{{ team.microbloghashtag }}"></div>
212</article>217</article>
213{% endif %}218{% endif %}
214219

Subscribers

People subscribed via source and target branches