changeset 830:b9973588af28

Bandmap: use green & red markers for active/inactive. Other tweaks to admin & added explanatory text.
author Brian Neal <bgneal@gmail.com>
date Sun, 28 Sep 2014 15:23:15 -0500
parents 5a00dcf563a8
children 0f9c014c8adc
files bandmap/admin.py bandmap/static/js/bandmap.js bandmap/views.py sg101/templates/bandmap/add.html sg101/templates/bandmap/map.html
diffstat 5 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bandmap/admin.py	Sun Sep 28 11:48:23 2014 -0500
+++ b/bandmap/admin.py	Sun Sep 28 15:23:15 2014 -0500
@@ -14,7 +14,7 @@
 
 
 class BandEntryAdmin(admin.ModelAdmin):
-    list_display = ['name', 'date_submitted', 'date_approved', 'is_active',
+    list_display = ['name', 'date_submitted', 'location', 'is_active',
             'is_approved']
     date_hierarchy = 'date_submitted'
     list_filter = ['date_submitted', 'is_active', 'is_approved']
--- a/bandmap/static/js/bandmap.js	Sun Sep 28 11:48:23 2014 -0500
+++ b/bandmap/static/js/bandmap.js	Sun Sep 28 15:23:15 2014 -0500
@@ -53,7 +53,10 @@
                var marker = new google.maps.Marker({
                   position: {lat: band.lat, lng: band.lon},
                   title: band.name,
+                  icon: band.is_active ? "http://maps.google.com/mapfiles/ms/icons/green-dot.png"
+                                       : "http://maps.google.com/mapfiles/ms/icons/red-dot.png",
                   map: bandmap
+
                });
                google.maps.event.addListener(marker, 'click', function() {
                   info_win.setContent(band.note);
--- a/bandmap/views.py	Sun Sep 28 11:48:23 2014 -0500
+++ b/bandmap/views.py	Sun Sep 28 15:23:15 2014 -0500
@@ -71,6 +71,7 @@
             'url': band.url,
             'lat': band.lat,
             'lon': band.lon,
+            'is_active': band.is_active,
             'note': render_to_string('bandmap/balloon.html', {'band': band}),
         })
     results = json.dumps(bands)
--- a/sg101/templates/bandmap/add.html	Sun Sep 28 11:48:23 2014 -0500
+++ b/sg101/templates/bandmap/add.html	Sun Sep 28 15:23:15 2014 -0500
@@ -18,6 +18,11 @@
 a frequently played venue). Any text that you can use on Google Maps can be
 used here.
 </p>
+<div class="notice">
+   Please try to be as specific as possible for a location. Bands with the
+   exact same location will have map pins that stack on top of each other, and
+   it will be difficult to find them on the map.
+</div>
 <p>
 Example locations:
 </p>
--- a/sg101/templates/bandmap/map.html	Sun Sep 28 11:48:23 2014 -0500
+++ b/sg101/templates/bandmap/map.html	Sun Sep 28 15:23:15 2014 -0500
@@ -14,6 +14,11 @@
                </select> <button id="map-filter-go">Go</button></li>
       <li><a href="{% url 'bandmap-add' %}">Add a band to the map</a></li>
    </ul>
+   <p>Map key:</p>
+   <ul>
+      <li>Active bands: <img src="http://maps.google.com/mapfiles/ms/icons/green-dot.png" alt="active marker" /></li>
+      <li>Inactive bands: <img src="http://maps.google.com/mapfiles/ms/icons/red-dot.png" alt="inactive marker" /></li>
+   </ul>
 </div>
 <p>
 If you have any corrections or suggestions for bands on the map, please