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