fix(correction): comment column made wide in online correction form
column width enlarged for online correction and attempt at issue #373
This commit is contained in:
parent
609821595b
commit
d83b1f696f
@ -219,7 +219,7 @@ colPointsField = sortable (Just "rating") (i18nCell MsgColumnRatingPoints) $ for
|
|||||||
)
|
)
|
||||||
|
|
||||||
colCommentField :: Colonnade Sortable CorrectionTableData (DBCell _ (FormResult (DBFormResult SubmissionId (a, b, Maybe Text) CorrectionTableData)))
|
colCommentField :: Colonnade Sortable CorrectionTableData (DBCell _ (FormResult (DBFormResult SubmissionId (a, b, Maybe Text) CorrectionTableData)))
|
||||||
colCommentField = sortable (Just "comment") (i18nCell MsgRatingComment) $ formCell id
|
colCommentField = sortable (Just "comment") (i18nCell MsgRatingComment) $ fmap (addCellAttrs [("style","width:60%")]) $ formCell id
|
||||||
(\DBRow{ dbrOutput=(Entity subId _, _, _, _, _, _) } -> return subId)
|
(\DBRow{ dbrOutput=(Entity subId _, _, _, _, _, _) } -> return subId)
|
||||||
(\DBRow{ dbrOutput=(Entity _ Submission{..}, _, _, _, _, _) } mkUnique -> over (_1.mapped) ((_3 .~) . assertM (not . null) . fmap (Text.strip . unTextarea)) . over _2 fvInput <$> mopt textareaField (fsUniq mkUnique "comment") (Just $ Textarea <$> submissionRatingComment))
|
(\DBRow{ dbrOutput=(Entity _ Submission{..}, _, _, _, _, _) } mkUnique -> over (_1.mapped) ((_3 .~) . assertM (not . null) . fmap (Text.strip . unTextarea)) . over _2 fvInput <$> mopt textareaField (fsUniq mkUnique "comment") (Just $ Textarea <$> submissionRatingComment))
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@ module Handler.Utils.Table.Cells where
|
|||||||
|
|
||||||
import Import
|
import Import
|
||||||
|
|
||||||
|
import qualified Control.Monad.Trans.RWS.Lazy
|
||||||
|
|
||||||
import Data.CaseInsensitive (CI)
|
import Data.CaseInsensitive (CI)
|
||||||
-- import qualified Data.CaseInsensitive as CI
|
-- import qualified Data.CaseInsensitive as CI
|
||||||
|
|
||||||
@ -25,6 +27,26 @@ type CourseLink = (TermId, SchoolId, CourseShorthand) -- TODO: Refactor with Wit
|
|||||||
-- Some basic cells are defined in Handler.Utils.Table.Pagination
|
-- Some basic cells are defined in Handler.Utils.Table.Pagination
|
||||||
-- such as: i18nCell, cellTooltip, anchorCell for links, etc.
|
-- such as: i18nCell, cellTooltip, anchorCell for links, etc.
|
||||||
|
|
||||||
|
----------------
|
||||||
|
-- Cell transformation
|
||||||
|
|
||||||
|
-- | Add cell attributes
|
||||||
|
addCellAttrs :: [(Text, Text)]
|
||||||
|
-> DBCell (Control.Monad.Trans.RWS.Lazy.RWST
|
||||||
|
(Maybe (Env, FileEnv), UniWorX, [Lang])
|
||||||
|
Enctype
|
||||||
|
Ints
|
||||||
|
(HandlerT UniWorX IO))
|
||||||
|
x
|
||||||
|
-> DBCell (Control.Monad.Trans.RWS.Lazy.RWST
|
||||||
|
(Maybe (Env, FileEnv), UniWorX, [Lang])
|
||||||
|
Enctype
|
||||||
|
Ints
|
||||||
|
(HandlerT UniWorX IO))
|
||||||
|
x
|
||||||
|
addCellAttrs newAttrs fcell = fcell { formCellAttrs = newAttrs <> formCellAttrs fcell } -- Isn't there already a lens for that?
|
||||||
|
|
||||||
|
|
||||||
----------------
|
----------------
|
||||||
-- Special cells
|
-- Special cells
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user