Mercurial > public > sg101
changeset 831:0f9c014c8adc
Bandmap: don't need to send URL to javascript client.
Also tweaking note as I am noticing it isn't getting rendered
correctly on all bands for some reason.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 28 Sep 2014 20:42:57 -0500 |
parents | b9973588af28 |
children | c285a86fb4d5 |
files | bandmap/views.py sg101/templates/bandmap/balloon.html |
diffstat | 2 files changed, 5 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/bandmap/views.py Sun Sep 28 15:23:15 2014 -0500 +++ b/bandmap/views.py Sun Sep 28 20:42:57 2014 -0500 @@ -66,13 +66,14 @@ bands = [] for band in qs.iterator(): + note = render_to_string('bandmap/balloon.html', {'band': band}) + note = note.strip().replace('\n', '') bands.append({ 'name': band.name, - 'url': band.url, 'lat': band.lat, 'lon': band.lon, 'is_active': band.is_active, - 'note': render_to_string('bandmap/balloon.html', {'band': band}), + 'note': note, }) results = json.dumps(bands)
--- a/sg101/templates/bandmap/balloon.html Sun Sep 28 15:23:15 2014 -0500 +++ b/sg101/templates/bandmap/balloon.html Sun Sep 28 20:42:57 2014 -0500 @@ -4,12 +4,7 @@ {% else %} <strong>{{ band.name }}</strong> {% endif %} -<em> -{% if band.is_active %} -(Active) -{% else %} -(Inactive) +{% if band.note %} +<br />{{ band.note }} {% endif %} -</em><br /> -{{ band.note }} </div>