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

View file

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