Skip to content

Commit dc0dcfa

Browse files
committed
Add text option if no production day is planed to productiondaysblock
1 parent 87397b3 commit dc0dcfa

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

bakeup/pages/blocks.py

+4
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ class ColumnBlocks(StreamBlock):
281281

282282
class ProductionDaysBlock(StructBlock):
283283
production_day_limit = IntegerBlock(default=4, required=False)
284+
text_no_production_day = RichTextBlock(
285+
required=False,
286+
help_text="This text is displayed if no production day is planned.",
287+
)
284288
cta_button_text = CharBlock(
285289
default="Zum Backtag", required=False, label="Button Text (Zum Backtag)"
286290
)
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1+
{% load wagtailcore_tags %}
12
<div class="row gy-4">
23

34
{% for production_day in production_days %}
45
<div class="col-12 col-md-6">
56
{% include 'shop/includes/production_day_card.html' %}
67
</div>
78
{% empty %}
8-
<div class="col">
9-
<p>Aktuell sind keine weiteren Backtage geplant.</p>
10-
</div>
9+
{% if value.text_no_production_day %}
10+
<div class="col">
11+
{{ value.text_no_production_day|richtext }}
12+
</div>
13+
{% else %}
14+
<div class="col">
15+
<p>Aktuell sind keine weiteren Backtage geplant.</p>
16+
</div>
17+
{% endif %}
1118
{% endfor %}
1219
</div>

0 commit comments

Comments
 (0)