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

{{ name }}

{{ tr.t("recipe-type-menu") }}
{% match 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.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 %}
{% for section in sections %}
{% match section.name %} {% when Some with (name) %}

{{ name }}

{% when None %} {% endmatch %}
{% for line in section.lines %} {% if line.len() == 1 %} {% match line[0] %} {% when crate::server::templates::MenuSectionItem::Text with (text) %} {% if text.trim().ends_with(":") %}

{{ text }}

{% else %}
{{ text }}
{% endif %} {% when _ %}
{% match line[0] %} {% when crate::server::templates::MenuSectionItem::RecipeReference with { name, scale } %} {{ name.strip_prefix("./").unwrap_or(name).replace("/", " › ") }} {% match scale %} {% when Some with (s) %} (×{{ s }}) {% when None %} {% endmatch %} {% when crate::server::templates::MenuSectionItem::Ingredient with { name, quantity, unit } %} {{ name }} {% match quantity %} {% when Some with (q) %} {{ q }} {% when None %} {% endmatch %} {% match unit %} {% when Some with (u) %} {{ u }} {% when None %} {% endmatch %} {% when _ %} {% endmatch %}
{% endmatch %} {% else %}
{% for item in line %} {% match item %} {% when crate::server::templates::MenuSectionItem::Text with (text) %} {{ text }} {% when crate::server::templates::MenuSectionItem::RecipeReference with { name, scale } %} {{ name.strip_prefix("./").unwrap_or(name).replace("/", " › ") }} {% match scale %} {% when Some with (s) %} (×{{ s }}) {% when None %} {% endmatch %} {% when crate::server::templates::MenuSectionItem::Ingredient with { name, quantity, unit } %} {{ name }} {% match quantity %} {% when Some with (q) %} {{ q }} {% when None %} {% endmatch %} {% match unit %} {% when Some with (u) %} {{ u }} {% when None %} {% endmatch %} {% endmatch %} {% endfor %}
{% endif %} {% endfor %}
{% endfor %}
{% endblock %}