Show fully info on StudyTerms in UserProfileDataR

This commit is contained in:
Steffen Jost 2019-03-20 19:55:44 +01:00
parent 5b8a79590d
commit 0cc2f28089
3 changed files with 30 additions and 24 deletions

View File

@ -193,7 +193,7 @@ deleteUser duid = do
getProfileDataR :: Handler Html getProfileDataR :: Handler Html
getProfileDataR = do getProfileDataR = do
(uid, User{..}) <- requireAuthPair (uid, User{..}) <- requireAuthPair
-- mr <- getMessageRender -- MsgRenderer mr <- getMsgRenderer
(admin_rights,lecturer_rights,lecture_corrector,studies) <- runDB $ (,,,) <$> (admin_rights,lecturer_rights,lecture_corrector,studies) <- runDB $ (,,,) <$>
E.select E.select
( E.from $ \(adright `E.InnerJoin` school) -> do ( E.from $ \(adright `E.InnerJoin` school) -> do
@ -222,14 +222,7 @@ getProfileDataR = do
E.where_ $ studyfeat E.^. StudyFeaturesUser E.==. E.val uid E.where_ $ studyfeat E.^. StudyFeaturesUser E.==. E.val uid
E.on $ studyfeat E.^. StudyFeaturesField E.==. studyterms E.^. StudyTermsId E.on $ studyfeat E.^. StudyFeaturesField E.==. studyterms E.^. StudyTermsId
E.on $ studyfeat E.^. StudyFeaturesDegree E.==. studydegree E.^. StudyDegreeId E.on $ studyfeat E.^. StudyFeaturesDegree E.==. studydegree E.^. StudyDegreeId
return ( ( studydegree E.^. StudyDegreeName return (studyfeat, studydegree, studyterms)
, studydegree E.^. StudyDegreeKey
)
, ( studyterms E.^. StudyTermsName
, studyterms E.^. StudyTermsKey
)
, studyfeat E.^. StudyFeaturesType
, studyfeat E.^. StudyFeaturesSemester)
) )
( (hasRows, ownedCoursesTable) ( (hasRows, ownedCoursesTable)
, enrolledCoursesTable , enrolledCoursesTable

View File

@ -276,6 +276,21 @@ stepTextCounter text
-- Data.Text.groupBy ((==) `on` isDigit) $ Data.Text.pack "12.ProMo Ue3bung00322 34 (H)" -- Data.Text.groupBy ((==) `on` isDigit) $ Data.Text.pack "12.ProMo Ue3bung00322 34 (H)"
-- ["12",".ProMo Ue","3","bung","00322"," ","34"," (H)"] -- ["12",".ProMo Ue","3","bung","00322"," ","34"," (H)"]
-- | Ignore warnings for unused variables with a more specific type
notUsedT :: a -> Text
notUsedT = notUsed
------------
-- Monoid --
------------
-- | Ignore warnings for unused variables
notUsed :: Monoid m => a -> m
notUsed = const mempty
------------ ------------
-- Tuples -- -- Tuples --
------------ ------------

View File

@ -12,7 +12,7 @@
<dd .deflist__dd> #{display userIdent} <dd .deflist__dd> #{display userIdent}
<dt .deflist__dt> _{MsgLastLogin} <dt .deflist__dt> _{MsgLastLogin}
<dd .deflist__dd> <dd .deflist__dd>
$maybe llogin <- lastLogin $maybe llogin <- lastLogin
#{llogin} #{llogin}
$nothing $nothing
_{MsgNever} _{MsgNever}
@ -45,25 +45,23 @@
<div .scrolltable> <div .scrolltable>
<table .table.table--striped.table--hover.table--condensed> <table .table.table--striped.table--hover.table--condensed>
<tr .table__row> <tr .table__row>
<th .table__th> Abschluss
<th .table__th> Studiengang <th .table__th> Studiengang
<th .table__th> Abschluss
<th .table__th> Studienart <th .table__th> Studienart
<th .table__th> Semester <th .table__th> Semester
<th .table__th> Aktiv
<th .table__th> Update
$forall ((degree, degreeKey),(field, fieldKey),fieldtype,semester) <- studies
$forall ((Entity _ StudyFeatures{..}), (Entity _ degree), (Entity _ field)) <- studies
$with _ <- notUsedT studyFeaturesUser
<tr.table__row> <tr.table__row>
<td .table__td> <td .table__td>_{field}#{notUsedT studyFeaturesField}
$maybe name <- E.unValue degree <td .table__td>_{degree}#{notUsedT studyFeaturesDegree}
#{display name} <td .table__td>_{studyFeaturesType}
$nothing <td .table__td>#{display studyFeaturesSemester}
#{display degreeKey} <td .table__td>#{hasTickmark studyFeaturesValid}
<td .table__td> <td .table__td>^{formatTimeW SelFormatDateTime studyFeaturesUpdated}
$maybe name <- E.unValue field
#{display name}
$nothing
#{display fieldKey}
<td .table__td>_{E.unValue fieldtype}
<td .table__td>#{display semester}
<div .container> <div .container>
$if hasRows $if hasRows