# HG changeset patch
# User Brian Neal
# Date 1411935795 18000
# Node ID b9973588af28b8a29f59be22daacd9e2bea71c95
# Parent 5a00dcf563a81dc75c9eca9b4f32ac4a0d3c4bca
Bandmap: use green & red markers for active/inactive.
Other tweaks to admin & added explanatory text.
diff -r 5a00dcf563a8 -r b9973588af28 bandmap/admin.py
--- 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']
diff -r 5a00dcf563a8 -r b9973588af28 bandmap/static/js/bandmap.js
--- 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);
diff -r 5a00dcf563a8 -r b9973588af28 bandmap/views.py
--- 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)
diff -r 5a00dcf563a8 -r b9973588af28 sg101/templates/bandmap/add.html
--- 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.
+
+ 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.
+