Merge lp:~daker/loco-team-portal/fix.579833 into lp:loco-team-portal

Proposed by Adnane Belmadiaf
Status: Merged
Approved by: Michael Hall
Approved revision: 268
Merged at revision: 271
Proposed branch: lp:~daker/loco-team-portal/fix.579833
Merge into: lp:loco-team-portal
Diff against target: 371 lines (+279/-1)
8 files modified
loco_directory/common/context_processors.py (+11/-0)
loco_directory/media/css/jquery.lightbox-0.5.css (+101/-0)
loco_directory/media/js/jquery.lightbox-0.5.min.js (+42/-0)
loco_directory/settings.py (+4/-0)
loco_directory/teams/migrations/0008_flickr_account.py (+67/-0)
loco_directory/teams/models.py (+2/-0)
loco_directory/templates/base.html (+1/-1)
loco_directory/templates/teams/team_detail.html (+51/-0)
To merge this branch: bzr merge lp:~daker/loco-team-portal/fix.579833
Reviewer Review Type Date Requested Status
Michael Hall (community) Approve
Daniel Holbach (community) Needs Fixing
Adnane Belmadiaf Needs Resubmitting
Review via email: mp+33701@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Daniel Holbach (dholbach) wrote :

 - This model change requires a separate new migration script. Have a look at ./manage.py startmigration <...>
 - Can we make the api key configurable like the google api key?

Apart from that: nice work!

review: Needs Fixing
261. By Daniel Holbach

merged lp:~adnane002/loco-directory/fix.624299

262. By Daniel Holbach

merged lp:~adnane002/loco-directory/fix.622252

Revision history for this message
Adnane Belmadiaf (daker) wrote :

Oki done!!

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

I'm not sure. Do we want to use a 'public' API key? After all it's readable from the source code. Apart from that, total thumbs up!

263. By Daniel Holbach

merged lp:~yoboy-leguesh/loco-directory/bugfix-lp-624885

Revision history for this message
Adnane Belmadiaf (daker) wrote :

We need the API key to get the json dump, it will appear on the source code because the dump is rendered with the jQuery framework.

264. By Michael Hall

Add User Profiles, merge from Daniel Holbach

265. By Michael Hall

Redesign of Global Events to match Team Event redesign, merge from Chris Johnston

266. By Michael Hall

More profiles from Daniel Holbach

267. By Michael Hall

Team Details cleanup, merge from Martin Owens

Revision history for this message
Michael Hall (mhall119) wrote :

Did you manually edit loco_directory/teams/migrations/0001_initial.py ?

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

I know we need the API key, but I'd prefer if people set it 'manually' in local_settings.py (like the Google API key), so we don't share 'our' flickr key publicly (in bazaar and Launchpad). I hope I'm less confusing now. :-)

Revision history for this message
Adnane Belmadiaf (daker) wrote :

> Did you manually edit loco_directory/teams/migrations/0001_initial.py ?
The first time yes in rev 261, i have undo the changes then i have created the migration script in rev 262

> I know we need the API key, but I'd prefer if people set it 'manually' in
> local_settings.py (like the Google API key), so we don't share 'our' flickr
> key publicly (in bazaar and Launchpad). I hope I'm less confusing now. :-)

i have done this, you can set it manualy (like the Google API key) rev 262, just one thing that the API key will be shown in the source code (when the user hit "View Source" in the browser) for only one reason that the process is made on the client side.

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

Can you resolve the conflict in loco_directory/templates/teams/team_detail.html and rename loco_directory/teams/migrations/0005_flickr_account.py to loco_directory/teams/migrations/0008_flickr_account.py?

Apart from that everything should be fine.

review: Needs Fixing
268. By Adnane Belmadiaf

* Resolved conflict in templates/teams/team_detail.html
* Renamed the flickr account migration script

269. By Adnane Belmadiaf

* Changed the number of flickr photos from 25 to 27

Revision history for this message
Michael Hall (mhall119) wrote :

Looks fantastic!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'loco_directory/common/context_processors.py'
--- loco_directory/common/context_processors.py 2010-07-28 13:13:39 +0000
+++ loco_directory/common/context_processors.py 2010-09-01 16:44:42 +0000
@@ -26,6 +26,17 @@
26 google_api_key = ""26 google_api_key = ""
27 return {'google_api_key': google_api_key}27 return {'google_api_key': google_api_key}
2828
29def flickr_api_key(request):
30 """
31 Return the Flickr API Key or "" if none is defined.
32 """
33
34 try:
35 flickr_api_key = settings.FLICKR_API_KEY
36 except AttributeError:
37 flickr_api_key = ""
38 return {'flickr_api_key': flickr_api_key}
39
29def login_redirect(request):40def login_redirect(request):
30 return {'login_next': request.get_full_path()}41 return {'login_next': request.get_full_path()}
3142
3243
=== added file 'loco_directory/media/css/jquery.lightbox-0.5.css'
--- loco_directory/media/css/jquery.lightbox-0.5.css 1970-01-01 00:00:00 +0000
+++ loco_directory/media/css/jquery.lightbox-0.5.css 2010-09-01 16:44:42 +0000
@@ -0,0 +1,101 @@
1/**
2 * jQuery lightBox plugin
3 * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
4 * and adapted to me for use like a plugin from jQuery.
5 * @name jquery-lightbox-0.5.css
6 * @author Leandro Vieira Pinho - http://leandrovieira.com
7 * @version 0.5
8 * @date April 11, 2008
9 * @category jQuery plugin
10 * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
11 * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
12 * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
13 */
14#jquery-overlay {
15 position: absolute;
16 top: 0;
17 left: 0;
18 z-index: 90;
19 width: 100%;
20 opacity:.5;
21}
22#jquery-lightbox {
23 position: absolute;
24 top: 0;
25 left: 0;
26 width: 100%;
27 z-index: 100;
28 text-align: center;
29 line-height: 0;
30}
31#jquery-lightbox a img { border: none; }
32#lightbox-container-image-box {
33 position: relative;
34 background-color: #fff;
35 width: 250px;
36 height: 250px;
37 margin: 0 auto;
38}
39#lightbox-container-image { padding: 10px; }
40#lightbox-loading {
41 position: absolute;
42 top: 40%;
43 left: 0%;
44 height: 25%;
45 width: 100%;
46 text-align: center;
47 line-height: 0;
48}
49#lightbox-nav {
50 position: absolute;
51 top: 0;
52 left: 0;
53 height: 100%;
54 width: 100%;
55 z-index: 10;
56}
57#lightbox-container-image-box > #lightbox-nav { left: 0; }
58#lightbox-nav a { outline: none;}
59#lightbox-nav-btnPrev, #lightbox-nav-btnNext {
60 width: 49%;
61 height: 100%;
62 zoom: 1;
63 display: block;
64}
65#lightbox-nav-btnPrev {
66 left: 0;
67 float: left;
68}
69#lightbox-nav-btnNext {
70 right: 0;
71 float: right;
72}
73#lightbox-container-image-data-box {
74 font: 10px Verdana, Helvetica, sans-serif;
75 background-color: #fff;
76 margin: 0 auto;
77 line-height: 1.4em;
78 overflow: auto;
79 width: 100%;
80 padding: 0 10px 0;
81}
82#lightbox-container-image-data {
83 padding: 0 10px;
84 color: #666;
85}
86#lightbox-container-image-data #lightbox-image-details {
87 width: 70%;
88 float: left;
89 text-align: left;
90}
91#lightbox-image-details-caption { font-weight: bold; }
92#lightbox-image-details-currentNumber {
93 display: block;
94 clear: left;
95 padding-bottom: 1.0em;
96}
97#lightbox-secNav-btnClose {
98 width: 66px;
99 float: right;
100 padding-bottom: 0.7em;
101}
0102
=== added file 'loco_directory/media/img/lightbox-blank.gif'
1Binary files loco_directory/media/img/lightbox-blank.gif 1970-01-01 00:00:00 +0000 and loco_directory/media/img/lightbox-blank.gif 2010-09-01 16:44:42 +0000 differ103Binary files loco_directory/media/img/lightbox-blank.gif 1970-01-01 00:00:00 +0000 and loco_directory/media/img/lightbox-blank.gif 2010-09-01 16:44:42 +0000 differ
=== added file 'loco_directory/media/img/lightbox-btn-close.gif'
2Binary files loco_directory/media/img/lightbox-btn-close.gif 1970-01-01 00:00:00 +0000 and loco_directory/media/img/lightbox-btn-close.gif 2010-09-01 16:44:42 +0000 differ104Binary files loco_directory/media/img/lightbox-btn-close.gif 1970-01-01 00:00:00 +0000 and loco_directory/media/img/lightbox-btn-close.gif 2010-09-01 16:44:42 +0000 differ
=== added file 'loco_directory/media/img/lightbox-btn-next.gif'
3Binary files loco_directory/media/img/lightbox-btn-next.gif 1970-01-01 00:00:00 +0000 and loco_directory/media/img/lightbox-btn-next.gif 2010-09-01 16:44:42 +0000 differ105Binary files loco_directory/media/img/lightbox-btn-next.gif 1970-01-01 00:00:00 +0000 and loco_directory/media/img/lightbox-btn-next.gif 2010-09-01 16:44:42 +0000 differ
=== added file 'loco_directory/media/img/lightbox-btn-prev.gif'
4Binary files loco_directory/media/img/lightbox-btn-prev.gif 1970-01-01 00:00:00 +0000 and loco_directory/media/img/lightbox-btn-prev.gif 2010-09-01 16:44:42 +0000 differ106Binary files loco_directory/media/img/lightbox-btn-prev.gif 1970-01-01 00:00:00 +0000 and loco_directory/media/img/lightbox-btn-prev.gif 2010-09-01 16:44:42 +0000 differ
=== added file 'loco_directory/media/img/lightbox-ico-loading.gif'
5Binary files loco_directory/media/img/lightbox-ico-loading.gif 1970-01-01 00:00:00 +0000 and loco_directory/media/img/lightbox-ico-loading.gif 2010-09-01 16:44:42 +0000 differ107Binary files loco_directory/media/img/lightbox-ico-loading.gif 1970-01-01 00:00:00 +0000 and loco_directory/media/img/lightbox-ico-loading.gif 2010-09-01 16:44:42 +0000 differ
=== added file 'loco_directory/media/js/jquery.lightbox-0.5.min.js'
--- loco_directory/media/js/jquery.lightbox-0.5.min.js 1970-01-01 00:00:00 +0000
+++ loco_directory/media/js/jquery.lightbox-0.5.min.js 2010-09-01 16:44:42 +0000
@@ -0,0 +1,42 @@
1/**
2 * jQuery lightBox plugin
3 * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
4 * and adapted to me for use like a plugin from jQuery.
5 * @name jquery-lightbox-0.5.js
6 * @author Leandro Vieira Pinho - http://leandrovieira.com
7 * @version 0.5
8 * @date April 11, 2008
9 * @category jQuery plugin
10 * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
11 * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
12 * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
13 */
14(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'/media/img/lightbox-ico-loading.gif',imageBtnPrev:'/media/img/lightbox-btn-prev.gif',imageBtnNext:'/media/img/lightbox-btn-next.gif',imageBtnClose:'/media/img/lightbox-btn-close.gif',imageBlank:'/media/img/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;}
15function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i<jQueryMatchedObj.length;i++){settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));}}
16while(settings.imageArray[settings.activeImage][0]!=objClicked.getAttribute('href')){settings.activeImage++;}
17_set_image_to_view();}
18function _set_interface(){$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+settings.imageLoading+'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'+settings.imageBtnClose+'"></a></div></div></div></div>');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});}
19function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}
20var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}}
21$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();}
22if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}}
23function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}}
24if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}}
25_enable_keyboard_navigation();}
26function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});}
27function _disable_keyboard_navigation(){$(document).unbind();}
28function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;}
29key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();}
30if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}}
31if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}}
32function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];}
33if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}}
34function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});}
35function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
36var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
37windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
38if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
39if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
40arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};function ___getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
41arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll;};function ___pause(ms){var date=new Date();curDate=null;do{var curDate=new Date();}
42while(curDate-date<ms);};return this.unbind('click').click(_initialize);};})(jQuery);
043
=== modified file 'loco_directory/settings.py'
--- loco_directory/settings.py 2010-08-23 08:35:14 +0000
+++ loco_directory/settings.py 2010-09-01 16:44:42 +0000
@@ -84,6 +84,7 @@
84 "django.core.context_processors.media",84 "django.core.context_processors.media",
85 "common.context_processors.loco_version",85 "common.context_processors.loco_version",
86 "common.context_processors.google_api_key",86 "common.context_processors.google_api_key",
87 "common.context_processors.flickr_api_key",
87 "common.context_processors.login_redirect",88 "common.context_processors.login_redirect",
88 "common.context_processors.url_base",89 "common.context_processors.url_base",
89)90)
@@ -148,6 +149,9 @@
148LOGIN_URL = '/openid/login'149LOGIN_URL = '/openid/login'
149LOGIN_REDIRECT_URL = '/'150LOGIN_REDIRECT_URL = '/'
150151
152
153FLICKR_API_KEY = '8c969a1e8a49629bb89b411930ab1cc8'
154
151import logging155import logging
152try:156try:
153 from local_settings import *157 from local_settings import *
154158
=== added file 'loco_directory/teams/migrations/0008_flickr_account.py'
--- loco_directory/teams/migrations/0008_flickr_account.py 1970-01-01 00:00:00 +0000
+++ loco_directory/teams/migrations/0008_flickr_account.py 2010-09-01 16:44:42 +0000
@@ -0,0 +1,67 @@
1
2from south.db import db
3from django.db import models
4from teams.models import *
5
6class Migration:
7
8 def forwards(self, orm):
9
10 # Adding field 'Team.flickr_id'
11 db.add_column('teams', 'flickr_id', orm['teams.team:flickr_id'])
12
13
14
15 def backwards(self, orm):
16
17 # Deleting field 'Team.flickr_id'
18 db.delete_column('teams', 'flickr_id')
19
20
21
22 models = {
23 'teams.continent': {
24 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
25 'name': ('django.db.models.fields.TextField', [], {'max_length': '50'})
26 },
27 'teams.country': {
28 'continents': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Continent']"}),
29 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
30 'name': ('django.db.models.fields.TextField', [], {'max_length': '100'})
31 },
32 'teams.language': {
33 'code': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True'}),
34 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
35 'name': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True'})
36 },
37 'teams.team': {
38 'Meta': {'db_table': "'teams'"},
39 'admins': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.TeamAdministrator']"}),
40 'approved': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
41 'approved_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
42 'city': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
43 'countries': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Country']"}),
44 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
45 'expires_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
46 'flickr_id': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
47 'forum_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
48 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
49 'irc_chan': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}),
50 'languages': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['teams.Language']"}),
51 'lp_name': ('django.db.models.fields.SlugField', [], {'max_length': '40', 'null': 'True', 'db_index': 'True'}),
52 'ml_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
53 'mugshot_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
54 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True'}),
55 'owner': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'null': 'True', 'db_index': 'True'}),
56 'provides_support': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
57 'spr': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
58 'web_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
59 'wiki_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
60 },
61 'teams.teamadministrator': {
62 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
63 'lpid': ('django.db.models.fields.SlugField', [], {'max_length': '40', 'db_index': 'True'})
64 }
65 }
66
67 complete_apps = ['teams']
068
=== modified file 'loco_directory/teams/models.py'
--- loco_directory/teams/models.py 2010-08-18 15:29:01 +0000
+++ loco_directory/teams/models.py 2010-09-01 16:44:42 +0000
@@ -85,6 +85,8 @@
85 contact_profiles = models.ManyToManyField(UserProfile, related_name='contacts')85 contact_profiles = models.ManyToManyField(UserProfile, related_name='contacts')
86 mugshot_url = models.URLField(_("URL of mugshot"), verify_exists=False, null=True, blank=True)86 mugshot_url = models.URLField(_("URL of mugshot"), verify_exists=False, null=True, blank=True)
87 languages = models.ManyToManyField(Language)87 languages = models.ManyToManyField(Language)
88 flickr_id = models.CharField(_("Flickr User ID"), max_length=20, null=True, blank=True,
89 help_text=_("To get your Flickr user id go to http://idgettr.com. Ex. 47353004@N03"))
88 90
89 objects = TeamManager()91 objects = TeamManager()
90 92
9193
=== modified file 'loco_directory/templates/base.html'
--- loco_directory/templates/base.html 2010-08-26 00:00:52 +0000
+++ loco_directory/templates/base.html 2010-09-01 16:44:42 +0000
@@ -14,7 +14,7 @@
14 <a class="main-nav-item {% ifequal url_base 'events' %}current{% endifequal %}" title="{% trans "Show All Events" %}" href="{% url event-list %}">{% trans "Events" %}</a>14 <a class="main-nav-item {% ifequal url_base 'events' %}current{% endifequal %}" title="{% trans "Show All Events" %}" href="{% url event-list %}">{% trans "Events" %}</a>
15 <a class="main-nav-item {% ifequal url_base 'loco-council' %}current{% endifequal %}" title="{% trans "LoCo Council" %}" href="{% url loco_council %}">{% trans "LoCo Council" %}</a>15 <a class="main-nav-item {% ifequal url_base 'loco-council' %}current{% endifequal %}" title="{% trans "LoCo Council" %}" href="{% url loco_council %}">{% trans "LoCo Council" %}</a>
16 <a class="main-nav-item {% ifequal url_base 'about-loco' %}current{% endifequal %}" title="{% trans "About LoCo Teams" %}" href="{% url about_loco %}">{% trans "About LoCos" %}</a></li>16 <a class="main-nav-item {% ifequal url_base 'about-loco' %}current{% endifequal %}" title="{% trans "About LoCo Teams" %}" href="{% url about_loco %}">{% trans "About LoCos" %}</a></li>
17 <a class="main-nav-item {% ifequal url_base 'irc_chat' %}current{% endifequal %}" title="{% trans "IRC Chat" %}" href="{% url irc_chat %}">{% trans "IRC Chat" %}</a></li>17 <a class="main-nav-item {% ifequal url_base 'irc' %}current{% endifequal %}" title="{% trans "IRC Chat" %}" href="{% url irc_chat %}">{% trans "IRC Chat" %}</a></li>
18 {% if user.is_authenticated %}18 {% if user.is_authenticated %}
19 <a class="main-nav-item" href="/logout" title="{% trans "Log Out" %}: {{ user.username }}">{% trans "Log Out" %}</a>19 <a class="main-nav-item" href="/logout" title="{% trans "Log Out" %}: {{ user.username }}">{% trans "Log Out" %}</a>
20 {% else %}20 {% else %}
2121
=== modified file 'loco_directory/templates/teams/team_detail.html'
--- loco_directory/templates/teams/team_detail.html 2010-08-28 18:06:01 +0000
+++ loco_directory/templates/teams/team_detail.html 2010-09-01 16:44:42 +0000
@@ -13,6 +13,48 @@
13{% block search %}{% endblock %}13{% block search %}{% endblock %}
1414
15{% block extrahead %}15{% block extrahead %}
16{% if team.flickr_id %}
17<script type="text/javascript" src="{{MEDIA_URL}}jquery/jquery.js"></script>
18<script type="text/javascript" src="{{MEDIA_URL}}js/jquery.lightbox-0.5.min.js"></script>
19<link rel="stylesheet" href="{{MEDIA_URL}}css/jquery.lightbox-0.5.css" type="text/css" media="screen" />
20<script type="text/javascript">
21$(function() {
22 var apiKey = '{{ flickr_api_key }}';
23 var userId = '{{ team.flickr_id }}';
24 var tag = '';
25 var perPage = '27';
26
27 $.getJSON('http://api.flickr.com/services/rest/?format=json&method='+
28 'flickr.photos.search&api_key=' + apiKey + '&user_id=' + userId +
29 '&tags=' + tag + '&per_page=' + perPage + '&jsoncallback=?',
30 function(data){
31 $.each(data.photos.photo, function(i, rPhoto){
32 var basePhotoURL = 'http://farm' + rPhoto.farm + '.static.flickr.com/'
33 + rPhoto.server + '/' + rPhoto.id + '_' + rPhoto.secret;
34
35 var thumbPhotoURL = basePhotoURL + '_s.jpg';
36 var mediumPhotoURL = basePhotoURL + '.jpg';
37
38 var photoStringStart = '<a class="lightbox" ';
39 var photoStringEnd = 'title="' + rPhoto.title + '" href="'+
40 mediumPhotoURL +'"><img src="' + thumbPhotoURL + '" alt="' +
41 rPhoto.title + '"/></a>;';
42 var photoString = photoStringStart + photoStringEnd
43
44 $(photoString).appendTo("#flickr");
45 });
46 $("a.lightbox").lightBox();
47 });
48});
49</script>
50<style type="text/css">
51div#flickr a.lightbox img {
52 border: 5px solid #b3aaa4;
53 margin-left: 5px;
54 margin-right: 5px;
55}
56</style>
57{% endif %}
16<link type="application/rss+xml" rel="alternate" title="{% trans "Team Events (RSS)" %}" href="{% url team-events-rss team.lp_name %}" />58<link type="application/rss+xml" rel="alternate" title="{% trans "Team Events (RSS)" %}" href="{% url team-events-rss team.lp_name %}" />
17{% endblock %}59{% endblock %}
1860
@@ -122,4 +164,13 @@
122<img id="locobranding" src="{{ team.mugshot_url }}" alt="" title="{{ team.name }}"/>164<img id="locobranding" src="{{ team.mugshot_url }}" alt="" title="{{ team.name }}"/>
123</article>165</article>
124166
167{% if team.flickr_id %}
168<article class="minor-content alone" style="width:95%;">
169<h2>Flickr Photos</a></h2>
170<div style="width:100%;" id="flickr"> </div>
171</article>
172{% endif %}
173
174
175
125{% endblock %}176{% endblock %}

Subscribers

People subscribed via source and target branches