location_page.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. {% extends "base.html" %}
  2. {% load wagtailimages_tags %}
  3. {% block head-extra %}
  4. <style>
  5. /* Needed for Google map embed */
  6. #map {
  7. height: 100%;
  8. }
  9. .maps.embed-container {
  10. pointer-events: none;
  11. }
  12. html, body {
  13. height: 100%;
  14. margin: 0;
  15. padding: 0;
  16. }
  17. </style>
  18. {% endblock head-extra %}
  19. {% block content-header %}
  20. <h1>{{ page.title }}</h1>
  21. <figure>
  22. {% image self.image fill-600x600 %}
  23. </figure>
  24. {% endblock content-header %}
  25. {% block content-body %}
  26. <p>{{ page.address }}</p>
  27. <p>{{ page.lat_long }}</p>
  28. <div id="map" class="maps embed-container"></div>
  29. <script>
  30. var map;
  31. function initMap() {
  32. map = new google.maps.Map(document.getElementById('map'), {
  33. center: {
  34. lat: {{lat}},
  35. lng: {{long}}
  36. },
  37. zoom: 8
  38. });
  39. var marker = new google.maps.Marker({
  40. position: {
  41. lat: {{lat}},
  42. lng: {{long}}
  43. },
  44. map: map,
  45. title: '{{page.title}}'
  46. });
  47. }
  48. </script>
  49. <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD31CT9P9KxvNUJOwDq2kcFEIG8ADgaFgw&callback=initMap" async defer></script>
  50. {% for hours in page.opening_hours %}
  51. <li>{{ hours }}</li>
  52. {% endfor %}
  53. {% endblock content-body %}