Merge lp:~ronnie.vd.c/loco-team-portal/570613 into lp:loco-team-portal

Proposed by Ronnie
Status: Merged
Merged at revision: 393
Proposed branch: lp:~ronnie.vd.c/loco-team-portal/570613
Merge into: lp:loco-team-portal
Diff against target: 749 lines (+445/-157)
12 files modified
loco_directory/events/models.py (+3/-0)
loco_directory/events/urls.py (+1/-0)
loco_directory/events/views.py (+24/-2)
loco_directory/media/css/newstyle.css (+3/-15)
loco_directory/media/js/common.js (+0/-103)
loco_directory/media/js/jquery-ubuntu-maps.js (+373/-0)
loco_directory/templates/events/global_event_detail.html (+12/-1)
loco_directory/templates/events/global_event_detail.inc.html (+4/-1)
loco_directory/templates/venues/venue_detail.html (+3/-4)
loco_directory/templates/venues/venue_detail.inc.html (+7/-9)
loco_directory/templates/venues/venue_update.html (+12/-18)
loco_directory/venues/forms.py (+3/-4)
To merge this branch: bzr merge lp:~ronnie.vd.c/loco-team-portal/570613
Reviewer Review Type Date Requested Status
Michael Hall (community) Approve
Review via email: mp+50194@code.launchpad.net

Description of the change

Google Maps are added to the pages "global event" and "venue add/update/details". The markers cant be clicked at the moment.

To post a comment you must log in.
384. By Ronnie

Added translation tags

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

Pure awesome

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'loco_directory/events/models.py'
--- loco_directory/events/models.py 2011-01-18 20:38:55 +0000
+++ loco_directory/events/models.py 2011-02-17 17:57:17 +0000
@@ -107,6 +107,9 @@
107107
108 def random_5_attendees(self):108 def random_5_attendees(self):
109 return Attendee.objects.filter(event__id__exact=self.id).order_by('?')[5:]109 return Attendee.objects.filter(event__id__exact=self.id).order_by('?')[5:]
110
111 def has_location(self):
112 return self.filter(venue__longitude__isnull=False, venue__latitude__isnull=False)
110113
111class TeamEvent(BaseEvent):114class TeamEvent(BaseEvent):
112 """115 """
113116
=== modified file 'loco_directory/events/urls.py'
--- loco_directory/events/urls.py 2010-12-19 21:25:01 +0000
+++ loco_directory/events/urls.py 2011-02-17 17:57:17 +0000
@@ -22,6 +22,7 @@
22 url(r'^global/(?P<global_event_id>\d+)/detail/$', 'events.views.global_event_detail', name='global-event-detail'),22 url(r'^global/(?P<global_event_id>\d+)/detail/$', 'events.views.global_event_detail', name='global-event-detail'),
23 url(r'^global/(?P<global_event_id>\d+)/delete/$', 'events.views.global_event_delete', name='global-event-delete'),23 url(r'^global/(?P<global_event_id>\d+)/delete/$', 'events.views.global_event_delete', name='global-event-delete'),
24 url(r'^global/(?P<global_event_id>\d+)/update/$', 'events.views.global_event_update', name='global-event-update'),24 url(r'^global/(?P<global_event_id>\d+)/update/$', 'events.views.global_event_update', name='global-event-update'),
25 url(r'^global/(?P<global_event_id>\d+)/locations/$', 'events.views.global_event_locations', name='global-event-locations'),
25 url(r'^global/add/$', 'events.views.global_event_new', name='global-event-new'),26 url(r'^global/add/$', 'events.views.global_event_new', name='global-event-new'),
2627
27)28)
2829
=== modified file 'loco_directory/events/views.py'
--- loco_directory/events/views.py 2011-02-02 17:40:39 +0000
+++ loco_directory/events/views.py 2011-02-17 17:57:17 +0000
@@ -3,6 +3,7 @@
3from django.shortcuts import render_to_response3from django.shortcuts import render_to_response
4from django.shortcuts import get_object_or_4044from django.shortcuts import get_object_or_404
5from django.contrib.auth.decorators import login_required5from django.contrib.auth.decorators import login_required
6from django.utils import simplejson
6from django.utils.translation import ugettext as _7from django.utils.translation import ugettext as _
7from django.core.urlresolvers import reverse8from django.core.urlresolvers import reverse
89
@@ -471,5 +472,26 @@
471 return redirect( global_event_object )472 return redirect( global_event_object )
472473
473474
474475def global_event_locations(request, global_event_id):
475476 """
477 the longitude and latitude global event
478 """
479 global_event_object = get_object_or_404(GlobalEvent, pk=global_event_id)
480 locations = []
481 for event in global_event_object.teamevent_set.has_location():
482 location = {}
483 location['url'] = event.get_absolute_url()
484 location['title'] = event.name
485 # TODO: create an separate view with template for the content
486 location['content'] = '<p>Location: <a href="%s">%s</a></p><p>Start date: %s</p><p>End date: %s</p>' % (event.get_absolute_url(),
487 event.venue.name,
488 str(event.date_begin),
489 str(event.date_end))
490 location['lng'] = event.venue.longitude
491 location['lat'] = event.venue.latitude
492 locations.append(location)
493
494 json = simplejson.dumps(locations)
495
496 return HttpResponse(json)
497
476498
=== modified file 'loco_directory/media/css/newstyle.css'
--- loco_directory/media/css/newstyle.css 2011-02-03 01:43:39 +0000
+++ loco_directory/media/css/newstyle.css 2011-02-17 17:57:17 +0000
@@ -25,21 +25,9 @@
25 white-space: nowrap;25 white-space: nowrap;
26}26}
2727
28#venue-map-selector {28.minor-content.venue-map {
29 width: 400px;29 min-height: 350px;
30 height: 300px;30 margin-top: 60px;
31 border: 1px solid #ccc;
32 position: absolute;
33 right: 30px;
34 top: 40px;
35}
36#venue-map {
37 width: 400px;
38 border: 1px solid #CCC;
39 bottom: 10px;
40 float: right;
41 height: 300px;
42 margin-right: 10px;
43}31}
4432
45#main-content {33#main-content {
4634
=== added file 'loco_directory/media/img/ajax-loader.gif'
47Binary files loco_directory/media/img/ajax-loader.gif 1970-01-01 00:00:00 +0000 and loco_directory/media/img/ajax-loader.gif 2011-02-17 17:57:17 +0000 differ35Binary files loco_directory/media/img/ajax-loader.gif 1970-01-01 00:00:00 +0000 and loco_directory/media/img/ajax-loader.gif 2011-02-17 17:57:17 +0000 differ
=== added file 'loco_directory/media/img/marker.png'
48Binary files loco_directory/media/img/marker.png 1970-01-01 00:00:00 +0000 and loco_directory/media/img/marker.png 2011-02-17 17:57:17 +0000 differ36Binary files loco_directory/media/img/marker.png 1970-01-01 00:00:00 +0000 and loco_directory/media/img/marker.png 2011-02-17 17:57:17 +0000 differ
=== removed file 'loco_directory/media/js/common.js'
--- loco_directory/media/js/common.js 2010-06-09 01:36:18 +0000
+++ loco_directory/media/js/common.js 1970-01-01 00:00:00 +0000
@@ -1,103 +0,0 @@
1//Click Control to get lonlat values. trigger function set the values
2OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
3 defaultHandlerOptions: {
4 'single': true,
5 'double': false,
6 'pixelTolerance': 0,
7 'stopSingle': false,
8 'stopDouble': false
9 },
10
11 initialize: function(options) {
12 this.handlerOptions = OpenLayers.Util.extend(
13 {}, this.defaultHandlerOptions
14 );
15 OpenLayers.Control.prototype.initialize.apply(
16 this, arguments
17 );
18 this.handler = new OpenLayers.Handler.Click(
19 this, {
20 'click': this.trigger
21 }, this.handlerOptions
22 );
23 },
24
25 trigger: function(e) {
26 var lonlat = map.getLonLatFromViewPortPx(e.xy);
27 $("#id_longitude").val(lonlat.lon)
28 $("#id_latitude").val(lonlat.lat)
29 map.markers.erase();
30 //alert("You clicked near " + lonlat.lat + " N, " + lonlat.lon + " E");
31 }
32
33});
34//function to add markers to map
35function addMarker(layer, lon, lat, popupContentHTML) {
36 var ll = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
37 var feature = new OpenLayers.Feature(layer, ll);
38 feature.closeBox = true;
39 feature.popupClass = OpenLayers.Class(OpenLayers.Popup.FramedCloud, { minSize: new OpenLayers.Size(200, 100) });
40 feature.data.popupContentHTML = popupContentHTML;
41 feature.data.overflow = "hidden";
42
43 var marker = new OpenLayers.Marker(ll);
44 marker.feature = feature;
45
46 var markerClick = function(evt) {
47 if (this.popup == null) {
48 this.popup = this.createPopup(this.closeBox);
49 map.addPopup(this.popup);
50 this.popup.show();
51 } else {
52 this.popup.toggle();
53 }
54 OpenLayers.Event.stop(evt);
55 };
56 marker.events.register("mousedown", feature, markerClick);
57
58 layer.addMarker(marker);
59}
60
61//openlayers map
62var map;
63function showmap(divid, select, lon, lat, htmltext){
64 map = new OpenLayers.Map(divid);
65 map.addControl(new OpenLayers.Control.LayerSwitcher());
66 var gphy = new OpenLayers.Layer.Google(
67 "Google Physical",
68 {type: G_PHYSICAL_MAP}
69 );
70 var gmap = new OpenLayers.Layer.Google(
71 "Google Streets", // the default
72 {numZoomLevels: 20}
73 );
74 var ghyb = new OpenLayers.Layer.Google(
75 "Google Hybrid",
76 {type: G_HYBRID_MAP, numZoomLevels: 20}
77 );
78 var gsat = new OpenLayers.Layer.Google(
79 "Google Satellite",
80 {type: G_SATELLITE_MAP, numZoomLevels: 22}
81 );
82 var markers = new OpenLayers.Layer.Markers("Markers Layer");
83
84 map.addLayers([gphy, ghyb, gsat, markers]);
85 if (lon === undefined && lat === undefined) {
86 map.setCenter(new OpenLayers.LonLat(0, 0), 0);
87 } else {
88 for (i=0;i<lon.length;i++) {
89 addMarker(markers, lon[i], lat[i], htmltext[i]);
90 }
91 var lonLat = new OpenLayers.LonLat(lon[0], lat[0]).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
92 map.setCenter (lonLat, 6);
93 }
94 //map.zoomToMaxExtent();
95 if (select) {
96 var click = new OpenLayers.Control.Click();
97 map.addControl(click);
98 click.activate();
99 }
100
101
102}
103
1040
=== added file 'loco_directory/media/js/jquery-ubuntu-maps.js'
--- loco_directory/media/js/jquery-ubuntu-maps.js 1970-01-01 00:00:00 +0000
+++ loco_directory/media/js/jquery-ubuntu-maps.js 2011-02-17 17:57:17 +0000
@@ -0,0 +1,373 @@
1/*
2 * jQuery Google Map Plugin 0.2.3
3 * https://wiki.ubuntu.com/ubuntu-django-foundations/map
4 * Requires jQuery 1.4.2
5 *
6 * Copyright 2011, Ronnie van den Crommenacker
7 * Dual licensed under the MIT or GPL Version 2 licenses.
8 * http://jquery.org/license
9 */
10
11(function ($) {
12 $.fn.extend({
13 showLocations: function (options) {
14 var defaults = {
15 markers_url: null, // http://link/to/json/markers or /link/to/json/markers
16 markers_list: null, // [ {lat: 0.345, lng: 0.3456}, {lat: 44.345, lng: 34.3456} ]
17 position_name: {
18 lat: 'lat', // { lat: 0.4567, lng: 0.2345 }
19 lng: 'lng' // { lat: 0.4567, lng: 0.2345 }
20 },
21 marker_content_url: null, // The url to load when clicked on a marker
22 marker_content_tmpl: null, // The template to load when clicked on a marker
23 mapOptions: {
24 zoom: 2,
25 center: new google.maps.LatLng(22, 12),
26 mapTypeId: google.maps.MapTypeId.ROADMAP,
27 mapTypeControl: false
28 },
29 user_location_zoom: 7, // use null to disable this feature
30 single_marker_zoom: 7, // the zoomlevel. use null to disable
31 ajax_load_error: '<p>The page could not be loaded</p>',
32 ajax_load_icon: '/ubuntu-website/media/images/ajax-loader.gif',
33 marker_icon: null,
34 cluster_tmpl: null,
35 filter: null, //[ { element: $('...'), attrs: { attr: value }}, { element: $('...'), attrs: { attr: value }} ]
36 mcOptions: { gridSize: 40, maxZoom: 10, zoomOnClick: false//, styles: [
37 //{ url: 'images/supportCluster1.png', height: 48, width: 48, opt_anchor: [16, 0], opt_textColor: '#ffffff', opt_textSize: 10 }, /* 2-9 members */
38 //{ url: 'images/supportCluster2.png', height: 64, width: 64, opt_anchor: [24, 0], opt_textColor: '#ffffff', opt_textSize: 11 }, /* 10-99 members */
39 //{ url: 'images/supportCluster3.png', height: 96, width: 96, opt_anchor: [32, 0], opt_textColor: '#ffffff', opt_textSize: 12 }, /* 100-999 members */
40 //{ url: 'images/supportCluster4.png', height: 128, width: 128, opt_anchor: [32, 0], opt_textColor: '#ffffff', opt_textSize: 12 } /* 1000+ members */
41 //]
42 }
43 },
44 // Add the window where the details are shown when clicked on a marker
45 infowindow = new google.maps.InfoWindow();
46
47 options = $.extend(defaults, options);
48
49 // TODO: rewrite this one
50 function getAjaxLoader() {
51 var ajaximg = $('<img src="' + options.ajax_load_icon + '" />')
52 .attr({'style': 'display:inline-block;vertical-align:middle;margin-right:10px;'}),
53 ajaxtxt = $('<p>')
54 .attr({'style': 'display:inline-block;vertical-align:middle;'})
55 .html('Retrieving data<br />from server...'),
56 wrapper = $('<div>')
57 .attr({'style': 'margin:auto;width:130px;'});
58 return wrapper.append(ajaximg).append(ajaxtxt)[0];
59 }
60
61 infowindow.show = function (html, pos) {
62 this.setContent(html);
63 this.setPosition(pos);
64 this.open(this.map);
65 };
66 infowindow.ajaxloader = null;
67 infowindow.showLoader = function (pos) {
68 // Set a temporary loader while the data is retreved from the server
69 if (this.ajaxloader === null) {
70 // TODO: allow user defined ajax loader
71 this.ajaxloader = getAjaxLoader();
72 }
73 this.show(this.ajaxloader, pos);
74 };
75 infowindow.showTemplate = function (url, data, pos) {
76 var $data = data,
77 $pos = pos,
78 ifw = this;
79
80 if (!$.tmpl) {
81 alert('jQuery.tmpl is not installed\nYou can download here:\nhttp://github.com/jquery/jquery-tmpl');
82 return false;
83 }
84
85 this.showLoader(pos);
86 $.ajax({
87 url: url,
88 dataType: 'html',
89 success: function (template) {
90 ifw.show($(template).tmpl($data)[0], $pos);
91 },
92 error: function () {
93 ifw.show(options.ajax_load_error, $pos);
94 }
95 });
96 };
97 infowindow.showHTML = function (url, pos) {
98 var $pos = pos,
99 ifw = this;
100
101 this.showLoader(pos);
102 //TODO: Check for better same-origin in url
103 if (url.slice(0, 4) == 'http'){
104 ifw.show($('<iframe>').attr('src', url)[0], $pos);
105 } else {
106 $.ajax({
107 url: url,
108 dataType: 'html',
109 success: function (html) {
110 ifw.show(html, $pos);
111 },
112 error: function () {
113 ifw.show(options.ajax_load_error, $pos);
114 }
115 });
116 }
117 };
118
119 // Constructs an url with ${...} together with data to a normal url
120 function constructUrl(url, marker) {
121 var pattern = /\$\{[\w\d]+\}/g, // match pattern for ${....}
122 url_match = url.match(pattern), // Matches the url for ${...} and returns a list of matches
123 param = null, // Used for getting a specific param from the marker
124 tag = null; // The tags in the match pattern
125
126 for (tag in url_match) {
127 if (url_match.hasOwnProperty(tag)) {
128 param = url_match[tag];
129 url = url.replace(param, marker[param.slice(2, param.length - 1)]);
130 }
131 }
132 return url;
133 }
134
135 // Function executed when clicked on a cluster object
136 function clusterClicked(cluster) {
137 if (options.cluster_tmpl) {
138 infowindow.showTemplate(options.cluster_tmpl, {marker_list: cluster[0].markers_}, cluster[0].getCenter());
139 }
140 }
141
142 // Function that is executed when user clicks on a marker
143 function markerClicked() {
144 var url = null;
145
146 if (options.marker_content_url) {
147 url = constructUrl(options.marker_content_url, this);
148 infowindow.showHTML(url, this.position);
149 } else if (options.marker_content_tmpl) {
150 infowindow.showTemplate(options.marker_content_tmpl, {marker: this}, this.position);
151 }
152 }
153
154 // Create from json data the google.maps.Marker and add them to the markercluster (mc)
155 // Then center the map if there is only one cluster and options.single_marker_zoom is true
156 function createMarkers(map, mc, markers) {
157 var marker_list = [], // A list of gmakers
158 marker = null, // The json of a marker
159 gmarker = null, // The actual google.maps.Marker() type
160 idx = null, // Index
161 lat = options.position_name.lat, // The parameter that contains the latitude
162 lng = options.position_name.lng; // The parameter that contains the longitude
163
164 if (markers[0].fields) {
165 // Django model
166 // Use django pk and fields parameters
167 for (idx in markers) {
168 if (markers.hasOwnProperty(idx)) {
169 marker = markers[idx].fields;
170 marker.pk = markers[idx].pk;
171 marker.position = new google.maps.LatLng(marker[lat], marker[lng]);
172 if (!marker.icon && options.marker_icon) {
173 marker.icon = options.marker_icon;
174 }
175 gmarker = new google.maps.Marker(marker);
176 google.maps.event.addDomListener(gmarker, 'click', markerClicked);
177 marker_list.push(gmarker);
178 }
179 }
180
181 } else {
182 // Use normal parameters
183 for (idx in markers) {
184 if (markers.hasOwnProperty(idx)) {
185 marker = markers[idx];
186 marker.position = new google.maps.LatLng(marker[lat], marker[lng]);
187 if (!markers[idx].icon && options.marker_icon) {
188 marker.icon = options.marker_icon;
189 }
190 gmarker = new google.maps.Marker(marker);
191 google.maps.event.addDomListener(gmarker, 'click', markerClicked);
192 marker_list.push(gmarker);
193 }
194 }
195 }
196 mc.addMarkers(marker_list);
197
198 // If there is only one marker
199 if (options.single_marker_zoom && marker_list.length === 1) {
200 // Make sure the map is initialized
201 // FIXME: Look for an map.init event
202 setTimeout(function () {
203 map.setCenter(mc.getMarkers()[0].getPosition());
204 map.setZoom(options.single_marker_zoom);
205 }, 100);
206 }
207 }
208
209 return $(this).each(function (i, html_element) {
210 var map = new google.maps.Map(html_element, options.mapOptions),
211 markerCluster = new MarkerClusterer(map, [], options.mcOptions),
212 filter = options.filter,
213 filterer = null,
214 index = null,
215 pos = null;
216
217 // FIXME: Manually override the zoomOnClick because of this bug
218 // http://www.devcomments.com/V3-MarkerClusterer-zoomOnClick-issue-at255452.htm
219 markerCluster.zoomOnClick_ = false;
220
221 // Attach the info window to the curernt map
222 infowindow.map = map;
223
224 // When clicked on a cluster, call the event
225 google.maps.event.addListener(markerCluster, 'clusterclick', clusterClicked);
226
227 // Try W3C Geolocation (Preferred)
228 // Ask the user for their location and set the map to it
229 if (options.user_location_zoom && navigator.geolocation) {
230 navigator.geolocation.getCurrentPosition(function (position) {
231 pos = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
232 map.setCenter(pos);
233 map.setZoom(options.user_location_zoom);
234 });
235 }
236
237 // Load the list of markers into the map
238 if (options.markers_url) {
239 $.get(options.markers_url, function (markers) {
240 createMarkers(map, markerCluster, markers);
241 }, 'json');
242 } else if (options.markers_list) {
243 createMarkers(map, markerCluster, options.markers_list);
244 }
245
246 if (filter) {
247 filterer = (function (markerCluster) {
248 var mc = markerCluster,
249 markers = mc.getMarkers();
250 return {
251 addFilter: function (filter) {
252 filter.element.click(function (event) {
253 var attrs = filter.attrs,
254 visible_markers = [],
255 m = null,
256 a = null;
257
258 event.preventDefault();
259
260 for (m in markers) {
261 if (markers.hasOwnProperty(m)) {
262 marker = markers[m];
263 for (a in attrs) {
264 if (attrs.hasOwnProperty(a)) {
265 if (marker[a] === attrs[a]) {
266 visible_markers.push(marker);
267 }
268 }
269 }
270 }
271 }
272 // If there are no filter options, show all markers
273 if (!a) {
274 visible_markers = markers;
275 }
276 mc.clearMarkers();
277 mc.addMarkers(visible_markers, false);
278 });
279 }
280 };
281 }(markerCluster));
282 for (index in filter) {
283 if (filter.hasOwnProperty(index)) {
284 filterer.addFilter(filter[index]);
285 }
286 }
287 }
288 });
289 },
290 selectLocation: function (options) {
291 var defaults = {
292 html_lng: null,
293 html_lat: null,
294 marker_icon: null,
295 markers: [],
296 html_addr: null,
297 mapOptions: {
298 zoom: 4,
299 center: new google.maps.LatLng(51.8211, 5.591),
300 mapTypeId: google.maps.MapTypeId.ROADMAP,
301 mapTypeControl: false
302 }
303 };
304 options = $.extend(defaults, options);
305
306 function showPositionHTML(location) {
307 if (options.html_lng && options.html_lat) {
308 if (location.lat() && location.lng()) {
309 options.html_lat.val(location.lat());
310 options.html_lng.val(location.lng());
311 }
312 }
313 }
314
315 function setMarker(map, location) {
316 var marker = null;
317
318 if (options.markers.length) {
319 marker = options.markers[0];
320 marker.setPosition(location);
321 marker.setAnimation(google.maps.Animation.DROP);
322 } else {
323 marker = new google.maps.Marker({
324 map: map,
325 position: location,
326 draggable: true,
327 animation: google.maps.Animation.DROP
328 });
329 if (options.marker_icon) {
330 marker.icon = options.marker_icon;
331 }
332 options.markers.push(marker);
333 google.maps.event.addListener(options.markers[0], 'mouseup', function () {
334 showPositionHTML(marker.getPosition());
335 });
336 }
337
338 map.setCenter(location);
339 showPositionHTML(marker.getPosition());
340 }
341
342 return $(this).each(function (i, html_element) {
343 var map = new google.maps.Map($(html_element)[0], options.mapOptions),
344 geoCoder = new google.maps.Geocoder(),
345 location = null;
346
347 if (options.html_addr) {
348 options.html_addr.change(function () {
349 var address = [];
350 options.html_addr.each(function (i, item) {
351 address.push(item.value);
352 });
353
354 geoCoder.geocode({address: address.join(' ')}, function (results, status) {
355 if (status === google.maps.GeocoderStatus.OK) {
356 setMarker(map, results[0].geometry.location);
357 }
358 });
359 });
360 }
361 google.maps.event.addListener(map, 'click', function (event) {
362 setMarker(map, event.latLng);
363 });
364
365 if (options.html_lat.val() && options.html_lng.val()) {
366 location = new google.maps.LatLng(options.html_lat.val(), options.html_lng.val());
367 setMarker(map, location);
368 }
369 });
370
371 }
372 });
373}(jQuery));
0374
=== modified file 'loco_directory/templates/events/global_event_detail.html'
--- loco_directory/templates/events/global_event_detail.html 2010-12-19 21:25:01 +0000
+++ loco_directory/templates/events/global_event_detail.html 2011-02-17 17:57:17 +0000
@@ -1,8 +1,19 @@
1{% extends "base.html" %}1{% extends "base.html" %}
2{% load i18n %}2{% load i18n %}
33
4{% block extrahead %}{{block.super}}4{% block extrahead %}{{ block.super }}
5 <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/css/twidenash.css" />5 <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}/css/twidenash.css" />
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>
8 <script type="text/javascript" src="{{MEDIA_URL}}js/jquery-ubuntu-maps.js"></script>
9 <script type="text/javascript">
10 //<![CDATA[
11 $(function(){
12 $('#venue-map').showLocations({markers_url:'{% url global-event-locations global_event_id=global_event_object.id %}',
13 marker_icon: '{{ MEDIA_URL }}/img/marker.png'});
14 });
15 //]]>
16 </script>
6{% endblock %}17{% endblock %}
718
8{% block title %}{% trans global_event_object.name %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}19{% block title %}{% trans global_event_object.name %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}
920
=== modified file 'loco_directory/templates/events/global_event_detail.inc.html'
--- loco_directory/templates/events/global_event_detail.inc.html 2011-02-03 14:26:00 +0000
+++ loco_directory/templates/events/global_event_detail.inc.html 2011-02-17 17:57:17 +0000
@@ -1,5 +1,6 @@
1{% load i18n %}1{% load i18n %}
2{% block extrahead %}{{ block.super }}2{% block extrahead %}{{ block.super }}
3
3{% if global_event_object.pictag %}4{% if global_event_object.pictag %}
4<link rel="stylesheet" href="{{MEDIA_URL}}css/jquery.lightbox-0.5.css" type="text/css" media="screen" /> 5<link rel="stylesheet" href="{{MEDIA_URL}}css/jquery.lightbox-0.5.css" type="text/css" media="screen" />
5<script type="text/javascript" src="{{MEDIA_URL}}js/jquery.lightbox-0.5.min.js"></script>6<script type="text/javascript" src="{{MEDIA_URL}}js/jquery.lightbox-0.5.min.js"></script>
@@ -97,11 +98,13 @@
97 {% endif %}98 {% endif %}
98</article>99</article>
99100
100<article class="main-content">101<article class="minor-content">
101 <h3>{% trans "Details" %}</h3>102 <h3>{% trans "Details" %}</h3>
102 {% include "events/global_event_detail_basic.inc.html" %}103 {% include "events/global_event_detail_basic.inc.html" %}
103</article>104</article>
104105
106<section id="venue-map" class="minor-content alone venue-map"></section>
107
105<hr class="divide" />108<hr class="divide" />
106109
107{% if global_event_object.teamevent_set.all %}110{% if global_event_object.teamevent_set.all %}
108111
=== modified file 'loco_directory/templates/venues/venue_detail.html'
--- loco_directory/templates/venues/venue_detail.html 2010-11-20 17:25:50 +0000
+++ loco_directory/templates/venues/venue_detail.html 2011-02-17 17:57:17 +0000
@@ -4,10 +4,9 @@
4{% block title %}{% trans venue_object.name %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}4{% block title %}{% trans venue_object.name %} | {% trans "Ubuntu LoCo Team Directory" %} {% endblock %}
55
6{% block extrahead %}{{block.super}}6{% block extrahead %}{{block.super}}
7<script type="text/javascript" src="http://openlayers.org/api/OpenLayers.js"></script>7<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language={% trans 'en' %}&region={% trans 'US' %}"></script>
8<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key={{ google_api_key }}" type="text/javascript"></script>8<script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/src/markerclusterer_packed.js"></script>
9<script src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script>9<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery-ubuntu-maps.js"></script>
10 <script type="text/javascript" src="{{MEDIA_URL}}/js/common.js"></script>
11{% endblock %}10{% endblock %}
1211
13{% block sub_nav_links %}12{% block sub_nav_links %}
1413
=== modified file 'loco_directory/templates/venues/venue_detail.inc.html'
--- loco_directory/templates/venues/venue_detail.inc.html 2010-07-27 10:15:45 +0000
+++ loco_directory/templates/venues/venue_detail.inc.html 2011-02-17 17:57:17 +0000
@@ -4,18 +4,16 @@
4 <p>{% include "venues/venue_detail_basic.inc.html" %}</p>4 <p>{% include "venues/venue_detail_basic.inc.html" %}</p>
5</article>5</article>
66
7<article id="venue-map" class="" style="min-height: 300px; border: 0px;">
8{% if venue_object.longitude and venue_object.latitude %}7{% if venue_object.longitude and venue_object.latitude %}
8<article class="minor-content alone venue-map" id="venue-map" class="">
9</article>9</article>
10<script>10<script>
11 var lon = new Array();11 $(function(){
12 var lat = new Array();12 $('#venue-map').showLocations({
13 var htmltext = new Array();13 markers_list: [{ lat: {{ venue_object.latitude }}, lng: {{ venue_object.longitude }} }],
14 lon[0] = {{ venue_object.longitude }}14 marker_icon: '{{ MEDIA_URL }}img/marker.png'
15 lat[0] = {{ venue_object.latitude }}15 });
16 htmltext[0] = "{{ venue_object.name }}"16 });
17 var select = new Boolean(false);
18 showmap('venue-map', select, lon, lat, htmltext)
19</script>17</script>
20{% endif %}18{% endif %}
2119
2220
=== modified file 'loco_directory/templates/venues/venue_update.html'
--- loco_directory/templates/venues/venue_update.html 2010-11-20 17:25:50 +0000
+++ loco_directory/templates/venues/venue_update.html 2011-02-17 17:57:17 +0000
@@ -8,24 +8,18 @@
8{% endblock %}8{% endblock %}
99
10{% block extrafooter %}10{% block extrafooter %}
11<script type="text/javascript"><!--11<script type="text/javascript">
12 var lon = new Array();12//<![CDATA[
13 var lat = new Array();13 $(function(){
14 var htmltext = new Array();14 $('#venue-map-selector').selectLocation({html_lng: $("#id_longitude"),
15 var select = new Boolean(true);15 html_lat: $("#id_latitude"),
16 {% if venue_object %}16 html_addr: $("#id_country, #id_spr, #id_city, #id_address"),
17 lon[0] = $("#id_longitude").val()17 marker_icon: '{{ MEDIA_URL }}img/marker.png'});
18 lat[0] = $("#id_latitude").val()
19 htmltext[0] = "{{ venue_object.name }}"
20 showmap('venue-map-selector', select, lon, lat, htmltext)
21 {% else %}
22 showmap('venue-map-selector', select)
23 {% endif %}
2418
25$(document).ready(function(){19 $('span[rel*=help]').colorTip({color:'orange'});
26 $('span[rel*=help]').colorTip({color:'orange'});20 });
27});21//]]>
28--></script>22</script>
29{% endblock %}23{% endblock %}
3024
31{% block content %}25{% block content %}
@@ -42,6 +36,6 @@
42 </form>36 </form>
43</article>37</article>
4438
45<div id="venue-map-selector" title="{% trans "Select venue position" %}">&nbsp;</div>39<section class="minor-content alone venue-map" id="venue-map-selector" title="{% trans "Select venue position" %}">&nbsp;</section>
4640
47{% endblock %}41{% endblock %}
4842
=== modified file 'loco_directory/venues/forms.py'
--- loco_directory/venues/forms.py 2010-11-27 02:45:34 +0000
+++ loco_directory/venues/forms.py 2011-02-17 17:57:17 +0000
@@ -29,10 +29,9 @@
29 '/media/css/colortip-1.0-jquery.css', 29 '/media/css/colortip-1.0-jquery.css',
30 )}30 )}
31 js = (31 js = (
32 'http://openlayers.org/api/OpenLayers.js',32 'http://maps.google.com/maps/api/js?sensor=false&language=%(language)s&region=%(region)s' % {'language': _('en'), 'region': _('US')},
33 'http://maps.google.com/maps?file=api&amp;v=2&amp;key='+google_api_key ,33 'http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/src/markerclusterer_packed.js',
34 'http://www.openstreetmap.org/openlayers/OpenStreetMap.js',34 '/media/js/jquery-ubuntu-maps.js',
35 '/media/js/common.js',
36 '/media/js/colortip-1.0-jquery.js',35 '/media/js/colortip-1.0-jquery.js',
37 )36 )
3837

Subscribers

People subscribed via source and target branches