Added OSM map to place_detail view and template.
This commit is contained in:
parent
7cb8bc6bac
commit
3ef31eda0f
@ -1,5 +1,9 @@
|
||||
{% extends 'global.html'%}
|
||||
{% load static %}
|
||||
{% block additional_head %}
|
||||
<link rel="stylesheet" href="{% static 'maps/ol.css' %}" type="text/css">
|
||||
<script src="{% static 'maps/ol.js' %}"></script>
|
||||
{% endblock additional_head %}
|
||||
{% load thumbnail %}
|
||||
|
||||
{% block title %}{{place.name}}{% endblock %}
|
||||
@ -27,6 +31,7 @@
|
||||
|
||||
<section class="LP-Section">
|
||||
<h1 class="LP-Headline">Map-Links</h1>
|
||||
{% include 'partials/osm_map.html' %}
|
||||
<div class="LP-LinkList">
|
||||
<ul class="LP-LinkList__List">
|
||||
<li class="LP-LinkList__Item"><a target="_blank" href="https://www.google.com/maps?q={{place.latitude}},{{place.longitude}}" class="LP-Link"><span class="LP-Text">Google Maps</span></a></li>
|
||||
|
@ -57,8 +57,11 @@ class PlaceListView(IsAuthenticated, ListView):
|
||||
|
||||
class PlaceDetailView(IsAuthenticated, View):
|
||||
def get(self, request, pk):
|
||||
place = Place.objects.get(pk=pk)
|
||||
context = {
|
||||
'place': Place.objects.get(pk=pk)
|
||||
'place': place,
|
||||
'place_list': [ place ],
|
||||
'place_map_center': [ place.latitude, place.longitude ]
|
||||
}
|
||||
return render(request, 'place/place_detail.html', context)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user