Merge branch 'master' of gitlab.cip.ifi.lmu.de:jost/UniWorX
This commit is contained in:
commit
50c733cc9c
@ -59,6 +59,8 @@ Deadline: Abgabe
|
|||||||
Done: Eingereicht
|
Done: Eingereicht
|
||||||
|
|
||||||
Submission: Abgabenummer
|
Submission: Abgabenummer
|
||||||
|
SubmissionsCourse tid@TermId courseShortHand@Text: Alle Abgaben Kurs #{display tid}-#{courseShortHand}
|
||||||
|
SubmissionsSheet sheetName@Text: Abgaben für Blatt #{sheetName}
|
||||||
SubmissionWrongSheet: Abgabenummer gehört nicht zum angegebenen Übungsblatt.
|
SubmissionWrongSheet: Abgabenummer gehört nicht zum angegebenen Übungsblatt.
|
||||||
SubmissionAlreadyExists: Sie haben bereits eine Abgabe zu diesem Übungsblatt.
|
SubmissionAlreadyExists: Sie haben bereits eine Abgabe zu diesem Übungsblatt.
|
||||||
SubmissionEditHead tid@TermId courseShortHand@Text sheetName@Text: #{display tid}-#{courseShortHand} #{sheetName}: Abgabe editieren/anlegen
|
SubmissionEditHead tid@TermId courseShortHand@Text sheetName@Text: #{display tid}-#{courseShortHand} #{sheetName}: Abgabe editieren/anlegen
|
||||||
@ -70,6 +72,7 @@ SubmissionAlreadyExistsFor user@Text: #{user} hat bereits eine Abgabe zu diesem
|
|||||||
|
|
||||||
CorrectionsTitle: Zugewiesene Korrekturen
|
CorrectionsTitle: Zugewiesene Korrekturen
|
||||||
CourseCorrectionsTitle: Korrekturen für diesen Kurs
|
CourseCorrectionsTitle: Korrekturen für diesen Kurs
|
||||||
|
CorrectorsHead sheetName@Text: Korrektoren für Blatt #{sheetName}
|
||||||
|
|
||||||
Unauthorized: Sie haben hierfür keine explizite Berechtigung.
|
Unauthorized: Sie haben hierfür keine explizite Berechtigung.
|
||||||
UnauthorizedAnd l@Text r@Text: (#{l} UND #{r})
|
UnauthorizedAnd l@Text r@Text: (#{l} UND #{r})
|
||||||
@ -112,6 +115,7 @@ Users: Benutzer
|
|||||||
HomeHeading: Aktuelle Termine
|
HomeHeading: Aktuelle Termine
|
||||||
ProfileHeading: Benutzerprofil und Einstellungen
|
ProfileHeading: Benutzerprofil und Einstellungen
|
||||||
ProfileDataHeading: Gespeicherte Benutzerdaten
|
ProfileDataHeading: Gespeicherte Benutzerdaten
|
||||||
|
ImpressumHeading: Impressum
|
||||||
|
|
||||||
NumCourses n@Int64: #{display n} Kurse
|
NumCourses n@Int64: #{display n} Kurse
|
||||||
CloseAlert: Schliessen
|
CloseAlert: Schliessen
|
||||||
|
|||||||
@ -765,6 +765,12 @@ pageActions (CSheetR tid csh shn SShowR) =
|
|||||||
, menuItemRoute = CSheetR tid csh shn SSubsR
|
, menuItemRoute = CSheetR tid csh shn SSubsR
|
||||||
, menuItemAccessCallback' = return True
|
, menuItemAccessCallback' = return True
|
||||||
}
|
}
|
||||||
|
, PageActionPrime $ MenuItem
|
||||||
|
{ menuItemLabel = "Blatt Editieren"
|
||||||
|
, menuItemIcon = Nothing
|
||||||
|
, menuItemRoute = CSheetR tid csh shn SEditR
|
||||||
|
, menuItemAccessCallback' = return True
|
||||||
|
}
|
||||||
]
|
]
|
||||||
pageActions (CSubmissionR tid csh shn cid SubShowR) =
|
pageActions (CSubmissionR tid csh shn cid SubShowR) =
|
||||||
[ PageActionPrime $ MenuItem
|
[ PageActionPrime $ MenuItem
|
||||||
@ -846,6 +852,8 @@ pageHeading (AdminTestR)
|
|||||||
= Just $ [whamlet|Internal Code Demonstration Page|]
|
= Just $ [whamlet|Internal Code Demonstration Page|]
|
||||||
pageHeading (AdminUserR _)
|
pageHeading (AdminUserR _)
|
||||||
= Just $ [whamlet|User Display for Admin|]
|
= Just $ [whamlet|User Display for Admin|]
|
||||||
|
pageHeading (VersionR)
|
||||||
|
= Just $ i18nHeading MsgImpressumHeading
|
||||||
|
|
||||||
pageHeading ProfileR
|
pageHeading ProfileR
|
||||||
= Just $ i18nHeading MsgProfileHeading
|
= Just $ i18nHeading MsgProfileHeading
|
||||||
@ -870,32 +878,41 @@ pageHeading (CourseR tid csh CShowR)
|
|||||||
= Just $ do
|
= Just $ do
|
||||||
Entity _ Course{..} <- handlerToWidget . runDB . getBy404 $ CourseTermShort tid csh
|
Entity _ Course{..} <- handlerToWidget . runDB . getBy404 $ CourseTermShort tid csh
|
||||||
toWidget courseName
|
toWidget courseName
|
||||||
pageHeading CorrectionsR
|
|
||||||
= Just $ i18nHeading MsgCorrectionsTitle
|
|
||||||
pageHeading CorrectionsUploadR
|
|
||||||
= Just $ i18nHeading MsgCorrUpload
|
|
||||||
-- (CourseR tid csh CRegisterR) -- just for POST
|
-- (CourseR tid csh CRegisterR) -- just for POST
|
||||||
pageHeading (CourseR tid csh CEditR)
|
pageHeading (CourseR tid csh CEditR)
|
||||||
= Just $ i18nHeading $ MsgCourseEditHeading tid csh
|
= Just $ i18nHeading $ MsgCourseEditHeading tid csh
|
||||||
|
pageHeading (CourseR tid csh CourseCorrectionsR)
|
||||||
|
= Just $ i18nHeading $ MsgSubmissionsCourse tid csh
|
||||||
pageHeading (CourseR tid csh SheetListR)
|
pageHeading (CourseR tid csh SheetListR)
|
||||||
= Just $ i18nHeading $ MsgSheetList tid csh
|
= Just $ i18nHeading $ MsgSheetList tid csh
|
||||||
pageHeading (CourseR tid csh SheetNewR)
|
pageHeading (CourseR tid csh SheetNewR)
|
||||||
= Just $ i18nHeading $ MsgSheetNewHeading tid csh
|
= Just $ i18nHeading $ MsgSheetNewHeading tid csh
|
||||||
pageHeading (CSheetR tid csh shn SShowR)
|
pageHeading (CSheetR tid csh shn SShowR)
|
||||||
= Just $ i18nHeading $ MsgSheetTitle tid csh shn
|
= Just $ i18nHeading $ MsgSheetTitle tid csh shn
|
||||||
-- (CSheetR tid csh shn SFileR) -- just for Downloads
|
|
||||||
pageHeading (CSheetR tid csh shn SEditR)
|
pageHeading (CSheetR tid csh shn SEditR)
|
||||||
= Just $ i18nHeading $ MsgSheetEditHead tid csh shn
|
= Just $ i18nHeading $ MsgSheetEditHead tid csh shn
|
||||||
pageHeading (CSheetR tid csh shn SDelR)
|
pageHeading (CSheetR tid csh shn SDelR)
|
||||||
= Just $ i18nHeading $ MsgSheetDelHead tid csh shn
|
= Just $ i18nHeading $ MsgSheetDelHead tid csh shn
|
||||||
|
pageHeading (CSheetR tid csh shn SSubsR)
|
||||||
|
= Just $ i18nHeading $ MsgSubmissionsSheet shn
|
||||||
pageHeading (CSheetR tid csh shn SubmissionNewR)
|
pageHeading (CSheetR tid csh shn SubmissionNewR)
|
||||||
= Just $ i18nHeading $ MsgSubmissionEditHead tid csh shn
|
= Just $ i18nHeading $ MsgSubmissionEditHead tid csh shn
|
||||||
pageHeading (CSheetR tid csh shn SubmissionOwnR)
|
pageHeading (CSheetR tid csh shn SubmissionOwnR)
|
||||||
= Just $ i18nHeading $ MsgSubmissionEditHead tid csh shn
|
= Just $ i18nHeading $ MsgSubmissionEditHead tid csh shn
|
||||||
pageHeading (CSubmissionR tid csh shn _ SubShowR) -- TODO: Rethink this one!
|
pageHeading (CSubmissionR tid csh shn _ SubShowR) -- TODO: Rethink this one!
|
||||||
= Just $ i18nHeading $ MsgSubmissionEditHead tid csh shn
|
= Just $ i18nHeading $ MsgSubmissionEditHead tid csh shn
|
||||||
|
-- (CSubmissionR tid csh shn cid SubArchiveR) -- just a download
|
||||||
pageHeading (CSubmissionR tid csh shn cid CorrectionR)
|
pageHeading (CSubmissionR tid csh shn cid CorrectionR)
|
||||||
= Just $ i18nHeading $ MsgCorrectionHead tid csh shn cid
|
= Just $ i18nHeading $ MsgCorrectionHead tid csh shn cid
|
||||||
|
-- (CSubmissionR tid csh shn cid SubDownloadR) -- just a download
|
||||||
|
pageHeading (CSheetR tid csh shn SCorrR)
|
||||||
|
= Just $ i18nHeading $ MsgCorrectorsHead shn
|
||||||
|
-- (CSheetR tid csh shn SFileR) -- just for Downloads
|
||||||
|
|
||||||
|
pageHeading CorrectionsR
|
||||||
|
= Just $ i18nHeading MsgCorrectionsTitle
|
||||||
|
pageHeading CorrectionsUploadR
|
||||||
|
= Just $ i18nHeading MsgCorrUpload
|
||||||
|
|
||||||
-- TODO: add headings for more single course- and single term-pages
|
-- TODO: add headings for more single course- and single term-pages
|
||||||
pageHeading _
|
pageHeading _
|
||||||
|
|||||||
@ -266,7 +266,7 @@ posIntField d = checkBool (>= 1) (T.append d " muss eine positive Zahl sein.")
|
|||||||
minIntField :: (Monad m, Integral i, Show i, RenderMessage (HandlerSite m) FormMessage) => i -> Text -> Field m i
|
minIntField :: (Monad m, Integral i, Show i, RenderMessage (HandlerSite m) FormMessage) => i -> Text -> Field m i
|
||||||
minIntField m d = checkBool (>= m) (T.concat [d," muss größer als ", T.pack $ show m, " sein."]) $ intField
|
minIntField m d = checkBool (>= m) (T.concat [d," muss größer als ", T.pack $ show m, " sein."]) $ intField
|
||||||
|
|
||||||
pointsField :: (Monad m, HandlerSite m ~ UniWorX) => Field m Points
|
pointsField :: (Monad m, HandlerSite m ~ UniWorX) => Field m Points --TODO allow fractions
|
||||||
pointsField = checkBool (>= 0) MsgPointsNotPositive Field{..}
|
pointsField = checkBool (>= 0) MsgPointsNotPositive Field{..}
|
||||||
where
|
where
|
||||||
fieldEnctype = UrlEncoded
|
fieldEnctype = UrlEncoded
|
||||||
|
|||||||
@ -4,3 +4,4 @@ module Import
|
|||||||
|
|
||||||
import Foundation as Import
|
import Foundation as Import
|
||||||
import Import.NoFoundation as Import
|
import Import.NoFoundation as Import
|
||||||
|
|
||||||
|
|||||||
@ -40,14 +40,14 @@ import Data.Typeable (Typeable)
|
|||||||
|
|
||||||
type Points = Centi
|
type Points = Centi
|
||||||
|
|
||||||
toPoints :: Integral a => a -> Points
|
toPoints :: Integral a => a -> Points -- deprecated
|
||||||
toPoints = MkFixed . fromIntegral
|
toPoints = fromIntegral
|
||||||
|
|
||||||
pToI :: Points -> Integer
|
pToI :: Points -> Integer -- deprecated
|
||||||
pToI = fromPoints -- TODO: do we want to multiply?
|
pToI = fromPoints
|
||||||
|
|
||||||
fromPoints :: Integral a => Points -> a
|
fromPoints :: Integral a => Points -> a -- deprecated
|
||||||
fromPoints (MkFixed c) = fromInteger c
|
fromPoints = round
|
||||||
|
|
||||||
data SheetType
|
data SheetType
|
||||||
= Bonus { maxPoints :: Points }
|
= Bonus { maxPoints :: Points }
|
||||||
@ -57,9 +57,9 @@ data SheetType
|
|||||||
deriving (Show, Read, Eq)
|
deriving (Show, Read, Eq)
|
||||||
|
|
||||||
instance DisplayAble SheetType where
|
instance DisplayAble SheetType where
|
||||||
display (Bonus {..}) = tshow (pToI maxPoints) <> " Bonuspunkte"
|
display (Bonus {..}) = tshow maxPoints <> " Bonuspunkte"
|
||||||
display (Normal{..}) = tshow (pToI maxPoints) <> " Punkte"
|
display (Normal{..}) = tshow maxPoints <> " Punkte"
|
||||||
display (Pass {..}) = "Bestanden ab " <> tshow (pToI passingPoints) <> " von " <> tshow (pToI maxPoints)
|
display (Pass {..}) = "Bestanden ab " <> tshow (pToI passingPoints) <> " von " <> tshow maxPoints
|
||||||
display (NotGraded) = "Unbewertet"
|
display (NotGraded) = "Unbewertet"
|
||||||
|
|
||||||
deriveJSON defaultOptions ''SheetType
|
deriveJSON defaultOptions ''SheetType
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user