Add asynchronous call to database.
[recipes.git] / backend / templates / base_with_list.html
1 {% extends "base_with_header.html" %}
2
3 {% block main_container %}
4 <div class="list">
5 <ul>
6 {% for (id, title) in recipes %}
7 <li>
8 {% let item_html = "<a href=\"/recipe/view/{}\">{}</a>"|format(id, title) %}
9 {% match current_recipe_id %}
10 {# Don't know how to avoid repetition: comparing (using '==' or .eq()) current_recipe_id.unwrap() and id doesn't work. Guards for match don't exist.
11 See: https://github.com/djc/askama/issues/752 #}
12 {% when Some (current_id) %}
13 {% if current_id == id %}
14 [{{ item_html|escape("none") }}]
15 {% else %}
16 {{ item_html|escape("none") }}
17 {% endif %}
18 {% when None %}
19 {{ item_html|escape("none") }}
20 {% endmatch %}
21 </li>
22 {% endfor %}
23 </ul>
24 </div>
25 <div class="content">
26 {% block content %}{% endblock %}
27 </div>
28 {% endblock %}