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

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
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

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
=== modified file 'loco_directory/media/css/styles.css'
--- loco_directory/media/css/styles.css 2013-02-18 21:27:39 +0000
+++ loco_directory/media/css/styles.css 2013-02-21 20:33:20 +0000
@@ -38,22 +38,6 @@
38 white-space: nowrap;38 white-space: nowrap;
39}39}
4040
41/*
42label {
43 font-weight: bold;
44 white-space: nowrap;
45}
46*/
47
48.minor-content .venue-map {
49 min-height: 350px;
50 margin-top: 60px;
51}
52
53.venue-map {
54 min-height: 250px;
55}
56
57#main-content {41#main-content {
58 margin-right: 20px;42 margin-right: 20px;
59}43}
@@ -267,65 +251,111 @@
267251
268252
269253
270/*#venue-list ul,*/254/* Venue */
271.venue-list{255.venues-list{
272 overflow:auto;256 overflow:auto;
273}257}
274258
275259
276.venue-list h3 {260.venues-list h3 {
277 color: #333;261 color: #333;
278 padding: 10px 0px 10px 10px;262 padding: 10px 0px 10px 0;
279 background: white url(/ubuntu-website/media/images/dotted.png) repeat scroll 0px 0px;
280 margin-bottom: 0;263 margin-bottom: 0;
281}264}
282265
283.venue-list ul {266.venues-list ul {
284 display: block;267 display: block;
285 float: left;
286 list-style-image: none;268 list-style-image: none;
287 list-style-type: none;269 list-style-type: none;
288 padding: 4px 0px 5px 5px;270 padding: 4px 0px 5px 0;
289 text-indent: 0px;271 text-indent: 0px;
290 width: 915px;272 margin: 0;
291 background-color:#F7F7F7;273 margin-bottom: 10px;
292}274}
293275
294.venue-list ul li {276.venues-list ul li {
295 list-style-image: none;277 list-style-image: none;
296 list-style-type: none;278 list-style-type: none;
297 text-indent: 0px;279 text-indent: 0px;
298 width: 200px;280 margin-right: 0;
299 margin-right: 22px;
300 margin-bottom: 5px;281 margin-bottom: 5px;
301 padding-left: 5px;282 font-size: 12px;
302 float: left;283 overflow: auto;
303 font-size:12px;284}
304}285
305286.venues-list ul li .venue-d {
306.venue-list ul li h3{287 overflow: auto;
307 padding: 0px;288 border: 1px solid #d2d2d2;
308 background:#f7f6f5;289 overflow: hidden;
290 text-overflow: ellipsis;
291 position: relative;
292 margin-top: 20px;
293}
294
295.venues-list ul li .venue-d:first-child {
296 margin-top: 0;
297}
298
299.venues-list ul li h3{
309 margin: 0px;300 margin: 0px;
310 color: #333;301 color: #333;
311 padding: 4px 0px;302 padding: 4px 0px;
312}303}
313304
314305.venues-list ul li p a{
315.venue-list ul li p{
316 font-size: 12px;
317 line-height: 16px;
318 margin: 0px;
319 padding: 0px;
320}
321
322.venue-list ul li p a{
323 border-bottom: 1px dotted #333;306 border-bottom: 1px dotted #333;
324 clear: both;307 clear: both;
325 display: block;308 display: block;
309 padding: 5px 0px 3px;
310}
311
312.p {
313 font-family: 'EntypoRegular';
314 font-size: 90px;
315 position: relative;
316 color: #333;
317 margin: 4px 5px 0 0;
318 height: 20px;
319 display: block;
320 float: left;
321 line-height: 48px;
322 width: 67px;
323 text-align: center;
324}
325
326.p:after { content: "0"; padding-left: 4px;}
327
328#venue-map {
329 height: 200px;
330 margin-top: 5px;
331 margin-bottom: 10px;
332}
333
334.venue-map {
335 min-height: 250px;
336}
337
338.f {
339 float: left;
340}
341
342.f img {
343 width: 50px;
344 height: 50px;
345 margin-bottom: 5px;
346}
347
348.f0 {
326 float: none;349 float: none;
327 padding: 5px 0px 3px;350 display: block;
328}351 margin-bottom: 5px;
352}
353
354.f0 img {
355 width: 200px;
356 height: 200px;
357}
358
329359
330#site_search_form {360#site_search_form {
331 width: auto;361 width: auto;
332362
=== modified file 'loco_directory/templates/teams/team_detail.html'
--- loco_directory/templates/teams/team_detail.html 2013-02-10 15:06:06 +0000
+++ loco_directory/templates/teams/team_detail.html 2013-02-21 20:33:20 +0000
@@ -75,12 +75,12 @@
75 <div style="display:block;">75 <div style="display:block;">
76 <div id="loco-location">76 <div id="loco-location">
77 <span title="{% trans "Location" %}" class="pictogram place"></span>77 <span title="{% trans "Location" %}" class="pictogram place"></span>
78 <span class="value ellipsis small-ellipsis">78 <span class="value ellipsis medium-ellipsis">
79 {% if team.countries.all %}79 {% if team.countries.all %}
80 {% for country in team.countries.all %}80 {% for country in team.countries.all %}
81 {% if not forloop.first %}, {% endif %}{{ country.name }}81 {% if not forloop.first %}, {% endif %}{{ country.name }}
82 {% endfor %}82 {% endfor %}
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 }}
84 {% endif %}84 {% endif %}
85 {% else %}85 {% else %}
86 {% trans "None Specified" %}86 {% trans "None Specified" %}
@@ -100,17 +100,6 @@
100 {% endif %}100 {% endif %}
101 </span>101 </span>
102 </div>102 </div>
103
104 <div id="loco-support">
105 <span title="{% trans "Local Support" %}" class="pictogram support"></span>
106 <span class="value ellipsis medium-ellipsis">
107 {% if team.provides_support %}
108 {% trans "This LoCo provides support :)" %}
109 {% else %}
110 {% trans "This LoCo doesn't provide support :(" %}
111 {% endif %}
112 </span>
113 </div>
114 </div>103 </div>
115104
116 <div style="display:block;">105 <div style="display:block;">
@@ -162,6 +151,17 @@
162 </span>151 </span>
163 </div>152 </div>
164153
154 <div id="loco-location">
155 <span title="{% trans "Local Support" %}" class="pictogram support"></span>
156 <span class="value ellipsis medium-ellipsis">
157 {% if team.provides_support %}
158 {% trans "This LoCo provides support :)" %}
159 {% else %}
160 {% trans "This LoCo doesn't provide support :(" %}
161 {% endif %}
162 </span>
163 </div>
164
165 </div>165 </div>
166 </div>166 </div>
167 </div>167 </div>
168168
=== modified file 'loco_directory/templates/venues/venue_detail.html'
--- loco_directory/templates/venues/venue_detail.html 2012-06-02 11:50:27 +0000
+++ loco_directory/templates/venues/venue_detail.html 2013-02-21 20:33:20 +0000
@@ -1,27 +1,126 @@
1{% extends "base.html" %}1{% extends "base.html" %}
2{% load i18n %}2{% load i18n markup %}
33
4{% block page_name %}{% trans venue_object.name %}{% endblock %}4{% block page_name %}{% trans venue.name %}{% endblock %}
55
6{% block extrahead %}{{block.super}}6{% block extrahead %}{{block.super}}
7<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://maps.google.com/maps/api/js?sensor=false&language={% trans 'en' %}&region={% trans 'US' %}"></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>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 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>
10
11<script type="text/javascript">
12$(document).ready(function(){
13 var x = {{ venue.longitude }},
14 y = {{ venue.latitude }},
15 km = 0.0089930, // 1km
16 radius = 5,
17 minx = x-radius/2*km,
18 miny = y-radius/2*km,
19 maxx = x+radius/2*km,
20 maxy = y+radius/2*km;
21
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){
23 $.each(data.photos, function(i,item){
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>');
25 });
26 });
27});
28</script>
10{% endblock %}29{% endblock %}
11<div class="row">30<div class="row">
12<section class="span-6">31<section class="span-6">
1332
14{% block sub_nav_links %}33{% block sub_nav_links %}
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>
16{% if venue_object.country %}35{% if venue.country %}
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>
18{% else %}37{% else %}
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>
20{% endif %}39{% endif %}
21{% endblock %}40{% endblock %}
2241
23{% block content %}42{% block content %}
2443<div class="row">
25{% include "venues/venue_detail.inc.html" %}44 <section class="span-9">
2645 <div class="box_content">
46 <div class="pagelet">
47 <h2>{{ venue.name }}</h2>
48 <div id="loco-location">
49 <div id="loco-location">
50 <span title="{% trans "Location" %}" class="pictogram place"></span>
51 <span class="value">
52 {% if venue.address %}{{ venue.address }}{% endif %}
53 {% if venue.country %}{{ venue.country }}{% endif %}
54 {% if venue.spr %}, {{ venue.spr }}{% endif %}{% if venue.city %}, {{ venue.city }}{% endif %}
55 </span>
56 </div>
57
58 {% if venue.tz %}
59 <div>
60 <span title="{% trans "Timezone" %}" class="pictogram calendar"></span>
61 <span class="pictogram-l">
62 {{ venue.tz }}
63 </span>
64 </div>
65 {% endif %}
66
67 {% if venue.venue_url %}
68 <div>
69 <span class="pictogram announcement"></span>
70 <a class="pictogram-l" href="{{ venue.venue_url }}">{{ venue.venue_url }}</a>
71 </div>
72 {% endif %}
73 </div>
74
75 {% if venue.comment %}
76 <div>
77 <h3 style="margin-top: 10px; margin-bottom: 10px;">{% trans "Comment" %}</h3>
78 {{ venue.comment|markdown:'safe' }}
79 </div>
80 {% endif %}
81 </div>
82 {% if venue.longitude and venue.latitude %}
83 <div id="venue-map"></div>
84 <script>
85 $(function(){
86 $('#venue-map').showLocations({
87 markers_list: [{ lat: {{ venue.latitude }}, lng: {{ venue.longitude }} }],
88 marker_icon: '{{ MEDIA_URL }}img/marker.png'
89 });
90 });
91 </script>
92 {% endif %}
93
94
95 <div class="events-meetings-wrapper">
96 <div style="overflow: auto;">
97 <h3 class="title">{% trans "Upcoming Events" %}</h3>
98 </div>
99 {% if events %}
100 {% for team_event in events %}
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">
102 <span class="title">{{ team_event.name }}</span>
103 <small>{{ team_event.local_date_begin|date:"l, d N Y" }} {% trans "at " %}{{ team_event.local_date_begin|date:"H:i T" }}</small>
104 <p>{{ team_event.description }}</p>
105 </a>
106 {% endfor %}
107 {% else %}
108 <div class="no-results">
109 {% trans "There are currently no upcoming events on this venue" %}
110 </div>
111 {% endif %}
112 </div>
113
114 </div>
115 </section>
116 <section class="span-3 box_content last">
117 <div class="sidebar-inner">
118 <h3 class="title">{% trans "Photos" %}</h3>
119 <div id="pamdiv"></div>
120 {% if venue.address %}
121 <h3 class="attendees-title"><a href="https://maps.google.com/maps?saddr=&daddr={{ venue.address }}">{% trans "Get directions to this venue" %}</a></h3>
122 {% endif %}
123 </div>
124 </section>
125</div>
27{% endblock %}126{% endblock %}
28127
=== removed file 'loco_directory/templates/venues/venue_detail.inc.html'
--- loco_directory/templates/venues/venue_detail.inc.html 2012-06-02 11:50:27 +0000
+++ loco_directory/templates/venues/venue_detail.inc.html 1970-01-01 00:00:00 +0000
@@ -1,21 +0,0 @@
1{% load i18n %}
2<div class="row">
3<section class="span-6">
4 <h2>{{venue_object.name}}</h2>
5 <p>{% include "venues/venue_detail_basic.inc.html" %}</p>
6</section>
7
8{% if venue_object.longitude and venue_object.latitude %}
9<section class="span-6 last alone venue-map" id="venue-map">
10</article>
11<script>
12 $(function(){
13 $('#venue-map').showLocations({
14 markers_list: [{ lat: {{ venue_object.latitude }}, lng: {{ venue_object.longitude }} }],
15 marker_icon: '{{ MEDIA_URL }}img/marker.png'
16 });
17 });
18</script>
19</setion>
20</div>
21{% endif %}
220
=== removed file 'loco_directory/templates/venues/venue_detail_basic.inc.html'
--- loco_directory/templates/venues/venue_detail_basic.inc.html 2012-02-07 14:36:29 +0000
+++ loco_directory/templates/venues/venue_detail_basic.inc.html 1970-01-01 00:00:00 +0000
@@ -1,67 +0,0 @@
1{% load i18n markup %}
2<table>
3{% if venue_object %}
4 {% if venue_object.name %}
5 <tr>
6 <th class="form-item-label" scope="row">{% trans "Location name:" %}</th>
7 <td>{{ venue_object.name }}</td>
8 </tr>
9 {% endif %}
10 {% if venue_object.address %}
11 <tr>
12 <th class="form-item-label" scope="row">{% trans "Address:" %}</th>
13 <td class="form-item-value">{{ venue_object.address }}</td>
14 </tr>
15 {% endif %}
16 {% if venue_object.city %}
17 <tr>
18 <th class="form-item-label" scope="row">{% trans "City:" %}</th>
19 <td class="form-item-value">{{ venue_object.city }}</td>
20 </tr>
21 {% endif %}
22 {% if venue_object.spr %}
23 <tr>
24 <th class="form-item-label" scope="row">{% trans "State/Province/Region:" %}</th>
25 <td class="form-item-value">{{ venue_object.spr }}</td>
26 </tr>
27 {% endif %}
28 {% if venue_object.country %}
29 <tr>
30 <th class="form-item-label" scope="row">{% trans "Country:" %}</th>
31 <td class="form-item-value">{{ venue_object.country }}</td>
32 </tr>
33 {% endif %}
34 {% if venue_object.tz %}
35 <tr>
36 <th class="form-item-label" scope="row">{% trans "Timezone:" %}</th>
37 <td class="form-item-value">{{ venue_object.tz }}</td>
38 </tr>
39 {% endif %}
40 {% if venue_object.venue_url %}
41 <tr>
42 <th class="form-item-label" scope="row">{% trans "Homepage:" %}</th>
43 <td class="form-item-value"><a href="{{ venue_object.venue_url }}">{{ venue_object.venue_url }}</a></td>
44 </tr>
45 {% endif %}
46 {% if venue_object.longitude %}
47 <tr>
48 <th class="form-item-label" scope="row">{% trans "Longitude:" %}</th>
49 <td class="form-item-value">{{ venue_object.longitude }}</td>
50 </tr>
51 {% endif %}
52 {% if venue_object.latitude %}
53 <tr>
54 <th class="form-item-label" scope="row">{% trans "Latitude:" %}</th>
55 <td class="form-item-value">{{ venue_object.latitude }}</td>
56 </tr>
57 {% endif %}
58 {% if venue_object.comment %}
59 <tr>
60 <th class="form-item-label" scope="row">{% trans "Comment:" %}</th>
61 <td class="form-item-value">{{ venue_object.comment|markdown:'safe' }}</td>
62 </tr>
63 {% endif %}
64{% endif %}
65</table>
66
67
680
=== modified file 'loco_directory/templates/venues/venue_list.html'
--- loco_directory/templates/venues/venue_list.html 2012-06-02 11:50:27 +0000
+++ loco_directory/templates/venues/venue_list.html 2013-02-21 20:33:20 +0000
@@ -3,66 +3,84 @@
33
4{% block page_name %}{% trans "Ubuntu LoCo Event Venues" %}{% endblock %}4{% block page_name %}{% trans "Ubuntu LoCo Event Venues" %}{% endblock %}
55
6{% block sub_nav_links %}
7 <li><a class="sub-nav-item" href="{% url venue-new %}">{% trans "Add New Venue" %}</a></li>
8{% endblock %}
9
10{% block content %}6{% block content %}
11<div class="row">7<div class="row">
12<section class="span-12">8 <section class="span-9">
13 <h2>{% trans "Ubuntu LoCo Event Venues" %}</h2>9 <div class="box_content">
1410 <div class="pagelet">
15 {% if continent_list or venues_with_country or venues_without_country %}11 <h2>{% trans "Ubuntu LoCo Event Venues" %}</h2>
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 %}
17 {% if continent_list %}13 {% if continent_list %}
18 {% for continent in continent_list %}14 {% for continent in continent_list %}
19 <div class="venue-list">15 <div class="venues-list">
20 <h3>{{ continent.name }}</h3>16 <h2>{{ continent.name }}</h2>
21 <ul>17 <ul>
22 {% regroup continent.venue_list by country as country_list %}18 {% regroup continent.venue_list by country as country_list %}
23 {% for country in country_list %}19 {% for country in country_list %}
24 <li><h3>{{ country.grouper }}</h3>20 <li>
21 <h3>{{ country.grouper }}</h3>
25 {% for venue in country.list %}22 {% for venue in country.list %}
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">
24 <span class="p"></span>
25 <div style="float: left; padding: 10px; width:560px;">
26 <a href="{{ venue.get_absolute_url }}">{{ venue.name }}</a><br /><br />{% if venue.city %}{{ venue.city }}{% endif %}{% if venue.spr %}, {{ venue.spr }}{% endif %}
27 <br />{% if venue.address %}{{ venue.address }}{% else %}{{ venue.latitude }}, {{ venue.longitude }}{% endif %}
28 </div>
29 </div>
27 {% endfor %}30 {% endfor %}
28 </li>31 </li>
29 {% endfor %}32 {% endfor %}
30 </ul>33 </ul>
31 </div>34 </div>
32 {% endfor %}35 {% endfor %}
33 {% endif %}36 {% endif %}
34 37
35 {% if venues_with_country %} 38 {% if venues_with_country %}
36 <div class="venue-list">39 <div class="venues-list">
37 <h3>{% trans "Countries without Continent" %}</h3>40 <h2>{% trans "Countries without Continent" %}</h2>
38 <ul>41 <ul>
39 {% regroup venues_with_country by country as country_list %}42 {% regroup venues_with_country by country as country_list %}
40 {% for country in country_list %}43 {% for country in country_list %}
41 <li><h3>{{ country.grouper }}</h3>44 <li>
42 {% for venue in country.list %}45 <h3>{{ country.grouper }}</h3>
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 %}
47 <div class="venue-d">
48 <span class="p"></span>
49 <div style="float: left; padding: 10px; width:560px;">
50 <a href="{{ venue.get_absolute_url }}">{{ venue.name }}</a><br /><br />{% if venue.city %}{{ venue.city }}{% endif %}{% if venue.spr %}, {{ venue.spr }}{% endif %}
51 <br />{% if venue.address %}{{ venue.address }}{% else %}{{ venue.latitude }}, {{ venue.longitude }}{% endif %}
52 </div>
53 </div>
54 {% endfor %}
55 </li>
56 {% endfor %}
57 </ul>
58 </div>
59 {% endif %}
60
61 {% if venues_without_country %}
62 <div class="venues-list">
63 <h2>{% trans "Venues without Country" %}</h2>
64 <ul>
65 {% for venue in venues_without_country %}
66 <li>
67 <div class="venue-d">
68 <span class="p"></span>
69 <div style="float: left; padding: 10px; width:560px;">
70 <a href="{{ venue.get_absolute_url }}">{{ venue.name }}</a><br /><br />{% if venue.city %}{{ venue.city }}{% endif %}{% if venue.spr %}, {{ venue.spr }}{% endif %}
71 <br />{% if venue.address %}{{ venue.address }}{% else %}{{ venue.latitude }}, {{ venue.longitude }}{% endif %}
72 </div>
73 </div>
74 </li>
44 {% endfor %}75 {% endfor %}
45 </li>76 </ul>
46 {% endfor %}77 </div>
47 </ul>78 {% endif %}
48 </div>79 {% else %}
49 {% endif %}80 <p>{% trans "There are currently no LoCo Venues :(" %}</p>
50 81 {% endif %}
51 {% if venues_without_country %}
52 <div class="venue-list">
53 <h3>{% trans "Venues without Country" %}</h3>
54 <ul>
55 {% for venue in venues_without_country %}
56 <li>
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>
58 </li>
59 {% endfor %}
60 </ul>
61 </div>82 </div>
62 {% endif %}83 </div>
63 {% else %}84 </section>
64 <p>{% trans "There are currently no LoCo Venues :(" %}</p>
65 {% endif %}
66</section>
67</div>85</div>
68{% endblock %}86{% endblock %}
6987
=== modified file 'loco_directory/templates/venues/venue_update.html'
--- loco_directory/templates/venues/venue_update.html 2012-12-26 17:23:50 +0000
+++ loco_directory/templates/venues/venue_update.html 2013-02-21 20:33:20 +0000
@@ -15,8 +15,6 @@
15 html_lat: $("#id_latitude"),15 html_lat: $("#id_latitude"),
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"),
17 marker_icon: '{{ MEDIA_URL }}img/marker.png'});17 marker_icon: '{{ MEDIA_URL }}img/marker.png'});
18
19 $('span[rel*=help]').colorTip({color:'orange'});
20 });18 });
21//]]>19//]]>
22</script>20</script>
@@ -24,16 +22,18 @@
2422
25{% block content %}23{% block content %}
26<div class="row">24<div class="row">
27<section class="span-9">25 <section class="span-9">
28 <form action="." method="post" style="width:auto;">{% csrf_token %}26 <div class="box_content">
29 <fieldset>27 <div class="pagelet">
30 <h3>{% if venue_object %}{% trans "Update Venue" %}{% else %}{% trans "New Venue" %}{% endif %}</h3>28 <form action="." method="post" class="form">{% csrf_token %}
31 {{ form.as_template }}29 <h2>{% if venue_object %}{% trans "Update Venue" %}{% else %}{% trans "New Venue" %}{% endif %}</h2>
32 </fieldset>30 {{ form.as_template }}
33 {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %}31 {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %}
34 <input type="submit" name="submit" value="Submit" class="submit-button" /> 32 <input type="submit" name="submit" value="Submit" class="submit-button" />
35 </form>33 </form>
36</section>34 </div>
35 </div>
36 </section>
37</div>37</div>
3838
39<section class="minor-content alone venue-map" id="venue-map-selector" title="{% trans "Select venue position" %}">&nbsp;</section>39<section class="minor-content alone venue-map" id="venue-map-selector" title="{% trans "Select venue position" %}">&nbsp;</section>
4040
=== modified file 'loco_directory/venues/forms.py'
--- loco_directory/venues/forms.py 2012-12-28 21:03:08 +0000
+++ loco_directory/venues/forms.py 2013-02-21 20:33:20 +0000
@@ -22,14 +22,10 @@
22 model = Venue22 model = Venue
2323
24 class Media:24 class Media:
25 css = {'all': (
26 settings.MEDIA_URL + 'css/colortip-1.0-jquery.css',
27 )}
28 js = (25 js = (
29 'http://maps.google.com/maps/api/js?sensor=false&language=%(language)s&region=%(region)s' % {'language': _('en'), 'region': _('US')},26 'http://maps.google.com/maps/api/js?sensor=false&language=%(language)s&region=%(region)s' % {'language': _('en'), 'region': _('US')},
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',
31 settings.MEDIA_URL + 'js/jquery-ubuntu-maps.js',28 settings.MEDIA_URL + 'js/jquery-ubuntu-maps.js'
32 settings.MEDIA_URL + 'js/colortip-1.0-jquery.js',
33 )29 )
3430
35 def clean(self):31 def clean(self):
3632
=== modified file 'loco_directory/venues/models.py'
--- loco_directory/venues/models.py 2012-12-03 22:19:34 +0000
+++ loco_directory/venues/models.py 2013-02-21 20:33:20 +0000
@@ -7,13 +7,16 @@
7from common.mixins import LocalTimeMixin7from common.mixins import LocalTimeMixin
88
9import pytz9import pytz
10import datetime
1011
1112
12class VenueManager(models.Manager):13class VenueManager(models.Manager):
13 """14 """
14 a manager class for Venues15 a manager class for Venues
15 """16 """
16 pass17 def next_5_events(self):
18 """ a list with the next 5 events """
19 return self.filter(date_end__gt=datetime.datetime.now()).order_by('date_end')[:5]
1720
1821
19class Venue(models.Model, LocalTimeMixin):22class Venue(models.Model, LocalTimeMixin):
2023
=== modified file 'loco_directory/venues/urls.py'
--- loco_directory/venues/urls.py 2012-06-03 18:23:49 +0000
+++ loco_directory/venues/urls.py 2013-02-21 20:33:20 +0000
@@ -4,10 +4,10 @@
4 #venues4 #venues
5 url(r'^$', 'venues.views.venue_list', name='venue-list'),5 url(r'^$', 'venues.views.venue_list', name='venue-list'),
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'),
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'),
8 url(r'add/$', 'venues.views.venue_new', name='venue-new'),8 url(r'add/$', 'venues.views.venue_new', name='venue-new'),
99
10 # Old urls for compatibility10 # Old urls for compatibility
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': ''}),
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': ''}),
13)13)
1414
=== modified file 'loco_directory/venues/views.py'
--- loco_directory/venues/views.py 2012-06-03 18:23:49 +0000
+++ loco_directory/venues/views.py 2013-02-21 20:33:20 +0000
@@ -42,9 +42,11 @@
42 """42 """
43 detailed view for a venue43 detailed view for a venue
44 """44 """
45 venue_object = get_object_or_404(Venue, pk=venue_id)45 venue = get_object_or_404(Venue, pk=venue_id)
46 events = venue.teamevent_set.next_5_events()
46 context = {47 context = {
47 'venue_object': venue_object,48 'venue': venue,
49 'events': events,
48 }50 }
49 return render_to_response('venues/venue_detail.html',51 return render_to_response('venues/venue_detail.html',
50 context, RequestContext(request))52 context, RequestContext(request))

Subscribers

People subscribed via source and target branches