recipes/backend/templates/recipes_list_fragment.html
2025-03-02 00:39:58 +01:00

41 lines
No EOL
1.1 KiB
HTML

{% macro recipe_item(id, title, is_current) %}
<li>
<a href="/recipe/view/{{ id }}" class="recipe-item
{%~ if is_current %}
current
{% endif %}" id="recipe-{{ id }}"
>
{% if title == "" %}
{{ tr.t(Sentence::UntitledRecipe) }}
{% else %}
{{ title }}
{% endif %}
</a>
</li>
{% endmacro %}
<div id="recipes-list">
{% if !recipes.unpublished.is_empty() %}
{{ tr.t(Sentence::UnpublishedRecipes) }}
{% endif %}
<nav class="recipes-list-unpublished">
<ul>
{% for (id, title) in recipes.unpublished %}
{% call recipe_item(id, title, recipes.is_current(id)) %}
{% endfor %}
</ul>
</nav>
{% if !recipes.unpublished.is_empty() %}
<hr>
{% endif %}
<nav class="recipes-list-published">
<ul>
{% for (id, title) in recipes.published %}
{% call recipe_item(id, title, recipes.is_current(id)) %}
{% endfor %}
</ul>
</nav>
</div>