feat(submissions): display submittors more explicitly

This commit is contained in:
Gregor Kleen 2021-08-06 16:22:53 +02:00
parent 625caa10b5
commit d2e2456f62
5 changed files with 74 additions and 9 deletions

View File

@ -201,4 +201,9 @@ SubmissionAuthorshipStatementTip: Um abgeben zu können, müssen Sie die vorgege
SubmissionLecturerAuthorshipStatement: Eigenständigkeitserklärung
SubmissionLecturerAuthorshipStatementTip: Wenn Sie sich selbst als Mitabgebende/Mitabgebender eintragen müssen Sie eine Eigenständigkeitserklärung abgeben. Beachten Sie, dass Sie eine Eigenständigkeitserklärung nur für sich selbst abgeben können, nicht für etwaige andere Mitabgebende; falls Sie eine Eigenständigkeitserklärung abgeben, wird diese nur unter Ihrem Namen in Uni2work gespeichert.
SubmissionLecturerAuthorshipStatementRequiredBecauseSubmittor: Da Sie sich selbst als Mitabgebende/Mitabgebender eingetragen haben, müssen Sie eine Eigenständigkeitserklärung abgeben.
SubmissionCoSubmittorsInviteRequiredBecauseAuthorshipStatements: Da für die Abgabe zu diesem Übungsblatt die Abgabe einer Eigenständigkeitserklärung vorausgesetzt wird, werden bekannte E-Mail Adressen bekannter Benutzer nicht aufgelöst. Mitabgebende müssen stattdessen per E-Mail eingeladen werden.
SubmissionCoSubmittorsInviteRequiredBecauseAuthorshipStatements: Da für die Abgabe zu diesem Übungsblatt die Abgabe einer Eigenständigkeitserklärung vorausgesetzt wird, werden bekannte E-Mail Adressen bekannter Benutzer nicht aufgelöst. Mitabgebende müssen stattdessen per E-Mail eingeladen werden.
SubmissionUserTable: Abgebende
SubmissionUserDisplayName !ident-ok: Name
SubmissionUserMatriculation: Matrikelnummer
SubmissionUserEmail: E-Mail

View File

@ -201,3 +201,8 @@ SubmissionLecturerAuthorshipStatement: Statement of Authorship
SubmissionLecturerAuthorshipStatementTip: If you enter yourself as a submittor you have to confirm the Statement of Authorship. Note that you can only confirm the Statement of Authorship for yourself. If you confirm it, it will be recorded only under your name.
SubmissionLecturerAuthorshipStatementRequiredBecauseSubmittor: Since you have entered yourself as a submittor you have to confirm the Statement of Authorship.
SubmissionCoSubmittorsInviteRequiredBecauseAuthorshipStatements: Since Statements of Authorship are required to submit for this exercise sheet, e-mail addresses of known users are not resolved. Instead co-submittors will have to be invited via e-mail.
SubmissionUserTable: Submittors
SubmissionUserDisplayName: Name
SubmissionUserMatriculation: Matriculation
SubmissionUserEmail: Email

View File

@ -547,8 +547,8 @@ submissionHelper tid ssh csh shn mcid = do
, formEncoding = formEnctype
}
((Entity _ Sheet{..}, _, lastEdits, maySubmit, _, _, msubmission, corrector), (showCorrection, correctionInvisible), mFileTable, filesCorrected, sheetTypeDesc, multipleSubmissionWarnWidget) <- runDB $ do
sheetInfo@(Entity shid Sheet{..}, _, _, _, _, _, msubmission, _) <- getSheetInfo
((Entity _ Sheet{..}, _, lastEdits, maySubmit, _, _, msubmission, corrector), (showCorrection, correctionInvisible), mFileTable, filesCorrected, sheetTypeDesc, multipleSubmissionWarnWidget, subUsers, isLecturer) <- runDB $ do
sheetInfo@(Entity shid Sheet{..}, buddies, _, _, isLecturer, isOwner, msubmission, _) <- getSheetInfo
(showCorrection, correctionInvisible) <- fmap (fromMaybe (False, Nothing)) . for ((,) <$> mcid <*> (Entity <$> msmid <*> msubmission)) $ \(cid, subEnt) -> do
showCorrection <- hasReadAccessTo $ CSubmissionR tid ssh csh shn cid CorrectionR
@ -581,7 +581,13 @@ submissionHelper tid ssh csh shn mcid = do
E.&&. submissionUser E.^. SubmissionUserSubmission E.==. E.val subId
return $ notification NotificationBroad =<< messageIconI Warning IconSubmissionUserDuplicate MsgSubmissionSomeUsersDuplicateWarning
return (sheetInfo, (showCorrection, correctionInvisible), mFileTable, filesCorrected, sheetTypeDesc, multipleSubmissionWarnWidget)
subUsers <- do
let subUsers' = Set.toList $ bool id (maybe id (Set.insert . Right) muid) isOwner buddies
subUsers'' <- forMOf (traverse . _Right) subUsers' $ \uid -> (,) <$> (encrypt uid :: DB CryptoUUIDUser) <*> getJust uid
return $ subUsers''
& sortOn (over _Right $ (,,,) <$> views _2 userSurname <*> views _2 userDisplayName <*> views _2 userEmail <*> view _1)
return (sheetInfo, (showCorrection, correctionInvisible), mFileTable, filesCorrected, sheetTypeDesc, multipleSubmissionWarnWidget, subUsers, isLecturer)
defaultLayout $ do
setTitleI $ MsgHeadingSubmissionEditHead tid ssh csh shn

View File

@ -31,12 +31,19 @@ visibleUTCTime dtf t = do
-- | Simple link to a known route
simpleLink :: RedirectUrl UniWorX url => Widget -> url -> Widget
simpleLink :: HasRoute UniWorX url => Widget -> url -> Widget
simpleLink lbl url = do
tUrl <- toTextUrl url
[whamlet|<a href=#{tUrl}>^{lbl}|]
isAuth <- hasReadAccessTo $ urlRoute url
if | isAuth -> do
tUrl <- toTextUrl url
[whamlet|
$newline never
<a href=#{tUrl}>
^{lbl}
|]
| otherwise -> lbl
simpleLinkI :: (RenderMessage UniWorX msg, RedirectUrl UniWorX url) => msg -> url -> Widget
simpleLinkI :: (RenderMessage UniWorX msg, HasRoute UniWorX url) => msg -> url -> Widget
simpleLinkI = simpleLink . i18n
-- | toWidget-Version of @nameHtml@, for convenience

View File

@ -9,7 +9,49 @@ $if is _Just mcid
^{wdgt}
^{maybeVoid multipleSubmissionWarnWidget}
<section>
<h2>
_{MsgSubmissionUserTable}
^{maybeVoid multipleSubmissionWarnWidget}
$if not (null subUsers)
<div .scrolltable>
<table .table .table--striped .table--hover>
<tr .table__tr>
<th .table__th>
<div .table__td-content>
_{MsgSubmissionUserDisplayName}
$if isLecturer
<th .table__th>
<div .table__td-content>
_{MsgSubmissionUserMatriculation}
<th .table__th>
<div .table__td-content>
_{MsgSubmissionUserEmail}
$forall subUser <- subUsers
$case subUser
$of Left email
<tr .table__tr>
<td .table__td>
<td .table__td>
<div .table__td-content .email>
<a href="mailto:#{email}">
#{email}
$of Right (uCId, User{userDisplayName, userSurname, userEmail, userMatrikelnummer})
<tr .table__tr>
<td .table__td>
<div .table__td-content>
^{simpleLink (nameWidget userDisplayName userSurname) (CourseR tid ssh csh (CUserR uCId))}
$if isLecturer
<td .table__td>
<div .table__td-content>
$maybe matriculation <- userMatrikelnummer
#{matriculation}
<td .table__td>
<div .table__td-content .email>
<a href="mailto:#{userEmail}">
#{userEmail}
<section>
$case sheetSubmissionMode