From 44288b419c31cf74befeea7e77b8be1b5d3340c2 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Sat, 14 Oct 2017 15:35:16 +1100 Subject: [PATCH] Put the s for PGP keys into the page header instead of the h-card itself, since it's invalid HTML to have in the body --- src/Widget/Card.hs | 5 +++++ templates/mf2/h-card.hamlet | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Widget/Card.hs b/src/Widget/Card.hs index 05d7844..fcb705b 100644 --- a/src/Widget/Card.hs +++ b/src/Widget/Card.hs @@ -1,5 +1,6 @@ {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} module Widget.Card ( hCard ) where @@ -31,4 +32,8 @@ hCard (Entity userId user) = do E.orderBy [E.asc $ site ^. SiteName] return (site, profile) pgpKeys <- handlerToWidget . runDB $ map entityVal <$> selectList [PgpKeyUserId ==. userId] [] + toWidgetHead [hamlet| + $forall key <- pgpKeys + + |] $(widgetFile "mf2/h-card") diff --git a/templates/mf2/h-card.hamlet b/templates/mf2/h-card.hamlet index fa100ab..6447796 100644 --- a/templates/mf2/h-card.hamlet +++ b/templates/mf2/h-card.hamlet @@ -7,10 +7,9 @@

#{userFullName user} $forall key <- pgpKeys - + #{prettyPgp key} -

#{userNote user}