{% extends "base.html" %} {% block title %}{{ recipe.name }} - Cook{% endblock %} {% block content %}
{% match image_path %} {% when Some with (img) %}
{{ recipe.name }}
{% when None %} {% endmatch %}

{{ recipe.name }}

{% if scale != 1.0 %} {% endif %}
{% if !tags.is_empty() %}
{% for tag in tags %} #{{ tag }} {% endfor %}
{% endif %} {% match recipe.metadata %} {% when Some with (metadata) %} {% match metadata.description %} {% when Some with (description) %}

{{ description }}

{% when None %} {% endmatch %}
{% match metadata.servings %} {% when Some with (servings) %} {% when None %} {% endmatch %} {% match metadata.time %} {% when Some with (time) %} {% when None %} {% endmatch %} {% match metadata.difficulty %} {% when Some with (difficulty) %} {% when None %} {% endmatch %} {% match metadata.course %} {% when Some with (course) %} {% when None %} {% endmatch %} {% match metadata.prep_time %} {% when Some with (prep_time) %} {% when None %} {% endmatch %} {% match metadata.cook_time %} {% when Some with (cook_time) %} {% when None %} {% endmatch %} {% match metadata.cuisine %} {% when Some with (cuisine) %} {% when None %} {% endmatch %} {% match metadata.diet %} {% when Some with (diet) %} {% when None %} {% endmatch %} {% match metadata.author %} {% when Some with (author) %} {% when None %} {% endmatch %} {% match metadata.source %} {% when Some with (source) %} {% when None %} {% endmatch %} {% match metadata.source_url %} {% when Some with (source_url) %} {% when None %} {% endmatch %} {% for (key, value) in metadata.custom %} {% endfor %}
{% when None %} {% endmatch %}

🥘 {{ tr.t("recipe-ingredients") }}

{% if sections.len() > 1 %} {% for section in sections %} {% if section.ingredients.len() > 0 %} {% match section.name %} {% when Some with (name) %}

{{ name }}

{% when None %} {% if !loop.first %}

{{ tr.t("recipe-main-section") }}

{% endif %} {% endmatch %}
    {% for ingredient in section.ingredients %}
  • {% match ingredient.reference_path %} {% when Some with (path) %} {{ ingredient.name }} {% when None %} {{ ingredient.name }} {% endmatch %} {% match ingredient.note %} {% when Some with (note) %} ({{ note }}) {% when None %} {% endmatch %}
    {% match ingredient.quantity %} {% when Some with (quantity) %}{{ quantity }}{% when None %}{% endmatch %} {% match ingredient.unit %} {% when Some with (unit) %} {{ unit }}{% when None %}{% endmatch %}
  • {% endfor %}
{% endif %} {% endfor %} {% else %}
    {% for ingredient in ingredients %}
  • {% match ingredient.reference_path %} {% when Some with (path) %} {{ ingredient.name }} {% when None %} {{ ingredient.name }} {% endmatch %} {% match ingredient.note %} {% when Some with (note) %} ({{ note }}) {% when None %} {% endmatch %}
    {% match ingredient.quantity %} {% when Some with (quantity) %}{{ quantity }}{% when None %}{% endmatch %} {% match ingredient.unit %} {% when Some with (unit) %} {{ unit }}{% when None %}{% endmatch %}
  • {% endfor %}
{% endif %} {% if cookware.len() > 0 %}

🍳 {{ tr.t("recipe-cookware") }}

    {% for item in cookware %}
  • {{ item.name }}
  • {% endfor %}
{% endif %}
{% for section in sections %} {% match section.name %} {% when Some with (name) %}

{{ name }}

{% when None %} {% endmatch %}
    {% for item in section.items %} {% match item %} {% when crate::server::templates::RecipeSectionItem::Step with (step) %}
  1. {% match step.image_path %} {% when Some with (img) %} {% when None %} {% endmatch %}
    {{ section.step_offset + step.number }}
    {% for step_item in step.items %} {% match step_item %} {% when crate::server::templates::StepItem::Text with (text) %}{{ text }}{% when crate::server::templates::StepItem::Ingredient with { name, reference_path } %}{% match reference_path %}{% when Some with (path) %}{{ name }}{% when None %}{{ name }}{% endmatch %}{% when crate::server::templates::StepItem::Cookware with (name) %}{{ name }}{% when crate::server::templates::StepItem::Timer with (name) %}⏱️ {{ name }}{% when crate::server::templates::StepItem::Quantity with (qty) %}{{ qty }}{% when crate::server::templates::StepItem::LineBreak %}
    {% endmatch %}{% endfor %}
    {% if step.ingredients.len() > 0 %}
    {% for ing in step.ingredients %} {{ ing.name }}{% match ing.quantity %}{% when Some with (q) %}: {{ q }}{% when None %}{% endmatch %}{% match ing.unit %}{% when Some with (u) %} {{ u }}{% when None %}{% endmatch %}{% match ing.note %}{% when Some with (note) %} ({{ note }}){% when None %}{% endmatch %}{% if !loop.last %},{% endif %} {% endfor %}
    {% endif %}
  2. {% when crate::server::templates::RecipeSectionItem::Note with (note) %}
  3. 📝

    {{ note }}

  4. {% endmatch %} {% endfor %}
{% endfor %}
{% endblock %}