add nsfw class to alt buttons

This commit is contained in:
Rhiannon Morris 2020-07-09 06:19:19 +02:00
parent 3cd7bc98f6
commit be4b539138
1 changed files with 2 additions and 1 deletions

View File

@ -63,12 +63,13 @@ formatDate = fromString . formatTime defaultTimeLocale "%e %#B %Y"
altButton :: Int -> Image -> Builder
altButton i (Image {label, path, nsfw}) =
" <li>\n" <>
" <li" <> nsfwClass <> ">\n" <>
" <input type=radio " <> checked <> "id=\"" <> idLabel <> "\" " <>
"name=variant autocomplete=off\n" <>
" value=\"" <> fromText path <> "\">\n" <>
" <label for=\"" <> idLabel <> "\">" <> fromText label <> "</label>\n"
where
nsfwClass = if nsfw then " class=nsfw" else ""
checked = if i == 0 then "checked " else ""
idLabel = escId label