diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-28 12:51:25 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-28 12:51:25 +0200 |
commit | 72b9f29c057eb45d022b9bbc1562d7b84ccc165b (patch) | |
tree | 978b71348b0dce981adf55c72ced58e8a750a17b /Handler | |
parent | 08759871bcc3dc3b461650232747e58653535cdb (diff) | |
download | bar-72b9f29c057eb45d022b9bbc1562d7b84ccc165b.tar bar-72b9f29c057eb45d022b9bbc1562d7b84ccc165b.tar.gz bar-72b9f29c057eb45d022b9bbc1562d7b84ccc165b.tar.bz2 bar-72b9f29c057eb45d022b9bbc1562d7b84ccc165b.tar.xz bar-72b9f29c057eb45d022b9bbc1562d7b84ccc165b.zip |
Running low
Diffstat (limited to 'Handler')
-rw-r--r-- | Handler/Common.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Handler/Common.hs b/Handler/Common.hs index 90e373a..799f692 100644 --- a/Handler/Common.hs +++ b/Handler/Common.hs | |||
@@ -70,12 +70,14 @@ itemForm proto identView = do | |||
70 | (boughtRes, boughtWidget) <- dayForm (Just . fromMaybe (DateKnown today) $ itemBought <$> proto) $ DayFormConfig False True True | 70 | (boughtRes, boughtWidget) <- dayForm (Just . fromMaybe (DateKnown today) $ itemBought <$> proto) $ DayFormConfig False True True |
71 | (expiresRes, expiresWidget) <- dayForm (itemExpires <$> proto) $ DayFormConfig True False True | 71 | (expiresRes, expiresWidget) <- dayForm (itemExpires <$> proto) $ DayFormConfig True False True |
72 | (openedRes, openedWidget) <- dayForm (itemOpened <$> proto) $ DayFormConfig True True True | 72 | (openedRes, openedWidget) <- dayForm (itemOpened <$> proto) $ DayFormConfig True True True |
73 | ((fmap $ fromMaybe False -> runningLowRes), runningLowWidget) <- mopt checkBoxField "" . Just . Just . fromMaybe False $ fmap itemRunningLow proto | ||
73 | 74 | ||
74 | let itemRes = do | 75 | let itemRes = do |
75 | itemKind <- kindRes | 76 | itemKind <- kindRes |
76 | itemBought <- boughtRes | 77 | itemBought <- boughtRes |
77 | itemExpires <- expiresRes | 78 | itemExpires <- expiresRes |
78 | itemOpened <- openedRes | 79 | itemOpened <- openedRes |
80 | itemRunningLow <- runningLowRes | ||
79 | t <- typeRes | 81 | t <- typeRes |
80 | return $ Item{ itemNormKind = normalizeKind itemKind, ..} `WithType` t | 82 | return $ Item{ itemNormKind = normalizeKind itemKind, ..} `WithType` t |
81 | 83 | ||
@@ -87,6 +89,11 @@ itemForm proto identView = do | |||
87 | <div .td>^{boughtWidget} | 89 | <div .td>^{boughtWidget} |
88 | <div .td>^{expiresWidget} | 90 | <div .td>^{expiresWidget} |
89 | <div .td>^{openedWidget} | 91 | <div .td>^{openedWidget} |
92 | <div .td> | ||
93 | <ul .status> | ||
94 | <li>^{fvInput runningLowWidget} # | ||
95 | <label for=#{fvId runningLowWidget}> | ||
96 | Running low | ||
90 | |] | 97 | |] |
91 | where | 98 | where |
92 | dayForm :: Maybe ItemDate -> DayFormConfig -> MForm Handler (FormResult ItemDate, Widget) | 99 | dayForm :: Maybe ItemDate -> DayFormConfig -> MForm Handler (FormResult ItemDate, Widget) |