feat(course-events): add optional note to course events
This commit is contained in:
parent
a4d4c224e9
commit
6ad8f2ee29
@ -2218,6 +2218,7 @@ CourseEventType: Art
|
||||
CourseEventTypePlaceholder: Vorlesung, Zentralübung, ...
|
||||
CourseEventTime: Zeit
|
||||
CourseEventRoom: Regulärer Raum
|
||||
CourseEventNote: Notiz
|
||||
CourseEventActions: Aktionen
|
||||
CourseEventsActionEdit: Bearbeiten
|
||||
CourseEventsActionDelete: Löschen
|
||||
|
||||
@ -2218,6 +2218,7 @@ CourseEventType: Type
|
||||
CourseEventTypePlaceholder: Lecture, Exercise discussion, ...
|
||||
CourseEventTime: Time
|
||||
CourseEventRoom: Regular room
|
||||
CourseEventNote: Note
|
||||
CourseEventActions: Actions
|
||||
CourseEventsActionEdit: Edit
|
||||
CourseEventsActionDelete: Delete
|
||||
|
||||
@ -30,6 +30,7 @@ CourseEvent
|
||||
course CourseId
|
||||
room Text
|
||||
time Occurrences
|
||||
note Text Maybe
|
||||
lastChanged UTCTime default=now()
|
||||
|
||||
CourseAppInstructionFile
|
||||
|
||||
@ -24,6 +24,7 @@ postCEvEditR tid ssh csh cID = do
|
||||
, courseEventType = cefType
|
||||
, courseEventRoom = cefRoom
|
||||
, courseEventTime = cefTime
|
||||
, courseEventNote = cefNote
|
||||
, courseEventLastChanged = now
|
||||
}
|
||||
addMessageI Success MsgCourseEventEdited
|
||||
|
||||
@ -15,6 +15,7 @@ data CourseEventForm = CourseEventForm
|
||||
{ cefType :: CI Text
|
||||
, cefRoom :: Text
|
||||
, cefTime :: Occurrences
|
||||
, cefNote :: Maybe Text
|
||||
}
|
||||
|
||||
courseEventForm :: Maybe CourseEventForm -> Form CourseEventForm
|
||||
@ -34,15 +35,18 @@ courseEventForm template = identifyForm FIDCourseEvent . renderWForm FormStandar
|
||||
cefType' <- wreq (textField & cfStrip & cfCI & addDatalist courseEventTypes) (fslI MsgCourseEventType & addPlaceholder (mr MsgCourseEventTypePlaceholder)) (cefType <$> template)
|
||||
cefRoom' <- wreq (textField & cfStrip & addDatalist courseEventRooms) (fslI MsgCourseEventRoom) (cefRoom <$> template)
|
||||
cefTime' <- aFormToWForm $ occurrencesAForm ("time" :: Text) (cefTime <$> template)
|
||||
cefNote' <- wopt textField (fslI MsgCourseEventNote) (cefNote <$> template)
|
||||
|
||||
return $ CourseEventForm
|
||||
<$> cefType'
|
||||
<*> cefRoom'
|
||||
<*> cefTime'
|
||||
<*> cefNote'
|
||||
|
||||
courseEventToForm :: CourseEvent -> CourseEventForm
|
||||
courseEventToForm CourseEvent{..} = CourseEventForm
|
||||
{ cefType = courseEventType
|
||||
, cefRoom = courseEventRoom
|
||||
, cefTime = courseEventTime
|
||||
, cefNote = courseEventNote
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@ postCEventsNewR tid ssh csh = do
|
||||
, courseEventType = cefType
|
||||
, courseEventRoom = cefRoom
|
||||
, courseEventTime = cefTime
|
||||
, courseEventNote = cefNote
|
||||
, courseEventLastChanged = now
|
||||
}
|
||||
encrypt eId :: DB CryptoUUIDCourseEvent
|
||||
|
||||
Loading…
Reference in New Issue
Block a user