Minor cleanup (cellTell)
This commit is contained in:
parent
593ec541b8
commit
85bdf8766b
@ -226,7 +226,7 @@ getSheetListR tid ssh csh = do
|
|||||||
mkRoute = do
|
mkRoute = do
|
||||||
cid' <- mkCid
|
cid' <- mkCid
|
||||||
return $ CSubmissionR tid ssh csh sheetName cid' CorrectionR
|
return $ CSubmissionR tid ssh csh sheetName cid' CorrectionR
|
||||||
in cellTell' stats $ anchorCellM mkRoute $(widgetFile "widgets/rating")
|
in cellTell stats $ anchorCellM mkRoute $(widgetFile "widgets/rating")
|
||||||
|
|
||||||
, sortable Nothing -- (Just "percent")
|
, sortable Nothing -- (Just "percent")
|
||||||
(i18nCell MsgRatingPercent)
|
(i18nCell MsgRatingPercent)
|
||||||
|
|||||||
@ -16,13 +16,7 @@ type CourseLink = (TermId, SchoolId, CourseShorthand) -- TODO: Refactor with Wit
|
|||||||
-- Special cells
|
-- Special cells
|
||||||
|
|
||||||
cellTell :: (Monoid a, IsDBTable m a) => a -> DBCell m a -> DBCell m a
|
cellTell :: (Monoid a, IsDBTable m a) => a -> DBCell m a -> DBCell m a
|
||||||
cellTell x c = c & cellContents %~ (tell x *>)
|
cellTell = flip mappend . writerCell . tell
|
||||||
|
|
||||||
cellTell' :: Monoid w => w -> DBCell (HandlerT UniWorX IO) w -> DBCell (HandlerT UniWorX IO) w
|
|
||||||
cellTell' x c = c { wgtCellContents = tell x >> oldContent }
|
|
||||||
where
|
|
||||||
oldContent = wgtCellContents c
|
|
||||||
|
|
||||||
|
|
||||||
indicatorCell :: IsDBTable m Any => DBCell m Any -- For dbTables that return a Bool to indicate content
|
indicatorCell :: IsDBTable m Any => DBCell m Any -- For dbTables that return a Bool to indicate content
|
||||||
indicatorCell = writerCell . tell $ Any True
|
indicatorCell = writerCell . tell $ Any True
|
||||||
|
|||||||
Reference in New Issue
Block a user