Add a u-uid to the h-card to ensure the h-card is considered representative

This commit is contained in:
Danielle McLean 2017-10-04 10:07:51 +11:00
parent 484609fb8b
commit 25a1e00cd7
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
3 changed files with 7 additions and 0 deletions

View file

@ -28,6 +28,7 @@ routeFromPgp PgpKey { pgpKeyFingerprint = f, pgpKeyHash = h } =
hcard :: Entity User -> Widget
hcard (Entity userId user) = do
maybeAvatar <- liftIO $ L.avatarUrl (L.Email $ userEmail user) def { L.optSecure = True, L.optSize = L.Size 512 }
mcurrentRoute <- getCurrentRoute
userProfiles <- handlerToWidget . runDB $ do
profiles <- map entityVal <$> selectList [ProfileUserId ==. userId] []
sites <- M.fromList . map entityToTuple <$> selectList [SiteId <-. (profileSiteId <$> profiles)] []

View file

@ -1,5 +1,7 @@
.card.h-card
margin: 2em auto
width: 22rem
.u-uid.u-url:first-child
display: none
.card-link
white-space: nowrap

View file

@ -1,6 +1,10 @@
<div .card.h-card>
$maybe route <- mcurrentRoute
<a .u-uid.u-url rel="me" href=@{route}>
$maybe avatar <- maybeAvatar
<img .card-img-top.u-photo src=#{avatar} alt="Avatar for #{userFullName user}">
<div .card-body>
<h4 .card-title.p-name>#{userFullName user}
$forall key <- pgpKeys