2
0

location_page.html 3.5 KB

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