diff --git a/src/Handler/LMS.hs b/src/Handler/LMS.hs index e6513ccd4..49bd849a1 100644 --- a/src/Handler/LMS.hs +++ b/src/Handler/LMS.hs @@ -407,9 +407,7 @@ mkLmsTable isAdmin (Entity qid quali) acts cols psValidator = do cmpMap <- memcachedBy (Just . Right $ 5 * diffMinute) ("CompanyDictionary"::Text) $ do cmps <- selectList [] [] -- [Asc CompanyShorthand] return $ Map.fromList $ fmap (\Entity{..} -> (entityKey, entityVal)) cmps - let - nowaday = utctDay now - -- mbRenewal = addGregorianDurationClip <$> qualificationRefreshWithin quali <*> Just nowaday + let csvName = T.replace " " "-" $ CI.original (quali ^. _qualificationName) dbtIdent :: Text dbtIdent = "lms" @@ -726,8 +724,7 @@ getLmsIdentR sid qid ident = redirect (LmsR sid qid, [("lms-ident", toPathPiece getLmsUserR :: CryptoUUIDUser -> Handler Html getLmsUserR uuid = do uid <- decrypt uuid - now <- liftIO getCurrentTime - let nowaday = utctDay now + now <- liftIO getCurrentTime (user@User{userDisplayName}, quals, qblocks) <- runDB $ do usr <- get404 uid qs <- Ex.select $ do @@ -745,7 +742,7 @@ getLmsUserR uuid = do E.||. E.isJust ( lmsUsr E.?. LmsUserUser) Ex.orderBy [Ex.asc $ qual E.^. QualificationShorthand] pure (qual, qualUsr, lmsUsr, validQualification' now qualUsr) - bs :: Map.Map QualificationUserId [(Entity QualificationUserBlock, Ex.Value (Maybe UserDisplayName), Ex.Value (Maybe UserSurname))] + bs :: Map.Map QualificationUserId [(Entity QualificationUserBlock, Ex.Value (Maybe UserDisplayName))] <- foldMapM (\(_, mbqu, _, _) -> case mbqu of Nothing -> pure mempty Just (Entity quid _) -> do @@ -755,7 +752,7 @@ getLmsUserR uuid = do `Ex.on` (\(qBlock :& qbUsr) -> qBlock Ex.^. QualificationUserBlockBlocker Ex.==. qbUsr Ex.?. UserId) Ex.where_ $ qBlock Ex.^. QualificationUserBlockQualificationUser Ex.==. Ex.val quid Ex.orderBy [Ex.desc (qBlock Ex.^. QualificationUserBlockFrom)] - pure (qBlock, qbUsr Ex.?. UserDisplayName, qbUsr Ex.?. UserSurname) + pure (qBlock, qbUsr Ex.?. UserDisplayName) return $ Map.singleton quid blocks ) qs return (usr,qs,bs) diff --git a/templates/lms-user.hamlet b/templates/lms-user.hamlet index c039d4c93..a78c9523c 100644 --- a/templates/lms-user.hamlet +++ b/templates/lms-user.hamlet @@ -25,19 +25,15 @@ $else
+
$maybe bdn <- E.unValue blockerDN - $maybe bsn <- E.unValue blockerSN - ^{nameWidget bdn bsn} - $nothing - ^{text2widget bdn} - $nothing - ? + ^{editedByW SelFormatDateTime (view _qualificationUserBlockFrom block) bdn} + $nothing + ^{formatTimeW SelFormatDateTime (view _qualificationUserBlockFrom block)}