Reunite UTF-8 hack comment with sys.setdefaultencoding call it labels.
[cookbook.git] / cookbook / template / recipe.html
1 {% extends "base.html" %}
2
3 {% block page_title %}
4     {% if recipe.url %}
5         <a href="{{ recipe.url }}">{{ recipe.name }}</a>
6     {% else %}
7         {{ recipe.name }}
8     {% endif %}
9 {% endblock %}
10
11 {% block content %}
12     <p id="recipe-details">
13     {% if recipe.yield_ %}
14         <span class="detail-field-header">Yield:</span>
15         <span class="detail-field-contents">{{ recipe.yield_ }}</span><br/>
16     {% endif %}
17     {% if recipe.author %}
18         <span class="detail-field-header">Author:</span>
19         <span class="detail-field-contents">{{ recipe.author }}</span><br/>
20     {% endif %}
21     {% if recipe.source %}
22         <span class="detail-field-header">Source:</span>
23         <span class="detail-field-contents">{{ recipe.source }}</span><br/>
24     {% endif %}
25     {% if recipe.tags %}
26         <span class="detail-field-header">Tags:</span>
27         <span class="detail-field-contents">{{ ', '.join(tag_links) }}
28         </span><br/>
29     {% endif %}
30     </p>
31     <form action="add_tag" method="get">
32       <input type="hidden" name="name" value="{{ recipe.name }}"/>
33       <select name="tag">
34         <option value="">textbox</option>
35         {% for tag in cookbook.tags() %}
36         <option value="{{ tag }}">{{ tag }}</option>
37         {% endfor %}
38       </select>
39       <input type="text" name="tag" value=""/>
40       <input type="submit" value="Add tag"/>
41     </form>
42     {% if recipe.tags %}
43     <form action="remove_tag" method="get">
44       <input type="hidden" name="name" value="{{ recipe.name }}"/>
45       <select name="tag">
46         {% for tag in recipe.tags %}
47         <option value="{{ tag }}">{{ tag }}</option>
48         {% endfor %}
49       </select>
50       <input type="submit" value="Remove tag"/>
51     </form>
52     {% endif %}
53
54     {% if recipe.ingredient_blocks %}
55     <div id="recipe-ingredient-blocks">
56     {% for ingredient_block in recipe.ingredient_blocks %}
57         <h2>{{ ingredient_block.heading() }}</h2>
58         <table>
59         {% for ingredient in ingredient_block %}
60             <tr><td>{{ ingredient.__unicode__() }}</td></tr>
61         {% endfor %}
62         </table>
63     {% endfor %}
64     </div>
65     {% endif %}
66
67     {% if recipe.directions %}
68     <div id="recipe-directions">
69     <h2>Directions</h2>
70     {% for paragraph in recipe.directions.wrapped_paragraphs() %}
71         <p>{{ paragraph }}</p>
72     {% endfor %}
73     </div>
74     {% endif %}
75
76     <ul>
77       <li><a href="edit?name={{ recipe.clean_name(ascii=True) }}">
78           edit receipe</a></li>
79       <li><a href="edit?action=remove&name={{ recipe.clean_name(ascii=True) }}">
80           remove receipe</a></li>
81     </ul>
82 {% endblock %}