Support non-fa site icons by giving sites an actual name separate from their icon class
This commit is contained in:
parent
18ffe8ea4d
commit
09731053c2
5 changed files with 5 additions and 4 deletions
|
@ -15,6 +15,7 @@ PgpKey
|
||||||
UniqueFingerprint fingerprint
|
UniqueFingerprint fingerprint
|
||||||
|
|
||||||
Site
|
Site
|
||||||
|
name Text sqltype=varchar(255)
|
||||||
icon Text sqltype=varchar(255)
|
icon Text sqltype=varchar(255)
|
||||||
template Text sqltype=varchar(255)
|
template Text sqltype=varchar(255)
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ arrangeProfiles :: [Profile] -> M.Map (Key Site) (Site, Template) -> [((Site, Te
|
||||||
arrangeProfiles profiles sites = sortBy icon $ zip profileSites profiles
|
arrangeProfiles profiles sites = sortBy icon $ zip profileSites profiles
|
||||||
where findSite = fromJust . flip M.lookup sites . profileSiteId
|
where findSite = fromJust . flip M.lookup sites . profileSiteId
|
||||||
profileSites = findSite <$> profiles
|
profileSites = findSite <$> profiles
|
||||||
icon = comparing $ siteIcon . fst . fst
|
icon = comparing $ siteName . fst . fst
|
||||||
|
|
||||||
prettyPgp :: PgpKey -> Text
|
prettyPgp :: PgpKey -> Text
|
||||||
prettyPgp = T.unwords . T.chunksOf 4 . pgpKeyFingerprint
|
prettyPgp = T.unwords . T.chunksOf 4 . pgpKeyFingerprint
|
||||||
|
|
|
@ -31,7 +31,7 @@ hEntry (Entity entryId entry) = do
|
||||||
E.on $ profile ^. ProfileSiteId E.==. site ^. SiteId
|
E.on $ profile ^. ProfileSiteId E.==. site ^. SiteId
|
||||||
E.on $ syndication ^. SyndicationProfileId E.==. profile ^. ProfileId
|
E.on $ syndication ^. SyndicationProfileId E.==. profile ^. ProfileId
|
||||||
E.where_ $ syndication ^. SyndicationEntryId E.==. E.val entryId
|
E.where_ $ syndication ^. SyndicationEntryId E.==. E.val entryId
|
||||||
E.orderBy [E.asc $ site ^. SiteIcon]
|
E.orderBy [E.asc $ site ^. SiteName]
|
||||||
return (syndication ^. SyndicationUrl, site ^. SiteIcon, E.coalesceDefault [profile ^. ProfileDisplayName] (profile ^. ProfileUsername))
|
return (syndication ^. SyndicationUrl, site ^. SiteIcon, E.coalesceDefault [profile ^. ProfileDisplayName] (profile ^. ProfileUsername))
|
||||||
maybeAuthor <- handlerToWidget . runDB . get . entryAuthorId $ entry
|
maybeAuthor <- handlerToWidget . runDB . get . entryAuthorId $ entry
|
||||||
$(widgetFile "mf2/h-entry")
|
$(widgetFile "mf2/h-entry")
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
$forall ((site, template), profile) <- userProfiles
|
$forall ((site, template), profile) <- userProfiles
|
||||||
<li>
|
<li>
|
||||||
<a .u-url itemprop="sameAs" rel="me" href="#{substitute template profile}">
|
<a .u-url itemprop="sameAs" rel="me" href="#{substitute template profile}">
|
||||||
<i .fa.fa-#{siteIcon site}>
|
<i .#{siteIcon site}>
|
||||||
$maybe name <- profileDisplayName profile
|
$maybe name <- profileDisplayName profile
|
||||||
#{name}
|
#{name}
|
||||||
$nothing
|
$nothing
|
||||||
|
|
|
@ -19,5 +19,5 @@
|
||||||
#{timeFriendly updated}
|
#{timeFriendly updated}
|
||||||
$forall (E.Value url, E.Value icon, E.Value name) <- posses
|
$forall (E.Value url, E.Value icon, E.Value name) <- posses
|
||||||
<a .u-syndication href=#{url}>
|
<a .u-syndication href=#{url}>
|
||||||
<i .fa.fa-#{icon}>
|
<i .#{icon}>
|
||||||
#{name}
|
#{name}
|
||||||
|
|
Loading…
Reference in a new issue