diff options
author | luxagraf <sng@luxagraf.net> | 2021-08-16 20:10:42 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2021-08-16 20:10:42 -0400 |
commit | c3907cd3e61161a264ab0daf6b26262a40876393 (patch) | |
tree | a843d66cbca73331ede1b2dbc39951e2b09fa2a8 /app/planner/templates/planner | |
parent | 791da875bb519bf8e21d075c89bc603aed6936f3 (diff) |
plan: added pins to map, trip to admin, and fixed some model bugs
Diffstat (limited to 'app/planner/templates/planner')
-rw-r--r-- | app/planner/templates/planner/list.html | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/planner/templates/planner/list.html b/app/planner/templates/planner/list.html index b426c57..ce7650e 100644 --- a/app/planner/templates/planner/list.html +++ b/app/planner/templates/planner/list.html @@ -32,7 +32,14 @@ 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>{{object.name}}<\/h4><p class="date">Arrive: Afternoon, {{object.date_arrive|date:"M j, Y"}}<\/p><p class="date">Depart: Afternoon, {{object.date_depart|date:"M j, Y"}}<\/p><\/div>').addTo(mymap); + {%endfor%} </script> {% endblock %} |