Rewrite to Django from scratch. Now it's much more user-friendly.
[cookbook.git] / example / data / template / cookbook / recipe.html
1 {% extends "cookbook/base.html" %}
2
3 {% block content %}
4 <h1>{{ recipe.name }}</h1>
5
6 {% block metadata %}
7 <table class="metadata">
8   <tr><td>Author</td><td>{{ recipe.author|default:"unknown" }}</td></tr>
9 {% if recipe.source or recipe.url %}
10   <tr><td>Source</td><td><a href="{{ recipe.url }}">{{ recipe.source|default:recipe.url }}</a></td></tr>
11 {% endif %}
12 {% if recipe.x_yield %}
13   <tr><td>Yield</td><td>{{ recipe.x_yield }}</td></tr>
14 {% endif %}
15 {% if recipe.tags.all %}
16   <tr><td>Tags</td>
17     <td>
18 {% for tag in recipe.tags.all %}
19       <a href="{% url tag tag.id %}">{{ tag }}</a>
20 {% endfor %}
21     </td>
22   </tr>
23 {% endif %}
24 </table>
25 {% endblock %}
26
27 {% block ingredients %}
28 <h2>Ingredients</h2>
29
30 {% for ingredient_block in recipe.ingredientblock_set.all %}
31 <div class="ingredient_block">
32 <h3>{{ ingredient_block.name }}</h3>
33 <ul>
34 {% for ingredient in ingredient_block.ingredient_set.all %}
35   <li>{{ ingredient }}</li>
36 {% endfor %}
37 </ul>
38 {% if ingredient_block.directions %}
39 <h4>Directions</h4>
40
41 <div class="directions">
42 {{ ingredient_block.directions|safe }}
43 </div>
44 {% endif %}
45
46 </div>
47 {% endfor %}
48 {% endblock %}
49
50 {% block directions %}
51 <h2>Directions</h2>
52
53 <div class="directions">
54 {{ recipe.directions|safe }}
55 </div>
56 {% endblock %}
57
58 {% endblock %}