location_page.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. {% extends "base.html" %}
  2. {% load wagtailimages_tags navigation_tags static %}
  3. {% block content %}
  4. {% include "base/include/header-hero.html" %}
  5. <div class="container bread-detail">
  6. <div class="row">
  7. <div class="col-md-12">
  8. <div class="col-md-7">
  9. <div class="row">
  10. {% if page.introduction %}
  11. <p class="bread-detail__introduction">
  12. {{ page.introduction }}
  13. </p>
  14. {% endif %}
  15. <div class="hidden-md-down">
  16. {{ page.body }}
  17. </div>
  18. </div>
  19. </div>
  20. <div class="col-md-4 col-md-offset-1">
  21. <div class="row">
  22. <div class="bread-detail__meta">
  23. <h2 class="location__meta-title">Operating Status</h2>
  24. {% comment %}
  25. Fetch the status of the location on the client side
  26. as a Wagtail API usage example and to allow for
  27. caching of the whole page without the status.
  28. {% endcomment %}
  29. {% if request.is_preview %}
  30. {% if page.is_open %}
  31. This location is currently open.
  32. {% else %}
  33. Sorry, this location is currently closed.
  34. {% endif %}
  35. {% else %}
  36. <location-status url="{% url 'wagtailapi:pages:detail' page.pk %}">
  37. Please wait…
  38. </location-status>
  39. {% endif %}
  40. <h2 class="location__meta-title">Address</h2>
  41. <address>{{ page.address|linebreaks }}</address>
  42. {% if page.operating_hours %}
  43. <h2 class="location__meta-title">Opening hours</h2>
  44. {% for hours in page.operating_hours %}
  45. <time itemprop="openingHours" datetime="{{ hours }}" class="location__time">
  46. <span class="location__day">{{ hours.day }}</span>:
  47. <span class="location__hours">
  48. {% if hours.closed == True %}
  49. Closed
  50. {% else %}
  51. {% if hours.opening_time %}
  52. {{ hours.opening_time }}
  53. {% endif %} -
  54. {% if hours.closing_time %}
  55. {{ hours.closing_time }}
  56. {% endif %}
  57. {% endif %}
  58. </span></time>
  59. {% endfor %}
  60. {% endif %}
  61. </div>
  62. </div>
  63. </div>
  64. <div class="col-md-7">
  65. <div class="row hidden-md-up">
  66. {{ page.body }}
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. {% endblock content %}
  73. {% block js %}
  74. {{ block.super }}
  75. <script type="module" src="{% static 'js/location-status.js' %}"></script>
  76. {% endblock js %}