summaryrefslogtreecommitdiff
path: root/app/planner
diff options
context:
space:
mode:
authorlxf <sng@luxagraf.net>2022-02-06 14:17:39 -0500
committerlxf <sng@luxagraf.net>2022-02-06 14:17:39 -0500
commitc2b290f453b76ae0374d60aed6cc653512a1ab0c (patch)
tree93e92f7d04aecd470719022d856f298eb334c522 /app/planner
parent129e788c7bd41be000ddc18dd5252a66fc1bee03 (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.html11
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 &copy; <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 %}