chore(profile): show company, supervisors and supervisees
This commit is contained in:
parent
7d3b527640
commit
a926cc0774
@ -27,7 +27,11 @@ ProfileCorrectorRemark: Die oberhalb angezeigte Tabelle zeigt nur prinzipielle E
|
||||
ProfileCorrections: Auflistung aller zugewiesenen Korrekturen
|
||||
Remarks: Hinweise
|
||||
|
||||
ProfileSupervisor: Übergeordnete Ansprechpartner
|
||||
ProfileSupervisee: Ist Ansprechpartner für
|
||||
|
||||
UserTelephone: Telefon
|
||||
UserMobile: Mobiltelefon
|
||||
Company: Firmenzugehörigkeit
|
||||
CompanyPersonalNumber: Personalnummer (nur Fraport AG)
|
||||
CompanyDepartment: Abteilung
|
||||
@ -27,7 +27,11 @@ ProfileCorrectorRemark: The table above only shows registration as a corrector i
|
||||
ProfileCorrections: List of all assigned corrections
|
||||
Remarks: Remarks
|
||||
|
||||
ProfileSupervisor: Supervised by
|
||||
ProfileSupervisee: Supervises
|
||||
|
||||
UserTelephone: Phone
|
||||
UserMobile: Mobile
|
||||
Company: Company affilitaion
|
||||
CompanyPersonalNumber: Personnel number (Fraport AG only)
|
||||
CompanyDepartment: Department
|
||||
@ -664,6 +664,27 @@ makeProfileData (Entity uid User{..}) = do
|
||||
E.on $ studyfeat E.^. StudyFeaturesField E.==. studyterms E.^. StudyTermsId
|
||||
E.on $ studyfeat E.^. StudyFeaturesDegree E.==. studydegree E.^. StudyDegreeId
|
||||
return (studyfeat, studydegree, studyterms)
|
||||
companies' <- E.select $ E.from $ \(usrComp `E.InnerJoin` comp) -> do
|
||||
E.where_ $ usrComp E.^. UserCompanyUser E.==. E.val uid
|
||||
E.on $ usrComp E.^. UserCompanyCompany E.==. comp E.^. CompanyId
|
||||
return (comp E.^. CompanyName, usrComp E.^. UserCompanySupervisor)
|
||||
let companies = intersperse (text2markup ", ") $
|
||||
(\(E.Value cmpName, E.Value cmpSpr) -> text2markup (CI.original cmpName) <> bool mempty icnSuper cmpSpr) <$> companies'
|
||||
icnSuper = text2markup " " <> icon IconSupervisor
|
||||
supervisors' <- E.select $ E.from $ \(spvr `E.InnerJoin` usrSpvr) -> do
|
||||
E.where_ $ spvr E.^. UserSupervisorUser E.==. E.val uid
|
||||
E.on $ spvr E.^. UserSupervisorSupervisor E.==. usrSpvr E.^. UserId
|
||||
return (usrSpvr, spvr E.^. UserSupervisorRerouteNotifications)
|
||||
let supervisors = intersperse (text2widget ", ") $
|
||||
(\(usr, E.Value reroutCom) -> linkUserWidget ForProfileDataR usr <> bool mempty icnReroute reroutCom) <$> supervisors'
|
||||
icnReroute = text2widget " " <> toWgt (icon IconLetter)
|
||||
supervisees' <- E.select $ E.from $ \(spvr `E.InnerJoin` usrSpvr) -> do
|
||||
E.where_ $ spvr E.^. UserSupervisorSupervisor E.==. E.val uid
|
||||
E.on $ spvr E.^. UserSupervisorUser E.==. usrSpvr E.^. UserId
|
||||
return (usrSpvr, spvr E.^. UserSupervisorRerouteNotifications)
|
||||
let supervisees = intersperse (text2widget ", ") $
|
||||
(\(usr, E.Value reroutCom) -> linkUserWidget ForProfileDataR usr <> bool mempty icnReroute reroutCom) <$> supervisees'
|
||||
-- icnReroute = text2widget " " <> toWgt (icon IconLetter)
|
||||
--Tables
|
||||
(hasRows, ownedCoursesTable) <- mkOwnedCoursesTable uid -- Tabelle mit eigenen Kursen
|
||||
enrolledCoursesTable <- mkEnrolledCoursesTable uid -- Tabelle mit allen Teilnehmer: Kurs (link), Datum
|
||||
|
||||
@ -59,6 +59,11 @@ nameWidget displayName surname = toWidget $ nameHtml displayName surname
|
||||
userWidget :: HasUser c => c -> Widget
|
||||
userWidget x = nameWidget (x ^. _userDisplayName) (x ^._userSurname)
|
||||
|
||||
linkUserWidget :: HasRoute UniWorX url => (CryptoUUIDUser -> url) -> Entity User -> Widget
|
||||
linkUserWidget lnk (Entity uid usr) = do
|
||||
uuid <- encrypt uid
|
||||
simpleLink (userWidget usr) (lnk uuid)
|
||||
|
||||
-- | toWidget-Version of @nameEmailHtml@, for convenience
|
||||
nameEmailWidget :: UserEmail -- ^ userEmail
|
||||
-> Text -- ^ userDisplayName
|
||||
|
||||
@ -363,6 +363,9 @@ toWgt :: ToMarkup a
|
||||
toWgt = toWidget . toHtml
|
||||
|
||||
-- Convenience Functions to avoid type signatures:
|
||||
text2markup :: Text -> Markup
|
||||
text2markup t = [shamlet|#{t}|]
|
||||
|
||||
text2widget :: Text -> WidgetFor site ()
|
||||
text2widget t = [whamlet|#{t}|]
|
||||
|
||||
|
||||
@ -112,6 +112,7 @@ data Icon
|
||||
| IconPrintCenter
|
||||
| IconLetter
|
||||
| IconAt
|
||||
| IconSupervisor
|
||||
deriving (Eq, Ord, Enum, Bounded, Show, Read, Generic, Typeable)
|
||||
deriving anyclass (Universe, Finite, NFData)
|
||||
|
||||
@ -203,6 +204,7 @@ iconText = \case
|
||||
IconPrintCenter -> "mail-bulk" -- From fontawesome v6 onwards: "envelope-bulk"
|
||||
IconLetter -> "mail-bulk" -- Problem "envelope" already used for email as well
|
||||
IconAt -> "at"
|
||||
IconSupervisor -> "head-side" -- must be notably different to user
|
||||
|
||||
nullaryPathPiece ''Icon $ camelToPathPiece' 1
|
||||
deriveLift ''Icon
|
||||
|
||||
@ -68,6 +68,19 @@ $# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
_{MsgCompanyPersonalNumber}
|
||||
<dd .deflist__dd>
|
||||
#{companyPersonalNumber}
|
||||
$if not $ null companies
|
||||
<dt .deflist__dt>
|
||||
_{MsgCompany}
|
||||
<dd .deflist__dd>
|
||||
^{toWgt (mconcat companies)}
|
||||
$if not $ null supervisors
|
||||
<dt .deflist__dt>_{MsgProfileSupervisor}
|
||||
<dd .deflist__dd>
|
||||
^{mconcat supervisors}
|
||||
$if not $ null supervisees
|
||||
<dt .deflist__dt>_{MsgProfileSupervisee}
|
||||
<dd .deflist__dd>
|
||||
^{mconcat supervisees}
|
||||
$if showAdminInfo
|
||||
<dt .deflist__dt>
|
||||
_{MsgUserCreated}
|
||||
|
||||
@ -478,11 +478,22 @@ fillDb = do
|
||||
I am aware that violations in the form plagiarism or collaboration with third parties will lead to expulsion from the course.
|
||||
|]
|
||||
}
|
||||
_fraportAg <- insert' $ Company "Fraport AG" "Fraport"
|
||||
fraportAg <- insert' $ Company "Fraport AG" "Fraport"
|
||||
_fraGround <- insert' $ Company "Fraport Ground Handling Professionals GmbH" "FraGround"
|
||||
_nice <- insert' $ Company "N*ICE Aircraft Services & Support GmbH" "N*ICE"
|
||||
nice <- insert' $ Company "N*ICE Aircraft Services & Support GmbH" "N*ICE"
|
||||
_ffacil <- insert' $ Company "Fraport Facility Services GmbH" "GCS"
|
||||
_bpol <- insert' $ Company "Bundespolizeidirektion Flughafen Frankfurt am Main" "BPol"
|
||||
bpol <- insert' $ Company "Bundespolizeidirektion Flughafen Frankfurt am Main" "BPol"
|
||||
void . insert' $ UserCompany jost fraportAg True
|
||||
void . insert' $ UserCompany svaupel nice True
|
||||
void . insert' $ UserCompany gkleen nice False
|
||||
void . insert' $ UserCompany fhamann bpol False
|
||||
void . insert' $ UserSupervisor jost gkleen True
|
||||
void . insert' $ UserSupervisor jost svaupel False
|
||||
void . insert' $ UserSupervisor jost sbarth False
|
||||
void . insert' $ UserSupervisor jost tinaTester True
|
||||
void . insert' $ UserSupervisor svaupel gkleen False
|
||||
void . insert' $ UserSupervisor svaupel fhamann True
|
||||
void . insert' $ UserSupervisor sbarth tinaTester True
|
||||
ifi <- insert' $ School "Institut für Informatik" "IfI" (Just $ 14 * nominalDay) (Just $ 10 * nominalDay) True (ExamModeDNF predDNFFalse) (ExamCloseOnFinished True) SchoolAuthorshipStatementModeOptional (Just ifiAuthorshipStatement) True SchoolAuthorshipStatementModeRequired (Just ifiAuthorshipStatement) False
|
||||
mi <- insert' $ School "Institut für Mathematik" "MI" Nothing Nothing False (ExamModeDNF predDNFFalse) (ExamCloseOnFinished False) SchoolAuthorshipStatementModeNone Nothing True SchoolAuthorshipStatementModeOptional Nothing True
|
||||
avn <- insert' $ School "Fahrerausbildung" "FA" Nothing Nothing False (ExamModeDNF predDNFFalse) (ExamCloseOnFinished False) SchoolAuthorshipStatementModeNone Nothing True SchoolAuthorshipStatementModeOptional Nothing True
|
||||
|
||||
Loading…
Reference in New Issue
Block a user