diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs
index 01353c4b7..584d91e02 100644
--- a/src/Handler/Course.hs
+++ b/src/Handler/Course.hs
@@ -836,10 +836,11 @@ postCUserR tid ssh csh uCId = do
dozentId <- requireAuthId
uid <- decrypt uCId
-- DB reads
- (cid, User{..}, thisUniqueNote, noteText, noteEdits, studies ) <- runDB $ do
+ (cid, User{..}, registration, thisUniqueNote, noteText, noteEdits, studies ) <- runDB $ do
cid <- getKeyBy404 $ TermSchoolCourseShort tid ssh csh
-- Abfrage Benutzerdaten
user <- get404 uid
+ registration <- fmap entityVal <$> getBy (UniqueParticipant uid cid)
-- Abfrage Teilnehmernotiz
let thisUniqueNote = UniqueCourseUserNote uid cid
mbNoteEnt <- getBy thisUniqueNote
@@ -860,7 +861,7 @@ postCUserR tid ssh csh uCId = do
E.on $ studyfeat E.^. StudyFeaturesDegree E.==. studydegree E.^. StudyDegreeId
return (studyfeat, studydegree, studyterms)
- return (cid,user,thisUniqueNote,noteText,noteEdits,studies)
+ return (cid,user,registration,thisUniqueNote,noteText,noteEdits,studies)
let editByWgt = [whamlet|
$forall (etime,_eemail,ename,_esurname) <- noteEdits
@@ -888,6 +889,11 @@ postCUserR tid ssh csh uCId = do
addMessageI Success MsgCourseUserNoteSaved
redirect currentRoute -- reload page after post
)
+ -- De-/Register Button for Lecturer
+ mRegAt <- traverse (formatTime SelFormatDateTime) $ courseParticipantRegistration <$> registration
+ ((registerRes,registerView), registerEnctype) <- runFormPost $ registerForm (Just uid) registration Nothing Nothing -- Lecturers are never asked their own register secret
+ formResult registerRes $ \(mbfeatures, _secretCorrect) ->
+ error "TODO: change registration"
-- generate output
let headingLong = [whamlet|^{nameWidget userDisplayName userSurname} - _{MsgCourseMemberOf} #{csh} #{display tid}|]
headingShort = prependCourseTitle tid ssh csh $ SomeMessage userDisplayName
diff --git a/templates/course-user.hamlet b/templates/course-user.hamlet
index 4e5d793f8..c7ae5a0c6 100644
--- a/templates/course-user.hamlet
+++ b/templates/course-user.hamlet
@@ -9,6 +9,16 @@
#{matnr}
$nothing
_{MsgNoMatrikelKnown}
+