2
0

location_page.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {% extends "base.html" %}
  2. {% load wagtailimages_tags navigation_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. </style>
  13. {% endblock head-extra %}
  14. {% block content-header %}
  15. {# @TODO This is identical to the header within blog_page.html. We should create an include #}
  16. {% image self.image fill-1920x600 as hero_img %}
  17. <div class="container-fluid hero" style="background-image:url('{{ hero_img.url }}')">
  18. <div class="hero-gradient-mask"></div>
  19. <div class="container">
  20. <div class="row">
  21. <div class="col-md-7 col-md-offset-2">
  22. <h1>{{ page.title }}</h1>
  23. <p class="stand-first">{{ page.subtitle }}</p>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. {% endblock content-header %}
  29. {% block content-body %}
  30. <div class="container">
  31. <div class="row">
  32. <div class="col-md-7 col-md-offset-2">
  33. <div class="row">
  34. {% if page.introduction %}
  35. <div class="intro col-md-7"><p>{{ page.introduction }}</p></div>
  36. {% endif %}
  37. {% if page.opening_hours %}
  38. <div class="col-md-4 col-md-offset-1 location-opening">
  39. <h3>Opening hours</h3>
  40. {% for hours in page.opening_hours %}
  41. <time itemprop="openingHours" datetime="{{ hours }}" class="location-time">
  42. <span class="day">{{ hours.day }}</span>:
  43. <span class="hours">
  44. {% if hours.closed == True %}
  45. Closed
  46. {% else %}
  47. {% if hours.opening_time %}
  48. {{ hours.opening_time }}
  49. {% endif %} -
  50. {% if hours.closing_time %}
  51. {{ hours.closing_time }}
  52. {% endif %}
  53. {% endif %}
  54. </span></time>
  55. {% endfor %}
  56. </div>
  57. {% endif %}
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="container-flex">
  63. <div class="row">
  64. <div class="col-md-2 col-md-offset-7 location-address">
  65. <h3>Address</h3>
  66. <address>{{ page.address|linebreaks }}</address>
  67. </div>
  68. {# @TODO align address to opening hours? #}
  69. </div>
  70. <div class="map-container">
  71. <div id="map" class="maps embed-container"></div>
  72. </div>
  73. </div>
  74. <div class="container">
  75. <div class="row">
  76. <div class="col-md-7 col-md-offset-2 location-body">
  77. {{ page.body }}
  78. </div>
  79. </div>
  80. </div>
  81. <script>
  82. var map;
  83. function initMap() {
  84. map = new google.maps.Map(document.getElementById('map'), {
  85. center: {
  86. lat: {{lat}},
  87. lng: {{long}}
  88. },
  89. zoom: 8
  90. });
  91. var marker = new google.maps.Marker({
  92. position: {
  93. lat: {{lat}},
  94. lng: {{long}}
  95. },
  96. map: map,
  97. title: '{{page.title}}'
  98. });
  99. }
  100. </script>
  101. <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD31CT9P9KxvNUJOwDq2kcFEIG8ADgaFgw&callback=initMap" async defer></script>
  102. {% endblock content-body %}