2
0

location_page.html 3.2 KB

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