Add some fields to recipe view

This commit is contained in:
Greg Burri 2025-01-15 20:30:19 +01:00
parent 54989f3212
commit afd42ba1d0
6 changed files with 44 additions and 2 deletions

View file

@ -9,6 +9,31 @@
<a class="edit-recipe" href="/recipe/edit/{{ recipe.id }}" >Edit</a>
{% endif %}
<div class="tags">
{% for tag in recipe.tags %}
<span class="tag">{{ tag }}</span>
{% endfor %}
</div>
{% match recipe.servings %}
{% when Some(servings) %}
<span class="servings">
{% if *servings == 1 %}
{{ tr.t(Sentence::RecipeOneServing) }}
{% else %}
{{ tr.tp(Sentence::RecipeSomeServings, [Box::new(**servings)]) }}
{% endif %}
</span>
{% else %}
{% endmatch %}
{% match recipe.estimated_time %}
{% when Some(time) %}
{{ time +}} {{+ tr.t(Sentence::RecipeEstimatedTimeMinAbbreviation) }}
{% else %}
{% endmatch %}
{% if !recipe.description.is_empty() %}
<div class="recipe-description" >
{{ recipe.description.clone() }}