Merge lp://staging/~doctormo/loco-team-portal/bugfix-lp-499465 into lp://staging/loco-team-portal

Proposed by Martin Owens
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~doctormo/loco-team-portal/bugfix-lp-499465
Merge into: lp://staging/loco-team-portal
Diff against target: 128 lines (+45/-14)
5 files modified
loco_directory/media/css/style.css (+8/-0)
loco_directory/media/css/venues.css (+1/-0)
loco_directory/templates/base.html (+16/-1)
loco_directory/templates/venues/venue_detail.inc.html (+0/-1)
loco_directory/templates/venues/venue_detail_basic.inc.html (+20/-12)
To merge this branch: bzr merge lp://staging/~doctormo/loco-team-portal/bugfix-lp-499465
Reviewer Review Type Date Requested Status
LoCo Team Portal Developers Pending
Review via email: mp+19587@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Owens (doctormo) wrote :

Add in a Google API based venue map. Also modifies a few of the styles to make things fit nice.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/media/css/style.css'
2--- loco_directory/media/css/style.css 2009-12-21 11:03:49 +0000
3+++ loco_directory/media/css/style.css 2010-02-18 10:34:14 +0000
4@@ -10,3 +10,11 @@
5 margin: 0;
6 }
7
8+div.map {
9+ width: 300px;
10+ height: 300px;
11+ border: 1px solid gray;
12+ position: absolute;
13+ top: 40px;
14+ right: 25px;
15+}
16
17=== modified file 'loco_directory/media/css/venues.css'
18--- loco_directory/media/css/venues.css 2010-01-11 08:31:03 +0000
19+++ loco_directory/media/css/venues.css 2010-02-18 10:34:14 +0000
20@@ -21,6 +21,7 @@
21 #venue {
22 border: 0px #888 outset;
23 height: 100%;
24+ min-height: 350px;
25 margin-left: 70px;
26 margin-right: 70px;
27 margin-top: 50px;
28
29=== modified file 'loco_directory/templates/base.html'
30--- loco_directory/templates/base.html 2010-02-15 17:01:55 +0000
31+++ loco_directory/templates/base.html 2010-02-18 10:34:14 +0000
32@@ -9,7 +9,22 @@
33 <style type="text/css" media="all">@import "/media/css/style.css";</style>
34 <link rel="stylesheet" href="/media/css/teams.css" type="text/css" media="screen" />
35 <link rel="stylesheet" href="/media/css/events.css" type="text/css" media="screen" />
36- <link rel="stylesheet" href="/media/css/venues.css" type="text/css" media="screen" />
37+ <link rel="stylesheet" href="/media/css/venues.css" type="text/css" media="screen" />
38+ <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type="text/javascript"></script>
39+ <script type="text/javascript">
40+
41+ function showmap(Lo, La, Content) {
42+ if (GBrowserIsCompatible()) {
43+ var map = new GMap2(document.getElementById("map_canvas"));
44+ var center = new GLatLng(Lo, La)
45+ map.setCenter(center, 13);
46+ var marker = new GMarker(center)
47+ map.addOverlay(marker)
48+ GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(Content);})
49+ }
50+ }
51+
52+ </script>
53 {% block extrahead %}{% endblock %}
54 </head>
55
56
57=== modified file 'loco_directory/templates/venues/venue_detail.inc.html'
58--- loco_directory/templates/venues/venue_detail.inc.html 2010-01-11 08:31:03 +0000
59+++ loco_directory/templates/venues/venue_detail.inc.html 2010-02-18 10:34:14 +0000
60@@ -19,6 +19,5 @@
61 <h2>{{venue_object.name}}</h2>
62 {% include "venues/venue_detail_basic.inc.html" %}
63
64-
65 </div>
66 </div>
67
68=== modified file 'loco_directory/templates/venues/venue_detail_basic.inc.html'
69--- loco_directory/templates/venues/venue_detail_basic.inc.html 2010-01-11 08:31:03 +0000
70+++ loco_directory/templates/venues/venue_detail_basic.inc.html 2010-02-18 10:34:14 +0000
71@@ -7,33 +7,33 @@
72 <td>{{ venue_object.name }}</td>
73 </tr>
74 {% endif %}
75+ {% if venue_object.street %}
76+ <tr>
77+ <th scope="row"><label>{% trans "Address:" %}</label></th>
78+ <td>{{ venue_object.address }}</td>
79+ </tr>
80+ {% endif %}
81 {% if venue_object.city %}
82 <tr>
83 <th scope="row"><label>{% trans "City:" %}</label></th>
84 <td>{{ venue_object.city }}</td>
85 </tr>
86 {% endif %}
87- {% if venue_object.street %}
88- <tr>
89- <th scope="row"><label>{% trans "Address:" %}</label></th>
90- <td>{{ venue_object.address }}</td>
91- </tr>
92- {% endif %}
93- {% if venue_object.longitude and venue_object.latitude %}
94- <tr>
95- <th scope="row"><label>{% trans "Longitude/Latitude:" %}</label></th>
96- <td>{{ venue_object.longitude }} / {{ venue_object.longitude }}</td>
97+ {% if venue_object.country %}
98+ <tr>
99+ <th scope="row"><label>{% trans "Country:" %}</label></th>
100+ <td>{{ venue_object.country }}</td>
101 </tr>
102 {% endif %}
103 {% if venue_object.map_url %}
104 <tr>
105 <th scope="row"><label>{% trans "Map URL:" %}</label></th>
106- <td><a href="{{ venue_object.map_url }}">{{ venue_object.map_url }}</a></td>
107+ <td><a href="{{ venue_object.map_url }}">Load Map</a></td>
108 </tr>
109 {% endif %}
110 {% if venue_object.venue_url %}
111 <tr>
112- <th scope="row"><label>{% trans "Venue URL (Homepage):" %}</label></th>
113+ <th scope="row"><label>{% trans "Homepage:" %}</label></th>
114 <td><a href="{{ venue_object.venue_url }}">{{ venue_object.venue_url }}</a></td>
115 </tr>
116 {% endif %}
117@@ -45,3 +45,11 @@
118 {% endif %}
119 {% endif %}
120 </table>
121+
122+{% if venue_object.longitude and venue_object.latitude %}
123+<div id="map_canvas" class="map"></div>
124+<script><!--
125+showmap({{ venue_object.longitude }}, {{ venue_object.latitude }}, '<h3 style="margin: 0 0 0.4em 0;">{{ venue_object.name }}</h3><a href="http://maps.google.com/maps?saddr=&daddr={{ venue_object.address }}, {{ venue_object.city }}, {{ venue_object.country }}" target ="_blank">Get Directions<\/a>')
126+
127+--></script>
128+{% endif %}

Subscribers

People subscribed via source and target branches