diff options
author | lxf <sng@luxagraf.net> | 2022-02-06 14:17:39 -0500 |
---|---|---|
committer | lxf <sng@luxagraf.net> | 2022-02-06 14:17:39 -0500 |
commit | c2b290f453b76ae0374d60aed6cc653512a1ab0c (patch) | |
tree | 93e92f7d04aecd470719022d856f298eb334c522 /app/planner | |
parent | 129e788c7bd41be000ddc18dd5252a66fc1bee03 (diff) |
plan: added state to list and link to info window in map view
Diffstat (limited to 'app/planner')
-rw-r--r-- | app/planner/templates/planner/idea-list.html | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/planner/templates/planner/idea-list.html b/app/planner/templates/planner/idea-list.html index 1a3007c..7785288 100644 --- a/app/planner/templates/planner/idea-list.html +++ b/app/planner/templates/planner/idea-list.html @@ -6,7 +6,7 @@ <div class=""> {% for object in object_list %} <article> - <h3 class="campname">{{object.name}} <small><a href="{% url 'luxplanner:update' object.pk %}">edit</a></small></h3> + <h3 class="campname">{{object.state}} - {{object.name}} <small><a href="{% url 'luxplanner:update' object.pk %}">edit</a></small></h3> <div class="notes">{{object.notes_html|safe|urlize}}</div> <ul class="icons"> {% if object.has_water %}<li class="water">water</li>{% endif %} @@ -30,6 +30,13 @@ attribution: 'Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, ' + 'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>', }).addTo(mymap); - + {% for object in object_list %} + {% if forloop.counter == 1 %} + centerCoord = new L.LatLng({{object.latitude}}, {{object.longitude}}); + //Set center + mymap.setView(centerCoord, 7); + {% endif %} + L.marker([{{object.latitude}}, {{object.longitude}}]).bindPopup('<div class="infowin"><h4><a href="{{object.name}}" class="date">{{object.name}}<\/a><\/h4><\/div>').addTo(mymap); + {%endfor%} </script> {% endblock %} |