a lot of stylin and a little scriptin

This commit is contained in:
Rhiannon Morris 2020-07-17 12:29:13 +02:00
parent 3635f04e8f
commit 64e00f83f1
16 changed files with 555 additions and 82 deletions

View file

@ -14,6 +14,7 @@ make' ginfos = [b|@0
<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<link rel=stylesheet href=/style/index.css>
<title>gallery list</title>
@ -31,9 +32,11 @@ make' ginfos = [b|@0
items = map makeItem ginfos
makeItem :: GalleryInfo -> Builder
makeItem (GalleryInfo {title, prefix}) = [b|@4
<li>
<a href="$@prefix">
$*title
</a>
makeItem (GalleryInfo {title, prefix, filters}) = [b|@4
<li$nsfw><a href=$@prefix>$*title</a>
|]
where
nsfw = if hasNsfw filters then " class=nsfw" else ""
hasNsfw :: GalleryFilters -> Bool
hasNsfw (GalleryFilters {nsfw}) = nsfw /= Just False