Added a basic place_view

This commit is contained in:
Marcus Scholz 2020-07-26 22:19:37 +02:00
parent aa1fee05da
commit 114ec0d1ea
3 changed files with 18 additions and 1 deletions

View File

@ -16,7 +16,6 @@
</div> </div>
<article> <article>
{{> @headline headline='Map Links'}}
<a class="LP-Link" href="https://www.google.com/maps?q={{place.latitude}},{{place.longitude}}" target="blank"><span class="LP-Text">Google Maps</span></a> <a class="LP-Link" href="https://www.google.com/maps?q={{place.latitude}},{{place.longitude}}" target="blank"><span class="LP-Text">Google Maps</span></a>
<a class="LP-Link" href="https://www.tim-online.nrw.de/tim-online2/?center={{place.latitude}},{{place.longitude}}&icon=true&bg=dop" target="blank"><span class="LP-Text">TIM Online (GER/NRW Only)</span></a> <a class="LP-Link" href="https://www.tim-online.nrw.de/tim-online2/?center={{place.latitude}},{{place.longitude}}&icon=true&bg=dop" target="blank"><span class="LP-Text">TIM Online (GER/NRW Only)</span></a>
<a class="LP-Link" href="http://www.openstreetmap.org/?mlat={{place.latitude}}&mlon={{place.longitude}}&zoom=16" target="blank"><span class="LP-Text">Open Street Map</span></a> <a class="LP-Link" href="http://www.openstreetmap.org/?mlat={{place.latitude}}&mlon={{place.longitude}}&zoom=16" target="blank"><span class="LP-Text">Open Street Map</span></a>

View File

@ -0,0 +1,7 @@
from django.urls import path
from .views import hello_world, place_detail_view
urlpatterns = [
path('hello_world/', hello_world),
path('place/<int:pk>/', place_detail_view)
]

View File

@ -0,0 +1,11 @@
from django.shortcuts import render
from .models import Place
# Create your views here.
def place_detail_view(request, pk):
return render(request, 'placeOverview.html', {'place':Place.objects.get(pk=pk)
})
def hello_world(request):
return render(request, 'hello_world.html', {'text':'Hello World!'})