Catalog - don't render intro if there's no subject
This commit is contained in:
parent
e63b688239
commit
7592bd19ee
|
@ -92,13 +92,7 @@ gridItem iface m post =
|
|||
, b_ [][ text post_count_str ]
|
||||
, "+"
|
||||
]
|
||||
, p_
|
||||
[ class_ "intro" ]
|
||||
[ span_
|
||||
[ class_ "subject" ]
|
||||
subject
|
||||
]
|
||||
] ++ body
|
||||
] ++ (intro subject) ++ body
|
||||
)
|
||||
]
|
||||
|
||||
|
@ -106,6 +100,15 @@ gridItem iface m post =
|
|||
subject :: [ View a ]
|
||||
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 = map (rawHtml . toMisoString) $ maybeToList $ CatalogPost.body post
|
||||
|
||||
|
|
Loading…
Reference in New Issue