1
0
Fork 0
mirror of https://github.com/TheThomaas/my-online-cookbook.git synced 2026-01-10 03:51:38 +00:00

Fix bug where ingredients would not render if servings was an empty string

This commit is contained in:
maeligg 2021-06-16 12:01:55 +02:00
parent cd75ace26e
commit f224ac623b

View file

@ -11,13 +11,13 @@
<a class="c-tags__tag" href="/tags/{{ tag | noEmoji | slug }}">{{ tag }}</a>
{% endfor %}
</div>
<div class="c-recipe__ingredients-wrapper" x-data='{currentServings: {{ servings }}, ingredients: "{{ ingredients | arrayToString }}".split("£") }'>
{% if time or servings %}
<div class="c-recipe__ingredients-wrapper" x-data='{currentServings: {{ servings if not servings == "" else false }}, ingredients: "{{ ingredients | arrayToString }}".split("£") }'>
{% if time or not servings == "" %}
<div class="c-recipe__additional-info">
{% if time %}
<p>{% include "icons/time.svg" %}{{ time }}</p>
{% endif %}
{% if servings %}
{% if not servings == "" %}
<p>
<template x-if="currentServings > 1">
<button @click="currentServings -= 1" class="c-recipe__serving-button">