|
1 | 1 | [% escape_title( 'Dish', dish.name ) %] |
2 | 2 |
|
3 | | -<p>for meal <em>[% dish.meal.name | html %]</em> on [% display_date(dish.meal.date, {html=>1}) %]</p> |
4 | | - |
5 | | -[% IF dish.recipe %] |
6 | | -<p>from recipe <a href="[% dish.recipe.url %]">[% dish.recipe.name | html %]</a></p> |
7 | | -[% END %] |
8 | | - |
9 | | -<form method="post" action="[% delete_url %]"> |
10 | | - <input type="submit" value="Delete dish"> |
11 | | -</form> |
12 | | - |
13 | | -<form action="[% dish.update_url %]" method="post"> |
14 | | -<p>Name: <input type="text" name="name" value="[% dish.name | html %]"></p> |
15 | | -<p>Comment: <input type="text" name="comment" value="[% dish.comment %]"></p> |
16 | | -<p>Servings: <input type="number" name="servings" value="[% dish.servings %]"> <em>Changing here doesn’t recalculate values!</em></p> |
17 | | -<p>Tags: <input type="text" name="tags" value="[% dish.tags_joined %]"></p> |
18 | | -<p><label for="prepare_at_meal">Prepare at meal:</label> |
19 | | - <select id="prepare_at_meal" name="prepare_at_meal"> |
20 | | - <option value="" [% 'selected' IF NOT dish.prepare_at_meal.defined %]>(none)</option> |
21 | | -[% FOR meal IN prepare_meals %] |
22 | | - <option value="[% meal.id %]" [% 'selected' IF dish.prepare_at_meal.id == meal.id %]>[% display_date(meal.date) %]: [% meal.name | html %]</option> |
23 | | -[% END %] |
24 | | - </select> |
25 | | -</p> |
26 | | - |
27 | | -<h3>Preparation</h3> |
28 | | -<div class="row mb-2"> |
29 | | - <div class="col-sm-6 mb-sm-0 mb-2"> |
30 | | - <textarea class="form-control with-markdown-preview" name="preparation" rows="10">[% dish.preparation | html %]</textarea> |
31 | | - </div> |
| 3 | +<div class="row mb-3 mt-n3"> |
| 4 | + <div class="col-sm-6"> |
| 5 | + <p class="m-0">for meal <em>[% dish.meal.name | html %]</em> on [% display_date(dish.meal.date, {html=>1}) %]</p> |
| 6 | + [% IF dish.recipe %] |
| 7 | + <p class="m-0">from recipe <a href="[% dish.recipe.url %]">[% dish.recipe.name | html %]</a></p> |
| 8 | + [% END %] |
| 9 | + </div> |
| 10 | + |
| 11 | + <form class="col-sm-3 offset-sm-3 col-lg-2 offset-lg-4 mt-3 mt-sm-0 btn-group" method="post" action="[% delete_url %]"> |
| 12 | + <button type="button" class="btn btn-danger" title="Delete dish" aria-expanded="false"> |
| 13 | + <i class="material-icons">delete_forever</i> Delete |
| 14 | + </button> |
| 15 | + </form> |
32 | 16 | </div> |
33 | 17 |
|
| 18 | +<form action="[% dish.update_url %]" method="post"> |
34 | 19 |
|
35 | | -<h3>Description</h3> |
36 | | -<div class="row mb-2"> |
37 | | - <div class="col-sm-6 mb-sm-0 mb-2"> |
38 | | - <textarea class="form-control with-markdown-preview" name="description" rows="10">[% dish.description | html %]</textarea> |
| 20 | +<div class="card"> |
| 21 | + <div class="card-header"> |
| 22 | + <h3 id="section_general_information"><a name="add ingredients">General information</a></h3> |
| 23 | + </div> |
| 24 | + <div class="card-body"> |
| 25 | + <div class="mb-3"> |
| 26 | + <label for="name" class="form-label">Name</label> |
| 27 | + <input id="name" class="form-control" type="text" name="name" value="[% dish.name | html %]"> |
| 28 | + </div> |
| 29 | + <div class="mb-3"> |
| 30 | + <label for="comment" class="form-label">Comment</label> |
| 31 | + <textarea id="comment" class="form-control" name="comment">[% dish.comment %]</textarea> |
| 32 | + </div> |
| 33 | + <div class="mb-3"> |
| 34 | + <label for="tags" class="form-label">Tags</label> |
| 35 | + <input id="tags" class="form-control" type="text" name="tags" value="[% dish.tags_joined %]"> |
| 36 | + </div> |
| 37 | + <div class="row mb-3"> |
| 38 | + <div class="col-md"> |
| 39 | + <label for="servings" class="form-label">Servings</label> |
| 40 | + <input id="servings" class="form-control" type="number" name="servings" value="[% dish.servings %]" readonly> |
| 41 | + <small class="text-muted">For a recalculation see <a href="#section_recalculate_values">form</a> below.</small> |
| 42 | + </div> |
| 43 | + <div class="col-md mt-3 mt-md-0"> |
| 44 | + <label for="prepare_at_meal" class="form-label">Prepare at meal</label> |
| 45 | + <select id="prepare_at_meal" class="form-control" name="prepare_at_meal"> |
| 46 | + <option value="" [% 'selected' IF NOT dish.prepare_at_meal.defined %] >(none)</option> |
| 47 | + [% FOR meal IN prepare_meals %] |
| 48 | + <option value="[% meal.id %]" [% 'selected' IF dish.prepare_at_meal.id == meal.id %]>[% display_date(meal.date) %]: [% meal.name | html %]</option> |
| 49 | + [% END %] |
| 50 | + </select> |
| 51 | + </div> |
| 52 | + </div> |
| 53 | + <div class="mb-3"> |
| 54 | + <label for="preparation" class="form-label">Preparation</label> |
| 55 | + <div class="row"> |
| 56 | + <div class="col-md-6 mb-md-0 mb-2"> |
| 57 | + <textarea id="preparation" class="form-control with-markdown-preview" name="preparation" rows="10">[% dish.preparation | html %]</textarea> |
| 58 | + </div> |
| 59 | + </div> |
| 60 | + </div> |
| 61 | + <div class="mb-3"> |
| 62 | + <label for="description" class="form-label">Description</label> |
| 63 | + <div class="row"> |
| 64 | + <div class="col-md-6 mb-md-0 mb-2"> |
| 65 | + <textarea id="description" class="form-control with-markdown-preview" name="description" rows="10">[% dish.description | html %]</textarea> |
| 66 | + </div> |
| 67 | + </div> |
| 68 | + </div> |
| 69 | + <div class="text-end"> |
| 70 | + <button type="submit" class="btn btn-primary">Update dish</button> |
| 71 | + </div> |
39 | 72 | </div> |
40 | 73 | </div> |
41 | | - |
42 | | -<p><input type="submit" value="Update Dish"></p> |
43 | | - |
44 | | -<h2><a name="ingredients">Ingredients</a></h2> |
45 | | - |
| 74 | + |
46 | 75 | [% INCLUDE 'includes/forms/ingredients_editor.tt' %] |
47 | 76 |
|
48 | | -<input type="submit" value="Update Dish"> |
49 | 77 | </form> |
50 | 78 |
|
51 | 79 | [% INCLUDE 'includes/forms/ingredients_add.tt' %] |
52 | 80 |
|
53 | | -<form method="post" action="[% dish.recalculate_url %]"> |
54 | | -<div class="card"> |
55 | | - <div class="card-header"><h3>Recalculate values</h3></div> |
56 | | - |
57 | | -<div class="card-body"> |
58 | | - <p>Adjust the values in the table above by <strong>changing the number of servings</strong> |
59 | | - (currently [% dish.servings %]) |
60 | | - and <strong>automatically de-/increasing the numbers</strong> in the same ratio.</p> |
61 | 81 |
|
62 | 82 |
|
63 | | - <label for="recalculate_servings">Servings:</label> |
64 | | - <input id="recalculate_servings" type="number" name="servings" value="[% dish.servings %]"> |
65 | | - <input type="submit" value="Recalculate values"> |
66 | | -</div> |
67 | | -</div> |
| 83 | +<form class="mt-3" method="post" action="[% dish.recalculate_url %]"> |
| 84 | + <div class="card"> |
| 85 | + <div class="card-header"> |
| 86 | + <h3 id="section_recalculate_values">Recalculate values</h3> |
| 87 | + </div> |
| 88 | + <div class="card-body"> |
| 89 | + <p>Adjust the values in the <a href="#ingredients">table above</a> above by changing the number of servings</strong> |
| 90 | + (currently [% dish.servings %]) |
| 91 | + and <strong>automatically de-/increasing the numbers</strong> in the same ratio.</p> |
| 92 | + <div class="row align-items-center"> |
| 93 | + <label for="value" class="col-sm-3 col-form-label">Servings</label> |
| 94 | + <div class="col-sm-5"> |
| 95 | + <input id="recalculate_servings" type="number" name="servings" value="[% dish.servings %]" class="form-control"> |
| 96 | + </div> |
| 97 | + <div class="col-sm-4 mt-3 mt-sm-0 text-end"> |
| 98 | + <button type="submit" class="btn btn-primary">Recalculate values</button> |
| 99 | + </div> |
| 100 | + </div> |
| 101 | + </div> |
| 102 | + </div> |
68 | 103 | </form> |
0 commit comments