diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-14 01:06:28 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-14 01:06:28 +0100 |
commit | d84b462a711ce95593ff05a7581e722562c3835a (patch) | |
tree | 41e5af455fea925b2680b29718b24ba2876e803a /templates/inventoryListing.hamlet | |
download | bar-d84b462a711ce95593ff05a7581e722562c3835a.tar bar-d84b462a711ce95593ff05a7581e722562c3835a.tar.gz bar-d84b462a711ce95593ff05a7581e722562c3835a.tar.bz2 bar-d84b462a711ce95593ff05a7581e722562c3835a.tar.xz bar-d84b462a711ce95593ff05a7581e722562c3835a.zip |
Implement old bar.hs
Diffstat (limited to 'templates/inventoryListing.hamlet')
-rw-r--r-- | templates/inventoryListing.hamlet | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/templates/inventoryListing.hamlet b/templates/inventoryListing.hamlet new file mode 100644 index 0000000..7c2c06b --- /dev/null +++ b/templates/inventoryListing.hamlet | |||
@@ -0,0 +1,49 @@ | |||
1 | <div .table> | ||
2 | <div .tr .sepBelow> | ||
3 | <div .th>Description | ||
4 | <div .th>Bought | ||
5 | <div .th>Expires | ||
6 | <div .th>Opened | ||
7 | <div .th>Actions | ||
8 | $if isJust (preview insertForm =<< formState) | ||
9 | $with Just InsertForm{..} <- formState | ||
10 | <form .tr .sepBelow action=@{InventoryListingR} method=post enctype=#{fsInsertEncoding}> | ||
11 | ^{fsInsertForm} | ||
12 | <div .td> | ||
13 | <button type=submit> | ||
14 | Insert | ||
15 | $forall Entity itemId Item{..} <- stock | ||
16 | $if Just itemId == (preview updateItem =<< formState) | ||
17 | $with Just UpdateForm{..} <- formState | ||
18 | <form .tr .color action=@{UpdateItemR fsUpdateItem}##{toPathPiece fsUpdateItem} method=post enctype=#{fsUpdateEncoding} ##{toPathPiece fsUpdateItem}> | ||
19 | ^{fsUpdateForm} | ||
20 | <div .td> | ||
21 | <button type=submit> | ||
22 | Save Changes | ||
23 | $else | ||
24 | <div .tr .color ##{toPathPiece itemId}> | ||
25 | <div .kind>#{itemKind} | ||
26 | <div .td .day> | ||
27 | $maybe bought <- itemBought | ||
28 | #{dayFormat bought} | ||
29 | $nothing | ||
30 | <hr> | ||
31 | <div .td .day> | ||
32 | $maybe expires <- itemExpires | ||
33 | #{dayFormat expires} | ||
34 | $nothing | ||
35 | <hr> | ||
36 | <div .td .day> | ||
37 | $maybe opened <- itemOpened | ||
38 | #{dayFormat opened} | ||
39 | $nothing | ||
40 | <form method=post action=@{OpenItemR itemId}> | ||
41 | <button type=submit> | ||
42 | Open | ||
43 | <div .td> | ||
44 | <form method=get action=@{UpdateItemR itemId}##{toPathPiece itemId}> | ||
45 | <button type=submit> | ||
46 | Edit | ||
47 | <form method=post action=@{DeleteItemR itemId}> | ||
48 | <button type=submit> | ||
49 | Delete | ||