location_page.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {% extends "base.html" %}
  2. {% load wagtailimages_tags navigation_tags %}
  3. {% block head-extra %}
  4. <style>
  5. /* Following two selectors needed for Google map embed */
  6. #map {
  7. height: 100%;
  8. }
  9. </style>
  10. {% endblock head-extra %}
  11. {% block content %}
  12. {% image self.image fill-1920x600 as hero_img %}
  13. <div class="container-fluid hero" style="background-image:url('{{ hero_img.url }}')">
  14. <div class="hero-gradient-mask"></div>
  15. <div class="container">
  16. <div class="row">
  17. <div class="col-md-7">
  18. <h1>{{ page.title }}</h1>
  19. <p class="stand-first">
  20. {% if page.is_open %}
  21. This location is currently open
  22. {% else %}
  23. Sorry, this location is currently closed
  24. {% endif %}
  25. </p>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="container">
  31. <div class="row">
  32. <div class="col-md-7">
  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.operating_hours %}
  38. <div class="col-md-4 col-md-offset-1 location-opening">
  39. <h3>Opening hours</h3>
  40. {% for hours in page.operating_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-5 location-address">
  65. <h3>Address</h3>
  66. <address>{{ page.address|linebreaks }}</address>
  67. </div>
  68. </div>
  69. <div class="map-container">
  70. <div id="map" class="maps embed-container"></div>
  71. </div>
  72. </div>
  73. <div class="container">
  74. <div class="row">
  75. <div class="col-md-7 location-body">
  76. {{ page.body }}
  77. </div>
  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: 15,
  90. scrollwheel: false
  91. });
  92. var marker = new google.maps.Marker({
  93. position: {
  94. lat: {{lat}},
  95. lng: {{long}}
  96. },
  97. map: map,
  98. title: '{{page.title}}'
  99. });
  100. }
  101. </script>
  102. <script src="https://maps.googleapis.com/maps/api/js?key={{ google_map_api_key }}&callback=initMap" async defer></script>
  103. {% endblock content %}