Skip to content

Commit 99e6906

Browse files
committed
Add support for location open/close preview
1 parent bcfa60d commit 99e6906

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

bakerydemo/templates/locations/location_page.html

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,18 @@ <h2 class="location__meta-title">Operating Status</h2>
3030
as a Wagtail API usage example and to allow for
3131
caching of the whole page without the status.
3232
{% endcomment %}
33-
<location-status url="{% url 'wagtailapi:pages:detail' page.pk %}">
34-
Please wait...
35-
</location-status>
33+
{% if request.is_preview %}
34+
{% if page.is_open %}
35+
This location is currently open.
36+
{% else %}
37+
Sorry, this location is currently closed.
38+
{% endif %}
39+
{% else %}
40+
<location-status url="{% url 'wagtailapi:pages:detail' page.pk %}">
41+
Please wait…
42+
</location-status>
43+
{% endif %}
44+
3645

3746
<h2 class="location__meta-title">Address</h2>
3847
<address>{{ page.address|linebreaks }}</address>

0 commit comments

Comments
 (0)