Handler.Utils.Table.cellTell added, but does not work as intended.
This commit is contained in:
parent
b5ef2e13f9
commit
c0605024c9
@ -221,12 +221,12 @@ getSheetListR tid ssh csh = do
|
|||||||
$ \DBRow{dbrOutput=(Entity _ Sheet{..}, _, mbSub)} -> case mbSub of
|
$ \DBRow{dbrOutput=(Entity _ Sheet{..}, _, mbSub)} -> case mbSub of
|
||||||
Nothing -> mempty
|
Nothing -> mempty
|
||||||
(Just (Entity sid Submission{..})) ->
|
(Just (Entity sid Submission{..})) ->
|
||||||
let _stats = sheetTypeSum sheetType submissionRatingPoints -- for statistics over all shown rows
|
let stats = sheetTypeSum sheetType submissionRatingPoints -- for statistics over all shown rows
|
||||||
mkCid = encrypt sid
|
mkCid = encrypt sid
|
||||||
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 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)
|
||||||
|
|||||||
@ -14,6 +14,15 @@ 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 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
|
||||||
|
|
||||||
|
|
||||||
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 = mempty & cellContents %~ (tell (Any True) *>)
|
indicatorCell = mempty & cellContents %~ (tell (Any True) *>)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user