summaryrefslogtreecommitdiff
path: root/Handler/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Handler/Common.hs')
-rw-r--r--Handler/Common.hs7
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)