Merge lp:~daker/loco-team-portal/fix.venues into lp:loco-team-portal
- fix.venues
- Merge into 0.2
Proposed by
Adnane Belmadiaf
Status: | Merged | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Adnane Belmadiaf | ||||||||||||
Approved revision: | 615 | ||||||||||||
Merged at revision: | 616 | ||||||||||||
Proposed branch: | lp:~daker/loco-team-portal/fix.venues | ||||||||||||
Merge into: | lp:loco-team-portal | ||||||||||||
Diff against target: |
721 lines (+290/-230) 11 files modified
loco_directory/media/css/styles.css (+78/-48) loco_directory/templates/teams/team_detail.html (+13/-13) loco_directory/templates/venues/venue_detail.html (+107/-8) loco_directory/templates/venues/venue_detail.inc.html (+0/-21) loco_directory/templates/venues/venue_detail_basic.inc.html (+0/-67) loco_directory/templates/venues/venue_list.html (+69/-51) loco_directory/templates/venues/venue_update.html (+12/-12) loco_directory/venues/forms.py (+1/-5) loco_directory/venues/models.py (+4/-1) loco_directory/venues/urls.py (+2/-2) loco_directory/venues/views.py (+4/-2) |
||||||||||||
To merge this branch: | bzr merge lp:~daker/loco-team-portal/fix.venues | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
LoCo Team Portal Developers | Pending | ||
Review via email: mp+149927@code.launchpad.net |
Commit message
Fixed the venues part
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'loco_directory/media/css/styles.css' | |||
2 | --- loco_directory/media/css/styles.css 2013-02-18 21:27:39 +0000 | |||
3 | +++ loco_directory/media/css/styles.css 2013-02-21 20:33:20 +0000 | |||
4 | @@ -38,22 +38,6 @@ | |||
5 | 38 | white-space: nowrap; | 38 | white-space: nowrap; |
6 | 39 | } | 39 | } |
7 | 40 | 40 | ||
8 | 41 | /* | ||
9 | 42 | label { | ||
10 | 43 | font-weight: bold; | ||
11 | 44 | white-space: nowrap; | ||
12 | 45 | } | ||
13 | 46 | */ | ||
14 | 47 | |||
15 | 48 | .minor-content .venue-map { | ||
16 | 49 | min-height: 350px; | ||
17 | 50 | margin-top: 60px; | ||
18 | 51 | } | ||
19 | 52 | |||
20 | 53 | .venue-map { | ||
21 | 54 | min-height: 250px; | ||
22 | 55 | } | ||
23 | 56 | |||
24 | 57 | #main-content { | 41 | #main-content { |
25 | 58 | margin-right: 20px; | 42 | margin-right: 20px; |
26 | 59 | } | 43 | } |
27 | @@ -267,65 +251,111 @@ | |||
28 | 267 | 251 | ||
29 | 268 | 252 | ||
30 | 269 | 253 | ||
33 | 270 | /*#venue-list ul,*/ | 254 | /* Venue */ |
34 | 271 | .venue-list{ | 255 | .venues-list{ |
35 | 272 | overflow:auto; | 256 | overflow:auto; |
36 | 273 | } | 257 | } |
37 | 274 | 258 | ||
38 | 275 | 259 | ||
40 | 276 | .venue-list h3 { | 260 | .venues-list h3 { |
41 | 277 | color: #333; | 261 | color: #333; |
44 | 278 | padding: 10px 0px 10px 10px; | 262 | padding: 10px 0px 10px 0; |
43 | 279 | background: white url(/ubuntu-website/media/images/dotted.png) repeat scroll 0px 0px; | ||
45 | 280 | margin-bottom: 0; | 263 | margin-bottom: 0; |
46 | 281 | } | 264 | } |
47 | 282 | 265 | ||
49 | 283 | .venue-list ul { | 266 | .venues-list ul { |
50 | 284 | display: block; | 267 | display: block; |
51 | 285 | float: left; | ||
52 | 286 | list-style-image: none; | 268 | list-style-image: none; |
53 | 287 | list-style-type: none; | 269 | list-style-type: none; |
55 | 288 | padding: 4px 0px 5px 5px; | 270 | padding: 4px 0px 5px 0; |
56 | 289 | text-indent: 0px; | 271 | text-indent: 0px; |
59 | 290 | width: 915px; | 272 | margin: 0; |
60 | 291 | background-color:#F7F7F7; | 273 | margin-bottom: 10px; |
61 | 292 | } | 274 | } |
62 | 293 | 275 | ||
64 | 294 | .venue-list ul li { | 276 | .venues-list ul li { |
65 | 295 | list-style-image: none; | 277 | list-style-image: none; |
66 | 296 | list-style-type: none; | 278 | list-style-type: none; |
67 | 297 | text-indent: 0px; | 279 | text-indent: 0px; |
70 | 298 | width: 200px; | 280 | margin-right: 0; |
69 | 299 | margin-right: 22px; | ||
71 | 300 | margin-bottom: 5px; | 281 | margin-bottom: 5px; |
80 | 301 | padding-left: 5px; | 282 | font-size: 12px; |
81 | 302 | float: left; | 283 | overflow: auto; |
82 | 303 | font-size:12px; | 284 | } |
83 | 304 | } | 285 | |
84 | 305 | 286 | .venues-list ul li .venue-d { | |
85 | 306 | .venue-list ul li h3{ | 287 | overflow: auto; |
86 | 307 | padding: 0px; | 288 | border: 1px solid #d2d2d2; |
87 | 308 | background:#f7f6f5; | 289 | overflow: hidden; |
88 | 290 | text-overflow: ellipsis; | ||
89 | 291 | position: relative; | ||
90 | 292 | margin-top: 20px; | ||
91 | 293 | } | ||
92 | 294 | |||
93 | 295 | .venues-list ul li .venue-d:first-child { | ||
94 | 296 | margin-top: 0; | ||
95 | 297 | } | ||
96 | 298 | |||
97 | 299 | .venues-list ul li h3{ | ||
98 | 309 | margin: 0px; | 300 | margin: 0px; |
99 | 310 | color: #333; | 301 | color: #333; |
100 | 311 | padding: 4px 0px; | 302 | padding: 4px 0px; |
101 | 312 | } | 303 | } |
102 | 313 | 304 | ||
112 | 314 | 305 | .venues-list ul li p a{ | |
104 | 315 | .venue-list ul li p{ | ||
105 | 316 | font-size: 12px; | ||
106 | 317 | line-height: 16px; | ||
107 | 318 | margin: 0px; | ||
108 | 319 | padding: 0px; | ||
109 | 320 | } | ||
110 | 321 | |||
111 | 322 | .venue-list ul li p a{ | ||
113 | 323 | border-bottom: 1px dotted #333; | 306 | border-bottom: 1px dotted #333; |
114 | 324 | clear: both; | 307 | clear: both; |
115 | 325 | display: block; | 308 | display: block; |
116 | 309 | padding: 5px 0px 3px; | ||
117 | 310 | } | ||
118 | 311 | |||
119 | 312 | .p { | ||
120 | 313 | font-family: 'EntypoRegular'; | ||
121 | 314 | font-size: 90px; | ||
122 | 315 | position: relative; | ||
123 | 316 | color: #333; | ||
124 | 317 | margin: 4px 5px 0 0; | ||
125 | 318 | height: 20px; | ||
126 | 319 | display: block; | ||
127 | 320 | float: left; | ||
128 | 321 | line-height: 48px; | ||
129 | 322 | width: 67px; | ||
130 | 323 | text-align: center; | ||
131 | 324 | } | ||
132 | 325 | |||
133 | 326 | .p:after { content: "0"; padding-left: 4px;} | ||
134 | 327 | |||
135 | 328 | #venue-map { | ||
136 | 329 | height: 200px; | ||
137 | 330 | margin-top: 5px; | ||
138 | 331 | margin-bottom: 10px; | ||
139 | 332 | } | ||
140 | 333 | |||
141 | 334 | .venue-map { | ||
142 | 335 | min-height: 250px; | ||
143 | 336 | } | ||
144 | 337 | |||
145 | 338 | .f { | ||
146 | 339 | float: left; | ||
147 | 340 | } | ||
148 | 341 | |||
149 | 342 | .f img { | ||
150 | 343 | width: 50px; | ||
151 | 344 | height: 50px; | ||
152 | 345 | margin-bottom: 5px; | ||
153 | 346 | } | ||
154 | 347 | |||
155 | 348 | .f0 { | ||
156 | 326 | float: none; | 349 | float: none; |
159 | 327 | padding: 5px 0px 3px; | 350 | display: block; |
160 | 328 | } | 351 | margin-bottom: 5px; |
161 | 352 | } | ||
162 | 353 | |||
163 | 354 | .f0 img { | ||
164 | 355 | width: 200px; | ||
165 | 356 | height: 200px; | ||
166 | 357 | } | ||
167 | 358 | |||
168 | 329 | 359 | ||
169 | 330 | #site_search_form { | 360 | #site_search_form { |
170 | 331 | width: auto; | 361 | width: auto; |
171 | 332 | 362 | ||
172 | === modified file 'loco_directory/templates/teams/team_detail.html' | |||
173 | --- loco_directory/templates/teams/team_detail.html 2013-02-10 15:06:06 +0000 | |||
174 | +++ loco_directory/templates/teams/team_detail.html 2013-02-21 20:33:20 +0000 | |||
175 | @@ -75,12 +75,12 @@ | |||
176 | 75 | <div style="display:block;"> | 75 | <div style="display:block;"> |
177 | 76 | <div id="loco-location"> | 76 | <div id="loco-location"> |
178 | 77 | <span title="{% trans "Location" %}" class="pictogram place"></span> | 77 | <span title="{% trans "Location" %}" class="pictogram place"></span> |
180 | 78 | <span class="value ellipsis small-ellipsis"> | 78 | <span class="value ellipsis medium-ellipsis"> |
181 | 79 | {% if team.countries.all %} | 79 | {% if team.countries.all %} |
182 | 80 | {% for country in team.countries.all %} | 80 | {% for country in team.countries.all %} |
183 | 81 | {% if not forloop.first %}, {% endif %}{{ country.name }} | 81 | {% if not forloop.first %}, {% endif %}{{ country.name }} |
184 | 82 | {% endfor %} | 82 | {% endfor %} |
186 | 83 | {% if team.spr %}, {% trans team.spr %}{% endif %}{% if team.city %}, {% trans team.city %} | 83 | {% if team.spr %}, {{ team.spr }}{% endif %}{% if team.city %}, {{ team.city }} |
187 | 84 | {% endif %} | 84 | {% endif %} |
188 | 85 | {% else %} | 85 | {% else %} |
189 | 86 | {% trans "None Specified" %} | 86 | {% trans "None Specified" %} |
190 | @@ -100,17 +100,6 @@ | |||
191 | 100 | {% endif %} | 100 | {% endif %} |
192 | 101 | </span> | 101 | </span> |
193 | 102 | </div> | 102 | </div> |
194 | 103 | |||
195 | 104 | <div id="loco-support"> | ||
196 | 105 | <span title="{% trans "Local Support" %}" class="pictogram support"></span> | ||
197 | 106 | <span class="value ellipsis medium-ellipsis"> | ||
198 | 107 | {% if team.provides_support %} | ||
199 | 108 | {% trans "This LoCo provides support :)" %} | ||
200 | 109 | {% else %} | ||
201 | 110 | {% trans "This LoCo doesn't provide support :(" %} | ||
202 | 111 | {% endif %} | ||
203 | 112 | </span> | ||
204 | 113 | </div> | ||
205 | 114 | </div> | 103 | </div> |
206 | 115 | 104 | ||
207 | 116 | <div style="display:block;"> | 105 | <div style="display:block;"> |
208 | @@ -162,6 +151,17 @@ | |||
209 | 162 | </span> | 151 | </span> |
210 | 163 | </div> | 152 | </div> |
211 | 164 | 153 | ||
212 | 154 | <div id="loco-location"> | ||
213 | 155 | <span title="{% trans "Local Support" %}" class="pictogram support"></span> | ||
214 | 156 | <span class="value ellipsis medium-ellipsis"> | ||
215 | 157 | {% if team.provides_support %} | ||
216 | 158 | {% trans "This LoCo provides support :)" %} | ||
217 | 159 | {% else %} | ||
218 | 160 | {% trans "This LoCo doesn't provide support :(" %} | ||
219 | 161 | {% endif %} | ||
220 | 162 | </span> | ||
221 | 163 | </div> | ||
222 | 164 | |||
223 | 165 | </div> | 165 | </div> |
224 | 166 | </div> | 166 | </div> |
225 | 167 | </div> | 167 | </div> |
226 | 168 | 168 | ||
227 | === modified file 'loco_directory/templates/venues/venue_detail.html' | |||
228 | --- loco_directory/templates/venues/venue_detail.html 2012-06-02 11:50:27 +0000 | |||
229 | +++ loco_directory/templates/venues/venue_detail.html 2013-02-21 20:33:20 +0000 | |||
230 | @@ -1,27 +1,126 @@ | |||
231 | 1 | {% extends "base.html" %} | 1 | {% extends "base.html" %} |
233 | 2 | {% load i18n %} | 2 | {% load i18n markup %} |
234 | 3 | 3 | ||
236 | 4 | {% block page_name %}{% trans venue_object.name %}{% endblock %} | 4 | {% block page_name %}{% trans venue.name %}{% endblock %} |
237 | 5 | 5 | ||
238 | 6 | {% block extrahead %}{{block.super}} | 6 | {% block extrahead %}{{block.super}} |
239 | 7 | <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language={% trans 'en' %}®ion={% trans 'US' %}"></script> | 7 | <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language={% trans 'en' %}®ion={% trans 'US' %}"></script> |
240 | 8 | <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="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/src/markerclusterer_packed.js"></script> |
241 | 9 | <script type="text/javascript" src="{{ MEDIA_URL }}js/jquery-ubuntu-maps.js"></script> | 9 | <script type="text/javascript" src="{{ MEDIA_URL }}js/jquery-ubuntu-maps.js"></script> |
242 | 10 | |||
243 | 11 | <script type="text/javascript"> | ||
244 | 12 | $(document).ready(function(){ | ||
245 | 13 | var x = {{ venue.longitude }}, | ||
246 | 14 | y = {{ venue.latitude }}, | ||
247 | 15 | km = 0.0089930, // 1km | ||
248 | 16 | radius = 5, | ||
249 | 17 | minx = x-radius/2*km, | ||
250 | 18 | miny = y-radius/2*km, | ||
251 | 19 | maxx = x+radius/2*km, | ||
252 | 20 | maxy = y+radius/2*km; | ||
253 | 21 | |||
254 | 22 | $.getJSON("http://www.panoramio.com/map/get_panoramas.php?order=popularity&set=public&from=0&to=9&minx=" + minx + "&miny=" + miny + "&maxx=" + maxx + "&maxy=" + maxy +"&size=medium&format=json&callback=?", function(data){ | ||
255 | 23 | $.each(data.photos, function(i,item){ | ||
256 | 24 | $("#pamdiv").append('<span class="f f'+ i +'"><a href="http://www.panoramio.com/photo/' + $(this)[0].photo_id + '"><img src="' + $(this)[0].photo_file_url + '" title="' + $(this)[0].photo_title + '" alt="' + $(this)[0].photo_title + '"></a></span>'); | ||
257 | 25 | }); | ||
258 | 26 | }); | ||
259 | 27 | }); | ||
260 | 28 | </script> | ||
261 | 10 | {% endblock %} | 29 | {% endblock %} |
262 | 11 | <div class="row"> | 30 | <div class="row"> |
263 | 12 | <section class="span-6"> | 31 | <section class="span-6"> |
264 | 13 | 32 | ||
265 | 14 | {% block sub_nav_links %} | 33 | {% block sub_nav_links %} |
266 | 15 | <li><a class="sub-nav-item" href="{% url venue-list %}" >{% trans "Back to Venues List" %}</a></li> | 34 | <li><a class="sub-nav-item" href="{% url venue-list %}" >{% trans "Back to Venues List" %}</a></li> |
269 | 16 | {% if venue_object.country %} | 35 | {% if venue.country %} |
270 | 17 | <li><a class="sub-nav-item" href="{% url venue-update venue_object.country.slug venue_object.id %}">{% trans "Edit Venue Details" %}</a></li> | 36 | <li><a class="sub-nav-item" href="{% url venue-update venue.country.slug venue.id %}">{% trans "Edit Venue Details" %}</a></li> |
271 | 18 | {% else %} | 37 | {% else %} |
273 | 19 | <li><a class="sub-nav-item" href="{% url venue-update 'no_country' venue_object.id %}">{% trans "Edit Venue Details" %}</a></li> | 38 | <li><a class="sub-nav-item" href="{% url venue-update 'no_country' venue.id %}">{% trans "Edit Venue Details" %}</a></li> |
274 | 20 | {% endif %} | 39 | {% endif %} |
275 | 21 | {% endblock %} | 40 | {% endblock %} |
276 | 22 | 41 | ||
277 | 23 | {% block content %} | 42 | {% block content %} |
281 | 24 | 43 | <div class="row"> | |
282 | 25 | {% include "venues/venue_detail.inc.html" %} | 44 | <section class="span-9"> |
283 | 26 | 45 | <div class="box_content"> | |
284 | 46 | <div class="pagelet"> | ||
285 | 47 | <h2>{{ venue.name }}</h2> | ||
286 | 48 | <div id="loco-location"> | ||
287 | 49 | <div id="loco-location"> | ||
288 | 50 | <span title="{% trans "Location" %}" class="pictogram place"></span> | ||
289 | 51 | <span class="value"> | ||
290 | 52 | {% if venue.address %}{{ venue.address }}{% endif %} | ||
291 | 53 | {% if venue.country %}{{ venue.country }}{% endif %} | ||
292 | 54 | {% if venue.spr %}, {{ venue.spr }}{% endif %}{% if venue.city %}, {{ venue.city }}{% endif %} | ||
293 | 55 | </span> | ||
294 | 56 | </div> | ||
295 | 57 | |||
296 | 58 | {% if venue.tz %} | ||
297 | 59 | <div> | ||
298 | 60 | <span title="{% trans "Timezone" %}" class="pictogram calendar"></span> | ||
299 | 61 | <span class="pictogram-l"> | ||
300 | 62 | {{ venue.tz }} | ||
301 | 63 | </span> | ||
302 | 64 | </div> | ||
303 | 65 | {% endif %} | ||
304 | 66 | |||
305 | 67 | {% if venue.venue_url %} | ||
306 | 68 | <div> | ||
307 | 69 | <span class="pictogram announcement"></span> | ||
308 | 70 | <a class="pictogram-l" href="{{ venue.venue_url }}">{{ venue.venue_url }}</a> | ||
309 | 71 | </div> | ||
310 | 72 | {% endif %} | ||
311 | 73 | </div> | ||
312 | 74 | |||
313 | 75 | {% if venue.comment %} | ||
314 | 76 | <div> | ||
315 | 77 | <h3 style="margin-top: 10px; margin-bottom: 10px;">{% trans "Comment" %}</h3> | ||
316 | 78 | {{ venue.comment|markdown:'safe' }} | ||
317 | 79 | </div> | ||
318 | 80 | {% endif %} | ||
319 | 81 | </div> | ||
320 | 82 | {% if venue.longitude and venue.latitude %} | ||
321 | 83 | <div id="venue-map"></div> | ||
322 | 84 | <script> | ||
323 | 85 | $(function(){ | ||
324 | 86 | $('#venue-map').showLocations({ | ||
325 | 87 | markers_list: [{ lat: {{ venue.latitude }}, lng: {{ venue.longitude }} }], | ||
326 | 88 | marker_icon: '{{ MEDIA_URL }}img/marker.png' | ||
327 | 89 | }); | ||
328 | 90 | }); | ||
329 | 91 | </script> | ||
330 | 92 | {% endif %} | ||
331 | 93 | |||
332 | 94 | |||
333 | 95 | <div class="events-meetings-wrapper"> | ||
334 | 96 | <div style="overflow: auto;"> | ||
335 | 97 | <h3 class="title">{% trans "Upcoming Events" %}</h3> | ||
336 | 98 | </div> | ||
337 | 99 | {% if events %} | ||
338 | 100 | {% for team_event in events %} | ||
339 | 101 | <a href="{{ team_event.get_absolute_url }}" title="{% if team_event.venue %}{% else %}{{team_event.date_begin|date:"M d"}}{% endif %}" class="event-meetings"> | ||
340 | 102 | <span class="title">{{ team_event.name }}</span> | ||
341 | 103 | <small>{{ team_event.local_date_begin|date:"l, d N Y" }} {% trans "at " %}{{ team_event.local_date_begin|date:"H:i T" }}</small> | ||
342 | 104 | <p>{{ team_event.description }}</p> | ||
343 | 105 | </a> | ||
344 | 106 | {% endfor %} | ||
345 | 107 | {% else %} | ||
346 | 108 | <div class="no-results"> | ||
347 | 109 | {% trans "There are currently no upcoming events on this venue" %} | ||
348 | 110 | </div> | ||
349 | 111 | {% endif %} | ||
350 | 112 | </div> | ||
351 | 113 | |||
352 | 114 | </div> | ||
353 | 115 | </section> | ||
354 | 116 | <section class="span-3 box_content last"> | ||
355 | 117 | <div class="sidebar-inner"> | ||
356 | 118 | <h3 class="title">{% trans "Photos" %}</h3> | ||
357 | 119 | <div id="pamdiv"></div> | ||
358 | 120 | {% if venue.address %} | ||
359 | 121 | <h3 class="attendees-title"><a href="https://maps.google.com/maps?saddr=&daddr={{ venue.address }}">{% trans "Get directions to this venue" %}</a></h3> | ||
360 | 122 | {% endif %} | ||
361 | 123 | </div> | ||
362 | 124 | </section> | ||
363 | 125 | </div> | ||
364 | 27 | {% endblock %} | 126 | {% endblock %} |
365 | 28 | 127 | ||
366 | === removed file 'loco_directory/templates/venues/venue_detail.inc.html' | |||
367 | --- loco_directory/templates/venues/venue_detail.inc.html 2012-06-02 11:50:27 +0000 | |||
368 | +++ loco_directory/templates/venues/venue_detail.inc.html 1970-01-01 00:00:00 +0000 | |||
369 | @@ -1,21 +0,0 @@ | |||
370 | 1 | {% load i18n %} | ||
371 | 2 | <div class="row"> | ||
372 | 3 | <section class="span-6"> | ||
373 | 4 | <h2>{{venue_object.name}}</h2> | ||
374 | 5 | <p>{% include "venues/venue_detail_basic.inc.html" %}</p> | ||
375 | 6 | </section> | ||
376 | 7 | |||
377 | 8 | {% if venue_object.longitude and venue_object.latitude %} | ||
378 | 9 | <section class="span-6 last alone venue-map" id="venue-map"> | ||
379 | 10 | </article> | ||
380 | 11 | <script> | ||
381 | 12 | $(function(){ | ||
382 | 13 | $('#venue-map').showLocations({ | ||
383 | 14 | markers_list: [{ lat: {{ venue_object.latitude }}, lng: {{ venue_object.longitude }} }], | ||
384 | 15 | marker_icon: '{{ MEDIA_URL }}img/marker.png' | ||
385 | 16 | }); | ||
386 | 17 | }); | ||
387 | 18 | </script> | ||
388 | 19 | </setion> | ||
389 | 20 | </div> | ||
390 | 21 | {% endif %} | ||
391 | 22 | 0 | ||
392 | === removed file 'loco_directory/templates/venues/venue_detail_basic.inc.html' | |||
393 | --- loco_directory/templates/venues/venue_detail_basic.inc.html 2012-02-07 14:36:29 +0000 | |||
394 | +++ loco_directory/templates/venues/venue_detail_basic.inc.html 1970-01-01 00:00:00 +0000 | |||
395 | @@ -1,67 +0,0 @@ | |||
396 | 1 | {% load i18n markup %} | ||
397 | 2 | <table> | ||
398 | 3 | {% if venue_object %} | ||
399 | 4 | {% if venue_object.name %} | ||
400 | 5 | <tr> | ||
401 | 6 | <th class="form-item-label" scope="row">{% trans "Location name:" %}</th> | ||
402 | 7 | <td>{{ venue_object.name }}</td> | ||
403 | 8 | </tr> | ||
404 | 9 | {% endif %} | ||
405 | 10 | {% if venue_object.address %} | ||
406 | 11 | <tr> | ||
407 | 12 | <th class="form-item-label" scope="row">{% trans "Address:" %}</th> | ||
408 | 13 | <td class="form-item-value">{{ venue_object.address }}</td> | ||
409 | 14 | </tr> | ||
410 | 15 | {% endif %} | ||
411 | 16 | {% if venue_object.city %} | ||
412 | 17 | <tr> | ||
413 | 18 | <th class="form-item-label" scope="row">{% trans "City:" %}</th> | ||
414 | 19 | <td class="form-item-value">{{ venue_object.city }}</td> | ||
415 | 20 | </tr> | ||
416 | 21 | {% endif %} | ||
417 | 22 | {% if venue_object.spr %} | ||
418 | 23 | <tr> | ||
419 | 24 | <th class="form-item-label" scope="row">{% trans "State/Province/Region:" %}</th> | ||
420 | 25 | <td class="form-item-value">{{ venue_object.spr }}</td> | ||
421 | 26 | </tr> | ||
422 | 27 | {% endif %} | ||
423 | 28 | {% if venue_object.country %} | ||
424 | 29 | <tr> | ||
425 | 30 | <th class="form-item-label" scope="row">{% trans "Country:" %}</th> | ||
426 | 31 | <td class="form-item-value">{{ venue_object.country }}</td> | ||
427 | 32 | </tr> | ||
428 | 33 | {% endif %} | ||
429 | 34 | {% if venue_object.tz %} | ||
430 | 35 | <tr> | ||
431 | 36 | <th class="form-item-label" scope="row">{% trans "Timezone:" %}</th> | ||
432 | 37 | <td class="form-item-value">{{ venue_object.tz }}</td> | ||
433 | 38 | </tr> | ||
434 | 39 | {% endif %} | ||
435 | 40 | {% if venue_object.venue_url %} | ||
436 | 41 | <tr> | ||
437 | 42 | <th class="form-item-label" scope="row">{% trans "Homepage:" %}</th> | ||
438 | 43 | <td class="form-item-value"><a href="{{ venue_object.venue_url }}">{{ venue_object.venue_url }}</a></td> | ||
439 | 44 | </tr> | ||
440 | 45 | {% endif %} | ||
441 | 46 | {% if venue_object.longitude %} | ||
442 | 47 | <tr> | ||
443 | 48 | <th class="form-item-label" scope="row">{% trans "Longitude:" %}</th> | ||
444 | 49 | <td class="form-item-value">{{ venue_object.longitude }}</td> | ||
445 | 50 | </tr> | ||
446 | 51 | {% endif %} | ||
447 | 52 | {% if venue_object.latitude %} | ||
448 | 53 | <tr> | ||
449 | 54 | <th class="form-item-label" scope="row">{% trans "Latitude:" %}</th> | ||
450 | 55 | <td class="form-item-value">{{ venue_object.latitude }}</td> | ||
451 | 56 | </tr> | ||
452 | 57 | {% endif %} | ||
453 | 58 | {% if venue_object.comment %} | ||
454 | 59 | <tr> | ||
455 | 60 | <th class="form-item-label" scope="row">{% trans "Comment:" %}</th> | ||
456 | 61 | <td class="form-item-value">{{ venue_object.comment|markdown:'safe' }}</td> | ||
457 | 62 | </tr> | ||
458 | 63 | {% endif %} | ||
459 | 64 | {% endif %} | ||
460 | 65 | </table> | ||
461 | 66 | |||
462 | 67 | |||
463 | 68 | 0 | ||
464 | === modified file 'loco_directory/templates/venues/venue_list.html' | |||
465 | --- loco_directory/templates/venues/venue_list.html 2012-06-02 11:50:27 +0000 | |||
466 | +++ loco_directory/templates/venues/venue_list.html 2013-02-21 20:33:20 +0000 | |||
467 | @@ -3,66 +3,84 @@ | |||
468 | 3 | 3 | ||
469 | 4 | {% block page_name %}{% trans "Ubuntu LoCo Event Venues" %}{% endblock %} | 4 | {% block page_name %}{% trans "Ubuntu LoCo Event Venues" %}{% endblock %} |
470 | 5 | 5 | ||
471 | 6 | {% block sub_nav_links %} | ||
472 | 7 | <li><a class="sub-nav-item" href="{% url venue-new %}">{% trans "Add New Venue" %}</a></li> | ||
473 | 8 | {% endblock %} | ||
474 | 9 | |||
475 | 10 | {% block content %} | 6 | {% block content %} |
476 | 11 | <div class="row"> | 7 | <div class="row"> |
487 | 12 | <section class="span-12"> | 8 | <section class="span-9"> |
488 | 13 | <h2>{% trans "Ubuntu LoCo Event Venues" %}</h2> | 9 | <div class="box_content"> |
489 | 14 | 10 | <div class="pagelet"> | |
490 | 15 | {% if continent_list or venues_with_country or venues_without_country %} | 11 | <h2>{% trans "Ubuntu LoCo Event Venues" %}</h2> |
491 | 16 | <p>{% trans "Select a Venue below to see more information about it:" %}</p> | 12 | {% if continent_list or venues_with_country or venues_without_country %} |
492 | 17 | {% if continent_list %} | 13 | {% if continent_list %} |
493 | 18 | {% for continent in continent_list %} | 14 | {% for continent in continent_list %} |
494 | 19 | <div class="venue-list"> | 15 | <div class="venues-list"> |
495 | 20 | <h3>{{ continent.name }}</h3> | 16 | <h2>{{ continent.name }}</h2> |
496 | 21 | <ul> | 17 | <ul> |
497 | 22 | {% regroup continent.venue_list by country as country_list %} | 18 | {% regroup continent.venue_list by country as country_list %} |
498 | 23 | {% for country in country_list %} | 19 | {% for country in country_list %} |
500 | 24 | <li><h3>{{ country.grouper }}</h3> | 20 | <li> |
501 | 21 | <h3>{{ country.grouper }}</h3> | ||
502 | 25 | {% for venue in country.list %} | 22 | {% for venue in country.list %} |
504 | 26 | <p><a title="{% trans "show venue details" %}" href="{{ venue.get_absolute_url }}">{{ venue.name }}{% if venue.city %}, {{ venue.city }}{% endif %}{% if venue.spr %}, {{ venue.spr }}{% endif %}</a></p> | 23 | <div class="venue-d"> |
505 | 24 | <span class="p"></span> | ||
506 | 25 | <div style="float: left; padding: 10px; width:560px;"> | ||
507 | 26 | <a href="{{ venue.get_absolute_url }}">{{ venue.name }}</a><br /><br />{% if venue.city %}{{ venue.city }}{% endif %}{% if venue.spr %}, {{ venue.spr }}{% endif %} | ||
508 | 27 | <br />{% if venue.address %}{{ venue.address }}{% else %}{{ venue.latitude }}, {{ venue.longitude }}{% endif %} | ||
509 | 28 | </div> | ||
510 | 29 | </div> | ||
511 | 27 | {% endfor %} | 30 | {% endfor %} |
512 | 28 | </li> | 31 | </li> |
513 | 29 | {% endfor %} | 32 | {% endfor %} |
528 | 30 | </ul> | 33 | </ul> |
529 | 31 | </div> | 34 | </div> |
530 | 32 | {% endfor %} | 35 | {% endfor %} |
531 | 33 | {% endif %} | 36 | {% endif %} |
532 | 34 | 37 | ||
533 | 35 | {% if venues_with_country %} | 38 | {% if venues_with_country %} |
534 | 36 | <div class="venue-list"> | 39 | <div class="venues-list"> |
535 | 37 | <h3>{% trans "Countries without Continent" %}</h3> | 40 | <h2>{% trans "Countries without Continent" %}</h2> |
536 | 38 | <ul> | 41 | <ul> |
537 | 39 | {% regroup venues_with_country by country as country_list %} | 42 | {% regroup venues_with_country by country as country_list %} |
538 | 40 | {% for country in country_list %} | 43 | {% for country in country_list %} |
539 | 41 | <li><h3>{{ country.grouper }}</h3> | 44 | <li> |
540 | 42 | {% for venue in country.list %} | 45 | <h3>{{ country.grouper }}</h3> |
541 | 43 | <p><a title="{% trans "show venue details" %}" href="{{ venue.get_absolute_url }}">{{ venue.name }}{% if venue.city %}, {{ venue.city }}{% endif %}{% if venue.spr %}, {{ venue.spr }}{% endif %}</a></p> | 46 | {% for venue in country.list %} |
542 | 47 | <div class="venue-d"> | ||
543 | 48 | <span class="p"></span> | ||
544 | 49 | <div style="float: left; padding: 10px; width:560px;"> | ||
545 | 50 | <a href="{{ venue.get_absolute_url }}">{{ venue.name }}</a><br /><br />{% if venue.city %}{{ venue.city }}{% endif %}{% if venue.spr %}, {{ venue.spr }}{% endif %} | ||
546 | 51 | <br />{% if venue.address %}{{ venue.address }}{% else %}{{ venue.latitude }}, {{ venue.longitude }}{% endif %} | ||
547 | 52 | </div> | ||
548 | 53 | </div> | ||
549 | 54 | {% endfor %} | ||
550 | 55 | </li> | ||
551 | 56 | {% endfor %} | ||
552 | 57 | </ul> | ||
553 | 58 | </div> | ||
554 | 59 | {% endif %} | ||
555 | 60 | |||
556 | 61 | {% if venues_without_country %} | ||
557 | 62 | <div class="venues-list"> | ||
558 | 63 | <h2>{% trans "Venues without Country" %}</h2> | ||
559 | 64 | <ul> | ||
560 | 65 | {% for venue in venues_without_country %} | ||
561 | 66 | <li> | ||
562 | 67 | <div class="venue-d"> | ||
563 | 68 | <span class="p"></span> | ||
564 | 69 | <div style="float: left; padding: 10px; width:560px;"> | ||
565 | 70 | <a href="{{ venue.get_absolute_url }}">{{ venue.name }}</a><br /><br />{% if venue.city %}{{ venue.city }}{% endif %}{% if venue.spr %}, {{ venue.spr }}{% endif %} | ||
566 | 71 | <br />{% if venue.address %}{{ venue.address }}{% else %}{{ venue.latitude }}, {{ venue.longitude }}{% endif %} | ||
567 | 72 | </div> | ||
568 | 73 | </div> | ||
569 | 74 | </li> | ||
570 | 44 | {% endfor %} | 75 | {% endfor %} |
587 | 45 | </li> | 76 | </ul> |
588 | 46 | {% endfor %} | 77 | </div> |
589 | 47 | </ul> | 78 | {% endif %} |
590 | 48 | </div> | 79 | {% else %} |
591 | 49 | {% endif %} | 80 | <p>{% trans "There are currently no LoCo Venues :(" %}</p> |
592 | 50 | 81 | {% endif %} | |
577 | 51 | {% if venues_without_country %} | ||
578 | 52 | <div class="venue-list"> | ||
579 | 53 | <h3>{% trans "Venues without Country" %}</h3> | ||
580 | 54 | <ul> | ||
581 | 55 | {% for venue in venues_without_country %} | ||
582 | 56 | <li> | ||
583 | 57 | <p><a title="{% trans "show venue details" %}" href="{{ venue.get_absolute_url }}">{% if venue %}{{ venue.name }}{% else %}{% trans 'No Name' %}{% endif %}{% if venue.city %}, {{ venue.city }}{% endif %}{% if venue.spr %}, {{ venue.spr }}{% endif %}</a></p> | ||
584 | 58 | </li> | ||
585 | 59 | {% endfor %} | ||
586 | 60 | </ul> | ||
593 | 61 | </div> | 82 | </div> |
599 | 62 | {% endif %} | 83 | </div> |
600 | 63 | {% else %} | 84 | </section> |
596 | 64 | <p>{% trans "There are currently no LoCo Venues :(" %}</p> | ||
597 | 65 | {% endif %} | ||
598 | 66 | </section> | ||
601 | 67 | </div> | 85 | </div> |
602 | 68 | {% endblock %} | 86 | {% endblock %} |
603 | 69 | 87 | ||
604 | === modified file 'loco_directory/templates/venues/venue_update.html' | |||
605 | --- loco_directory/templates/venues/venue_update.html 2012-12-26 17:23:50 +0000 | |||
606 | +++ loco_directory/templates/venues/venue_update.html 2013-02-21 20:33:20 +0000 | |||
607 | @@ -15,8 +15,6 @@ | |||
608 | 15 | html_lat: $("#id_latitude"), | 15 | html_lat: $("#id_latitude"), |
609 | 16 | html_addr: $("#id_country, #id_spr, #id_city, #id_address, #id_continent"), | 16 | html_addr: $("#id_country, #id_spr, #id_city, #id_address, #id_continent"), |
610 | 17 | marker_icon: '{{ MEDIA_URL }}img/marker.png'}); | 17 | marker_icon: '{{ MEDIA_URL }}img/marker.png'}); |
611 | 18 | |||
612 | 19 | $('span[rel*=help]').colorTip({color:'orange'}); | ||
613 | 20 | }); | 18 | }); |
614 | 21 | //]]> | 19 | //]]> |
615 | 22 | </script> | 20 | </script> |
616 | @@ -24,16 +22,18 @@ | |||
617 | 24 | 22 | ||
618 | 25 | {% block content %} | 23 | {% block content %} |
619 | 26 | <div class="row"> | 24 | <div class="row"> |
630 | 27 | <section class="span-9"> | 25 | <section class="span-9"> |
631 | 28 | <form action="." method="post" style="width:auto;">{% csrf_token %} | 26 | <div class="box_content"> |
632 | 29 | <fieldset> | 27 | <div class="pagelet"> |
633 | 30 | <h3>{% if venue_object %}{% trans "Update Venue" %}{% else %}{% trans "New Venue" %}{% endif %}</h3> | 28 | <form action="." method="post" class="form">{% csrf_token %} |
634 | 31 | {{ form.as_template }} | 29 | <h2>{% if venue_object %}{% trans "Update Venue" %}{% else %}{% trans "New Venue" %}{% endif %}</h2> |
635 | 32 | </fieldset> | 30 | {{ form.as_template }} |
636 | 33 | {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} | 31 | {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %} |
637 | 34 | <input type="submit" name="submit" value="Submit" class="submit-button" /> | 32 | <input type="submit" name="submit" value="Submit" class="submit-button" /> |
638 | 35 | </form> | 33 | </form> |
639 | 36 | </section> | 34 | </div> |
640 | 35 | </div> | ||
641 | 36 | </section> | ||
642 | 37 | </div> | 37 | </div> |
643 | 38 | 38 | ||
644 | 39 | <section class="minor-content alone venue-map" id="venue-map-selector" title="{% trans "Select venue position" %}"> </section> | 39 | <section class="minor-content alone venue-map" id="venue-map-selector" title="{% trans "Select venue position" %}"> </section> |
645 | 40 | 40 | ||
646 | === modified file 'loco_directory/venues/forms.py' | |||
647 | --- loco_directory/venues/forms.py 2012-12-28 21:03:08 +0000 | |||
648 | +++ loco_directory/venues/forms.py 2013-02-21 20:33:20 +0000 | |||
649 | @@ -22,14 +22,10 @@ | |||
650 | 22 | model = Venue | 22 | model = Venue |
651 | 23 | 23 | ||
652 | 24 | class Media: | 24 | class Media: |
653 | 25 | css = {'all': ( | ||
654 | 26 | settings.MEDIA_URL + 'css/colortip-1.0-jquery.css', | ||
655 | 27 | )} | ||
656 | 28 | js = ( | 25 | js = ( |
657 | 29 | 'http://maps.google.com/maps/api/js?sensor=false&language=%(language)s®ion=%(region)s' % {'language': _('en'), 'region': _('US')}, | 26 | 'http://maps.google.com/maps/api/js?sensor=false&language=%(language)s®ion=%(region)s' % {'language': _('en'), 'region': _('US')}, |
658 | 30 | 'http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/src/markerclusterer_packed.js', | 27 | 'http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/src/markerclusterer_packed.js', |
661 | 31 | settings.MEDIA_URL + 'js/jquery-ubuntu-maps.js', | 28 | settings.MEDIA_URL + 'js/jquery-ubuntu-maps.js' |
660 | 32 | settings.MEDIA_URL + 'js/colortip-1.0-jquery.js', | ||
662 | 33 | ) | 29 | ) |
663 | 34 | 30 | ||
664 | 35 | def clean(self): | 31 | def clean(self): |
665 | 36 | 32 | ||
666 | === modified file 'loco_directory/venues/models.py' | |||
667 | --- loco_directory/venues/models.py 2012-12-03 22:19:34 +0000 | |||
668 | +++ loco_directory/venues/models.py 2013-02-21 20:33:20 +0000 | |||
669 | @@ -7,13 +7,16 @@ | |||
670 | 7 | from common.mixins import LocalTimeMixin | 7 | from common.mixins import LocalTimeMixin |
671 | 8 | 8 | ||
672 | 9 | import pytz | 9 | import pytz |
673 | 10 | import datetime | ||
674 | 10 | 11 | ||
675 | 11 | 12 | ||
676 | 12 | class VenueManager(models.Manager): | 13 | class VenueManager(models.Manager): |
677 | 13 | """ | 14 | """ |
678 | 14 | a manager class for Venues | 15 | a manager class for Venues |
679 | 15 | """ | 16 | """ |
681 | 16 | pass | 17 | def next_5_events(self): |
682 | 18 | """ a list with the next 5 events """ | ||
683 | 19 | return self.filter(date_end__gt=datetime.datetime.now()).order_by('date_end')[:5] | ||
684 | 17 | 20 | ||
685 | 18 | 21 | ||
686 | 19 | class Venue(models.Model, LocalTimeMixin): | 22 | class Venue(models.Model, LocalTimeMixin): |
687 | 20 | 23 | ||
688 | === modified file 'loco_directory/venues/urls.py' | |||
689 | --- loco_directory/venues/urls.py 2012-06-03 18:23:49 +0000 | |||
690 | +++ loco_directory/venues/urls.py 2013-02-21 20:33:20 +0000 | |||
691 | @@ -4,10 +4,10 @@ | |||
692 | 4 | #venues | 4 | #venues |
693 | 5 | url(r'^$', 'venues.views.venue_list', name='venue-list'), | 5 | url(r'^$', 'venues.views.venue_list', name='venue-list'), |
694 | 6 | url(r'^(?P<country>[\w\s]+)/(?P<venue_id>\d+)/detail/$', 'venues.views.venue_detail', name='venue-detail'), | 6 | url(r'^(?P<country>[\w\s]+)/(?P<venue_id>\d+)/detail/$', 'venues.views.venue_detail', name='venue-detail'), |
696 | 7 | url(r'^(?P<country>[\w\s]+)/(?P<venue_id>\d+)/update/$', 'venues.views.venue_update', name='venue-update'), | 7 | url(r'^(?P<country>[\w\s]+)/(?P<venue_id>\d+)/edit/$', 'venues.views.venue_update', name='venue-update'), |
697 | 8 | url(r'add/$', 'venues.views.venue_new', name='venue-new'), | 8 | url(r'add/$', 'venues.views.venue_new', name='venue-new'), |
698 | 9 | 9 | ||
699 | 10 | # Old urls for compatibility | 10 | # Old urls for compatibility |
700 | 11 | url(r'^(?P<venue_id>\d+)/detail/$', 'venues.views.venue_detail', kwargs={'country': ''}), | 11 | url(r'^(?P<venue_id>\d+)/detail/$', 'venues.views.venue_detail', kwargs={'country': ''}), |
702 | 12 | url(r'^(?P<venue_id>\d+)/update/$', 'venues.views.venue_update', kwargs={'country': ''}), | 12 | url(r'^(?P<venue_id>\d+)/edit/$', 'venues.views.venue_update', kwargs={'country': ''}), |
703 | 13 | ) | 13 | ) |
704 | 14 | 14 | ||
705 | === modified file 'loco_directory/venues/views.py' | |||
706 | --- loco_directory/venues/views.py 2012-06-03 18:23:49 +0000 | |||
707 | +++ loco_directory/venues/views.py 2013-02-21 20:33:20 +0000 | |||
708 | @@ -42,9 +42,11 @@ | |||
709 | 42 | """ | 42 | """ |
710 | 43 | detailed view for a venue | 43 | detailed view for a venue |
711 | 44 | """ | 44 | """ |
713 | 45 | venue_object = get_object_or_404(Venue, pk=venue_id) | 45 | venue = get_object_or_404(Venue, pk=venue_id) |
714 | 46 | events = venue.teamevent_set.next_5_events() | ||
715 | 46 | context = { | 47 | context = { |
717 | 47 | 'venue_object': venue_object, | 48 | 'venue': venue, |
718 | 49 | 'events': events, | ||
719 | 48 | } | 50 | } |
720 | 49 | return render_to_response('venues/venue_detail.html', | 51 | return render_to_response('venues/venue_detail.html', |
721 | 50 | context, RequestContext(request)) | 52 | context, RequestContext(request)) |