From 85bdf8766bc18e96a7d2a4fc2234d6c999331414 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 25 Jan 2019 18:55:20 +0100 Subject: [PATCH] Minor cleanup (cellTell) --- src/Handler/Sheet.hs | 2 +- src/Handler/Utils/Table/Cells.hs | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Handler/Sheet.hs b/src/Handler/Sheet.hs index abf2d9a35..59f751286 100644 --- a/src/Handler/Sheet.hs +++ b/src/Handler/Sheet.hs @@ -226,7 +226,7 @@ getSheetListR tid ssh csh = do mkRoute = do cid' <- mkCid 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") (i18nCell MsgRatingPercent) diff --git a/src/Handler/Utils/Table/Cells.hs b/src/Handler/Utils/Table/Cells.hs index cc1e21a5a..3f7f9c62b 100644 --- a/src/Handler/Utils/Table/Cells.hs +++ b/src/Handler/Utils/Table/Cells.hs @@ -16,13 +16,7 @@ type CourseLink = (TermId, SchoolId, CourseShorthand) -- TODO: Refactor with Wit -- Special cells cellTell :: (Monoid a, IsDBTable m a) => a -> DBCell m a -> DBCell m a -cellTell x c = c & cellContents %~ (tell x *>) - -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 - +cellTell = flip mappend . writerCell . tell indicatorCell :: IsDBTable m Any => DBCell m Any -- For dbTables that return a Bool to indicate content indicatorCell = writerCell . tell $ Any True