refactor(UniWorxMessages): eliminate superfluous whitespace
also: some tutorial code cleaning
This commit is contained in:
parent
ad12b8f927
commit
e5cf120af2
@ -1,4 +1,4 @@
|
||||
-- SPDX-FileCopyrightText: 2022-23 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@ifi.lmu.de>,Sarah Vaupel <vaupel.sarah@campus.lmu.de>,Steffen Jost <s.jost@fraport.de>,Steffen Jost <jost@tcs.ifi.lmu.de>,Winnie Ros <winnie.ros@campus.lmu.de>
|
||||
-- SPDX-FileCopyrightText: 2022-25 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@ifi.lmu.de>,Sarah Vaupel <vaupel.sarah@campus.lmu.de>,Steffen Jost <s.jost@fraport.de>,Steffen Jost <jost@tcs.ifi.lmu.de>,Winnie Ros <winnie.ros@campus.lmu.de>
|
||||
--
|
||||
-- SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@ -549,7 +549,7 @@ instance IsList UniWorXMessages where
|
||||
|
||||
instance RenderMessage UniWorX UniWorXMessages where
|
||||
renderMessage foundation ls (UniWorXMessages msgs) =
|
||||
Text.unwords $ map (renderMessage foundation ls) msgs
|
||||
Text.concat $ map (renderMessage foundation ls) msgs -- Text.unwords for blank separation, Text.concat without
|
||||
|
||||
uniworxMessages :: [UniWorXMessage] -> UniWorXMessages
|
||||
uniworxMessages = UniWorXMessages . map SomeMessage
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
-- SPDX-FileCopyrightText: 2022-23 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@ifi.lmu.de>,Steffen Jost <s.jost@fraport.de>
|
||||
-- SPDX-FileCopyrightText: 2022-25 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@ifi.lmu.de>,Steffen Jost <s.jost@fraport.de>
|
||||
--
|
||||
-- SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
{-# LANGUAGE TypeApplications, BlockArguments #-}
|
||||
|
||||
{-# OPTIONS_GHC -Wno-error=unused-local-binds -Wno-error=unused-matches #-}
|
||||
|
||||
module Handler.Tutorial.Users
|
||||
( getTUsersR, postTUsersR
|
||||
@ -287,7 +286,7 @@ getTExamR, postTExamR :: TermId -> SchoolId -> CourseShorthand -> TutorialName -
|
||||
getTExamR = postTExamR
|
||||
postTExamR tid ssh csh tutn exmName = do
|
||||
let baseroute = CTutorialR tid ssh csh tutn
|
||||
(cid,tutEnt,Entity{entityKey=eId,entityVal=exm},exOccs) <- runDB do
|
||||
(Entity{entityKey=eId,entityVal=exm},exOccs) <- runDB do
|
||||
trm <- get404 tid
|
||||
(cid, tutEnt) <- fetchCourseIdTutorial tid ssh csh tutn
|
||||
exm <- getBy404 $ UniqueExam cid exmName
|
||||
@ -296,7 +295,7 @@ postTExamR tid ssh csh tutn exmName = do
|
||||
-- (fmap (toMidnight . succ) -> tbegin, fmap toMidnight -> tend) = munzip timespan
|
||||
-- exms <- selectList ([ExamCourse ==. cid, ExamStart <=. tend] ++ ([ExamEnd >=. tbegin] ||. [ExamEnd ==. Nothing])) [Asc ExamName]
|
||||
exOccs <- flip foldMapM timespan $ getDayExamOccurrences False ssh $ Just cid
|
||||
return (cid,tutEnt,exm,exOccs)
|
||||
return (exm,exOccs)
|
||||
cueId :: CryptoUUIDExam <- encrypt eId
|
||||
let eid2eos = convertExamOccurrenceMap exOccs
|
||||
(cuEoIds, eos) = munzip $ Map.lookup eId eid2eos
|
||||
@ -320,10 +319,11 @@ postTExamR tid ssh csh tutn exmName = do
|
||||
addMessageI mstat $ MsgExamOccurrencesEdited nrUps nrDel
|
||||
reload $ baseroute $ TExamR exmName
|
||||
|
||||
let heading = prependCourseTitle tid ssh csh $ CI.original $ tutorialName $ entityVal tutEnt
|
||||
-- let heading = prependCourseTitle tid ssh csh $ tutEnt ^. _entityVal . _tutorialName . _CI
|
||||
siteLayoutMsg (MsgMenuTutorialExam exmName) do
|
||||
setTitle $ citext2Html exmName
|
||||
let csh_tutn = csh <> "-" <> tutn -- hack to reuse prependCourseTitle
|
||||
heading = prependCourseTitle tid ssh csh_tutn $ MsgMenuTutorialExam exmName
|
||||
siteLayoutMsg heading do
|
||||
-- setTitle $ citext2Html exmName
|
||||
setTitleI heading
|
||||
[whamlet|
|
||||
<section>
|
||||
<h2>#{CI.original exmName}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
-- SPDX-FileCopyrightText: 2023-24 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>,Winnie Ros <winnie.ros@campus.lmu.de>,Steffen Jost <s.jost@fraport.de>
|
||||
-- SPDX-FileCopyrightText: 2023-25 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>,Winnie Ros <winnie.ros@campus.lmu.de>,Steffen Jost <s.jost@fraport.de>
|
||||
--
|
||||
-- SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
|
||||
Reference in New Issue
Block a user