Catalog - don't render intro if there's no subject

This commit is contained in:
towards-a-new-leftypol 2024-02-13 03:56:25 -05:00
parent e63b688239
commit 7592bd19ee
1 changed files with 10 additions and 7 deletions

View File

@ -92,13 +92,7 @@ gridItem iface m post =
, b_ [][ text post_count_str ] , b_ [][ text post_count_str ]
, "+" , "+"
] ]
, p_ ] ++ (intro subject) ++ body
[ class_ "intro" ]
[ span_
[ class_ "subject" ]
subject
]
] ++ body
) )
] ]
@ -106,6 +100,15 @@ gridItem iface m post =
subject :: [ View a ] subject :: [ View a ]
subject = map (text . toMisoString) $ maybeToList $ CatalogPost.subject post subject = map (text . toMisoString) $ maybeToList $ CatalogPost.subject post
intro :: [ View a ] -> [ View a ]
intro [] = []
intro x = (: []) $ p_
[ class_ "intro" ]
[ span_
[ class_ "subject" ]
x
]
body :: [ View a ] body :: [ View a ]
body = map (rawHtml . toMisoString) $ maybeToList $ CatalogPost.body post body = map (rawHtml . toMisoString) $ maybeToList $ CatalogPost.body post