A bit of clean up

This commit is contained in:
Greg Burri 2025-03-02 00:39:58 +01:00
parent cb2483eab1
commit a590d7e1e9
24 changed files with 259 additions and 237 deletions

View file

@ -1,48 +1,40 @@
{% macro recipe_item(id, title, class) %}
<a href="/recipe/view/{{ id }}" class="{{ class }}" id="recipe-{{ id }}">
{% if title == "" %}
{{ tr.t(Sentence::UntitledRecipe) }}
{% else %}
{{ title }}
{% endif %}
</a>
{% 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) }}
{{ tr.t(Sentence::UnpublishedRecipes) }}
{% endif %}
<nav class="recipes-list-unpublished">
<ul>
{% for (id, title) in recipes.unpublished %}
<li>
{% if recipes.is_current(id) %}
{% call recipe_item(id, title, "recipe-item-current") %}
{% else %}
{% call recipe_item(id, title, "recipe-item") %}
{% endif %}
</li>
{% call recipe_item(id, title, recipes.is_current(id)) %}
{% endfor %}
</ul>
</nav>
{% if !recipes.unpublished.is_empty() %}
<hr>
<hr>
{% endif %}
<nav class="recipes-list-published">
<ul>
{% for (id, title) in recipes.published %}
<li>
{% if recipes.is_current(id) %}
{% call recipe_item(id, title, "recipe-item-current") %}
{% else %}
{% call recipe_item(id, title, "recipe-item") %}
{% endif %}
</li>
{% call recipe_item(id, title, recipes.is_current(id)) %}
{% endfor %}
</ul>
</nav>