Show options for choices on location page

This commit is contained in:
Midgard 2020-08-15 17:46:51 +02:00
parent 65ed818875
commit 63ce1c5551
Signed by: midgard
GPG key ID: 511C112F1331BBB4
2 changed files with 33 additions and 3 deletions

View file

@ -290,3 +290,15 @@ h1, h2, h3, h4, h5, h6{
#dish_choices.loading {
opacity: 0.2;
}
.dish-choices summary {
font-style: italic;
cursor: pointer;
}
.dish-choices summary:before {
font-style: normal;
content: "⯈";
}
.dish-choices[open] summary:before {
content: "⯆";
}

View file

@ -35,12 +35,30 @@
<td>
{{ dish.description or "" }}
{% if dish.choices %}
<div class="dish-choices">
Choices:
<details class="dish-choices">
<summary>
{% set comma = joiner(",") %}
{% for choice in dish.choices %}{{ comma() }}
{{ choice[1].name }}{% endfor %}
</div>
</summary>
<ul>
{% for type, choice in dish.choices %}
<li><strong>{{ choice.name }}</strong>{{
choice.description if choice.description
}}{{
" (choose one)" if type == "single_choice"
}}
<ul>
{% for option in choice.options %}
<li>{{ option.name }}{% if option.description %}:
{{ option.description}}{% endif %}{% if option.price %}:
{{ option.price | euro }}{% endif %}</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</details>
{% endif %}
</td>
<td style="white-space: nowrap;">{{ dish.price_range()|price_range(true) }}<td>