Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Commit f22e34d

Browse files
dboehmerkuro610
authored andcommitted
Simplify TT login and move snippet_dish.tt into edit.tt again
1 parent 821043a commit f22e34d

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

root/templates/purchase_list/edit.tt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,21 @@ html_title = html_title _ ' for ' _ display_date(list.date, {html=>1});
6363
<td rowspan="[% rowspan %]">[% item.article.name | html %]</td>
6464

6565
[% FOREACH ingredient IN item.ingredients %]
66-
[% IF loop.index == 0 %]
67-
[% INCLUDE purchase_list/snippet_dish.tt %]
68-
</tr>
69-
70-
[% ELSE %]
71-
<tr>
72-
[% INCLUDE purchase_list/snippet_dish.tt %]
66+
[% '<tr>' UNLESS loop.index == 0 %]
67+
<td style="text-align:right;">[% display_value_unit( ingredient.value, ingredient.unit, {html=>1} ) %]</td>
68+
<td style="text-align:center;">[% ingredient.dish.meal.date.strftime('%a, %F') %]</td>
69+
<td>[% ingredient.dish.meal.name | html %]</td>
70+
<td>[% ingredient.dish.name | html %]</td>
71+
<td>
72+
<form method="post" action="[% ingredient.remove_url %]">
73+
<button type="submit" class="btn btn-outline-danger btn-sm btn-quad" title="Remove from purchase list">
74+
<i class="material-icons">delete_forever</i>
75+
</button>
76+
</form>
77+
</td>
78+
<td>[% IF ingredient.comment; '('; ingredient.comment | html; ')'; END %]</td>
7379
</tr>
74-
[% END;
75-
END;
80+
[% END;
7681

7782
IF item.offset %]
7883
<tr>

root/templates/purchase_list/snippet_dish.tt

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)