location_page.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. <location-status url="{% url 'wagtailapi:pages:detail' page.pk %}">
  30. Please wait...
  31. </location-status>
  32. <h2 class="location__meta-title">Address</h2>
  33. <address>{{ page.address|linebreaks }}</address>
  34. {% if page.operating_hours %}
  35. <h2 class="location__meta-title">Opening hours</h2>
  36. {% for hours in page.operating_hours %}
  37. <time itemprop="openingHours" datetime="{{ hours }}" class="location__time">
  38. <span class="location__day">{{ hours.day }}</span>:
  39. <span class="location__hours">
  40. {% if hours.closed == True %}
  41. Closed
  42. {% else %}
  43. {% if hours.opening_time %}
  44. {{ hours.opening_time }}
  45. {% endif %} -
  46. {% if hours.closing_time %}
  47. {{ hours.closing_time }}
  48. {% endif %}
  49. {% endif %}
  50. </span></time>
  51. {% endfor %}
  52. {% endif %}
  53. </div>
  54. </div>
  55. </div>
  56. <div class="col-md-7">
  57. <div class="row hidden-md-up">
  58. {{ page.body }}
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. {% endblock content %}
  65. {% block js %}
  66. {{ block.super }}
  67. <script type="module" src="{% static 'js/location-status.js' %}"></script>
  68. {% endblock js %}