location_page.html 3.3 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. {# @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">
  21. {% if page.is_open %}
  22. This location is currently open
  23. {% else %}
  24. Sorry, this location is currently closed
  25. {% endif %}
  26. </p>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="container">
  32. <div class="row">
  33. <div class="col-md-7">
  34. <div class="row">
  35. {% if page.introduction %}
  36. <div class="intro col-md-7"><p>{{ page.introduction }}</p></div>
  37. {% endif %}
  38. {% if page.operating_hours %}
  39. <div class="col-md-4 col-md-offset-1 location-opening">
  40. <h3>Opening hours</h3>
  41. {% for hours in page.operating_hours %}
  42. <time itemprop="openingHours" datetime="{{ hours }}" class="location-time">
  43. <span class="day">{{ hours.day }}</span>:
  44. <span class="hours">
  45. {% if hours.closed == True %}
  46. Closed
  47. {% else %}
  48. {% if hours.opening_time %}
  49. {{ hours.opening_time }}
  50. {% endif %} -
  51. {% if hours.closing_time %}
  52. {{ hours.closing_time }}
  53. {% endif %}
  54. {% endif %}
  55. </span></time>
  56. {% endfor %}
  57. </div>
  58. {% endif %}
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="container-flex">
  64. <div class="row">
  65. <div class="col-md-2 col-md-offset-5 location-address">
  66. <h3>Address</h3>
  67. <address>{{ page.address|linebreaks }}</address>
  68. </div>
  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 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: 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=AIzaSyD31CT9P9KxvNUJOwDq2kcFEIG8ADgaFgw&callback=initMap" async defer></script>
  103. {% endblock content %}