feat(user): add get-labels to exam office user setting
This commit is contained in:
parent
6a10bd78f5
commit
5a3c590b72
@ -58,3 +58,11 @@ ExamOfficeFieldForced: Forcierte Einsicht
|
||||
|
||||
ExamOfficeGetSynced: Synchronisiert-Status in Prüfungsliste anzeigen
|
||||
ExamOfficeGetSyncedTip: Soll unter „Prüfungen“ der Synchronisiert-Status zu jeder Prüfung angezeigt werden? (Ein Deaktivieren dieser Option kann zu kürzeren Ladezeiten der Prüfungsliste führen.)
|
||||
ExamOfficeGetLabels: Labels in Prüfungsliste anzeigen
|
||||
ExamOfficeGetLabelsTip: Sollen unter „Prüfungen“ die gesetzten Labels zu jeder Prüfung angezeigt werden?
|
||||
|
||||
ExamOfficeSettings: Prüfungsliste („Prüfungen“)
|
||||
ExamOfficeSettingsGetSynced: Synchronisiert-Status anzeigen
|
||||
ExamOfficeSettingsGetSyncedTip: Soll der Synchronisiert-Status zu jeder Prüfung angezeigt werden? (Ein Deaktivieren dieser Option kann die Ladezeiten der Prüfungsliste verkürzen.)
|
||||
ExamOfficeSettingsGetLabels: Labels anzeigen
|
||||
ExamOfficeSettingsGetLabelsTip: Sollen die gesetzten Labels zu jeder Prüfung angezeigt werden?
|
||||
|
||||
@ -56,3 +56,11 @@ ExamOfficeFieldForced: Forced access
|
||||
|
||||
ExamOfficeGetSynced: Show synchronised status in exam list
|
||||
ExamOfficeGetSyncedTip: Should the synchronised status be displayed in “Exams”? (Disabling this option may lead to shorter loading times of the exam list.)
|
||||
ExamOfficeGetLabels: Show labels in exam list
|
||||
ExamOfficeGetLabelsTip: Should the labels of each exam be displayed in “Exams”?
|
||||
|
||||
ExamOfficeSettings: Exam list (“Exams”)
|
||||
ExamOfficeSettingsGetSynced: Show synchronised status
|
||||
ExamOfficeSettingsGetSyncedTip: Should the synchronised status be displayed for each exam? (Disabling this option may lead to shorter loading times of the exam list.)
|
||||
ExamOfficeSettingsGetLabels: Show labels
|
||||
ExamOfficeSettingsGetLabelsTip: Should the labels of each exam be displayed?
|
||||
|
||||
@ -314,13 +314,16 @@ allocationNotificationForm = maybe (pure mempty) allocationNotificationForm' . (
|
||||
|
||||
examOfficeForm :: Maybe ExamOfficeSettings -> AForm Handler ExamOfficeSettings
|
||||
examOfficeForm template = wFormToAForm $ do
|
||||
(_uid, User{userExamOfficeGetSynced}) <- requireAuthPair
|
||||
(_uid, User{userExamOfficeGetSynced,userExamOfficeGetLabels}) <- requireAuthPair
|
||||
userIsExamOffice <- liftHandler . hasReadAccessTo $ ExamOfficeR EOExamsR
|
||||
if userIsExamOffice
|
||||
then aFormToWForm . fmap ExamOfficeSettings $
|
||||
aformSection MsgFormExamOffice
|
||||
*> apopt checkBoxField (fslI MsgExamOfficeGetSynced & setTooltip MsgExamOfficeGetSyncedTip) (eosettingsGetSynced <$> template)
|
||||
else return . pure . fromMaybe (ExamOfficeSettings userExamOfficeGetSynced) $ template
|
||||
then aFormToWForm $ liftA2 ExamOfficeSettings
|
||||
( aformSection MsgFormExamOffice
|
||||
*> apopt checkBoxField (fslI MsgExamOfficeGetSynced & setTooltip MsgExamOfficeGetSyncedTip) (eosettingsGetSynced <$> template)
|
||||
)
|
||||
( apopt checkBoxField (fslI MsgExamOfficeGetLabels & setTooltip MsgExamOfficeGetLabelsTip) (eosettingsGetLabels <$> template)
|
||||
)
|
||||
else return . pure . fromMaybe (ExamOfficeSettings userExamOfficeGetSynced userExamOfficeGetLabels) $ template
|
||||
|
||||
|
||||
validateSettings :: User -> FormValidator SettingsForm Handler ()
|
||||
@ -377,6 +380,7 @@ postProfileR = do
|
||||
, stgShowSex = userShowSex
|
||||
, stgExamOfficeSettings = ExamOfficeSettings
|
||||
{ eosettingsGetSynced = userExamOfficeGetSynced
|
||||
, eosettingsGetLabels = userExamOfficeGetLabels
|
||||
}
|
||||
, stgAllocationNotificationSettings = allocs
|
||||
}
|
||||
|
||||
@ -36,7 +36,8 @@ validDisplayName (fmap Text.strip -> mTitle) (Text.strip -> fName) (Text.strip -
|
||||
addLetters = Set.fromList [' ']
|
||||
|
||||
|
||||
newtype ExamOfficeSettings
|
||||
data ExamOfficeSettings
|
||||
= ExamOfficeSettings
|
||||
{ eosettingsGetSynced :: Bool
|
||||
, eosettingsGetLabels :: Bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user