From 2aa73b769484a40d246d5b76560177021f198487 Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Wed, 8 May 2019 10:14:49 +0200 Subject: [PATCH] Minor clarifications --- src/Handler/Utils/Form/MassInput.hs | 4 +++- src/Handler/Utils/Table/Cells.hs | 12 +++++++----- src/Handler/Utils/Table/Pagination.hs | 2 +- templates/info-lecturer/de.hamlet | 20 +++++++++++++++----- templates/versionHistory.hamlet | 4 +--- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/Handler/Utils/Form/MassInput.hs b/src/Handler/Utils/Form/MassInput.hs index abec6f300..2c6560876 100644 --- a/src/Handler/Utils/Form/MassInput.hs +++ b/src/Handler/Utils/Form/MassInput.hs @@ -269,6 +269,8 @@ type MassInputLayout liveliness cellData cellResult -> Map (Natural, BoxCoord liveliness) Widget -- Addition forms -> Widget +-- | Multiple multi-layerd input fields +-- May short-circuit a handler if the frontend only asks for the content, i.e. handler actions after calls to massInput may not happen at all. massInput :: forall handler cellData cellResult liveliness. ( MonadHandler handler, HandlerSite handler ~ UniWorX , ToJSON cellData, FromJSON cellData @@ -443,7 +445,7 @@ defaultMiLayout liveliness _ cellResults delResults addResults = miWidget' boxOr cells | [] <- remDims = do coord <- coords - Just cellWdgt <- return $ Map.lookup coord cellResults + Just cellWdgt <- return $ Map.lookup coord cellResults let deleteButton = Map.lookup coord delResults return (coord, $(widgetFile "widgets/massinput/cell")) | otherwise = diff --git a/src/Handler/Utils/Table/Cells.hs b/src/Handler/Utils/Table/Cells.hs index 7d559fd64..139d13dc6 100644 --- a/src/Handler/Utils/Table/Cells.hs +++ b/src/Handler/Utils/Table/Cells.hs @@ -53,10 +53,11 @@ pathPieceCell = cell . toWidget . toPathPiece sqlCell :: (IsDBTable (YesodDB UniWorX) a) => YesodDB UniWorX Widget -> DBCell (YesodDB UniWorX) a sqlCell act = mempty & cellContents .~ lift act +-- | Highlight table cells with warning: Is not yet implemented in frontend. markCell :: (IsDBTable m a) => (t -> Bool) -> (t -> DBCell m a) -> (t -> DBCell m a) markCell condition normal x - | condition x = normal x <> cell (isVisibleWidget False) - | otherwise = normal x + | condition x = normal x & cellAttrs <>~ [("class","urgency__warning")] ---TODO: handle existing classe akin to Form.addAttr/addClass + | otherwise = normal x ifCell :: (IsDBTable m a) => (t -> Bool) -> (t -> DBCell m a) -> (t -> DBCell m a) -> (t -> DBCell m a) ifCell decision cTrue cFalse x @@ -103,9 +104,10 @@ dateTimeCell t = cell $ formatTime SelFormatDateTime t >>= toWidget dateTimeCellVisible :: IsDBTable m a => UTCTime -> UTCTime -> DBCell m a dateTimeCellVisible watershed t = cell $ do - tfw <- formatTime SelFormatDateTime t >>= toWidget - icn <- bool mempty (toWidget $ isVisible False) $ watershed < t - return $ tfw <> icn + let tfw = formatTimeW SelFormatDateTime t + icn :: Widget + icn = bool mempty (toWidget $ isVisible False) $ watershed < t + [whamlet|^{tfw} ^{icn}|] userCell :: IsDBTable m a => Text -> Text -> DBCell m a userCell displayName surname = cell $ nameWidget displayName surname diff --git a/src/Handler/Utils/Table/Pagination.hs b/src/Handler/Utils/Table/Pagination.hs index 36d2cfaca..65716bc11 100644 --- a/src/Handler/Utils/Table/Pagination.hs +++ b/src/Handler/Utils/Table/Pagination.hs @@ -613,7 +613,7 @@ instance Monoid' x => Monoid (DBCell (RWST (Maybe (Env, FileEnv), UniWorX, [Lang instance IsDBTable m a => IsString (DBCell m a) where fromString = cell . fromString --- | DB-backed tables with pagination, may short-circuit a handler +-- | DB-backed tables with pagination, may short-circuit a handler if the frontend only asks for the table content, i.e. handler actions after calls to dbTable may not happen at all. dbTable :: forall m x. IsDBTable m x => PSValidator m x -> DBTable m x -> DB (DBResult m x) dbTable PSValidator{..} dbtable@DBTable{ dbtIdent = dbtIdent'@(toPathPiece -> dbtIdent), dbtStyle = DBStyle{..}, .. } = do let diff --git a/templates/info-lecturer/de.hamlet b/templates/info-lecturer/de.hamlet index 5ad4a1192..e766ef7da 100644 --- a/templates/info-lecturer/de.hamlet +++ b/templates/info-lecturer/de.hamlet @@ -175,12 +175,22 @@ $newline text Studierenden ein neues Pseudonym erstellen, damit eine anonyme Korrektur gewährleistet werden kann. + Dadurch wird aber noch keine Abgabe im System angelegt, + da ich nicht alle Teilnehmer, welche ein Pseudonym anfordern, + auch tatsächlich abgeben.
  • - Korrektoren bekommen die externen Abgaben - ausgehändigt. - Anhand der Pseudonyme werden - in Uni2work Abgaben angelegt, - welche wie üblich korrigiert werden können. +

    + Korrektoren bekommen die externen Abgaben + ausgehändigt. + Anhand der Pseudonyme + muss der Korrektor dann in Uni2work + + Abgaben anlegen + , welche danach wie üblich korrigiert werden können. +

    + Solche angelgten Abgaben werden bei der nächsten + Verteilung von Übungsblättern + dem jeweiligen Korrektor zum Arbeitspensum angerechnet.

    Tutorien diff --git a/templates/versionHistory.hamlet b/templates/versionHistory.hamlet index 994c553ce..295fb0094 100644 --- a/templates/versionHistory.hamlet +++ b/templates/versionHistory.hamlet @@ -7,10 +7,8 @@

    Bekannte Bugs

    - Stand: März 2019 + Stand: Mai 2019
      -
    • - Login ist u.U. anders als im alten System, z.B. momentan geht nur @campus.lmu.de aber nicht die Abkürzung @lmu.de
    • Format von Bewertungsdateien ist noch provisorisch