fix download links for multipart pics
This commit is contained in:
parent
7488b6cbce
commit
9c11993f7e
1 changed files with 5 additions and 2 deletions
|
@ -191,19 +191,22 @@ makeButtonBar title images =
|
||||||
where alts = map (\(i, (im, sz)) -> altButton i im sz) $ zip [0..] images
|
where alts = map (\(i, (im, sz)) -> altButton i im sz) $ zip [0..] images
|
||||||
|
|
||||||
altButton :: Int -> Image -> Size -> Builder
|
altButton :: Int -> Image -> Size -> Builder
|
||||||
altButton i (Image {label, path, nsfw, warning}) (Size {width, height}) = [b|@0
|
altButton i img size = [b|@0
|
||||||
<li$nsfwClass>
|
<li$nsfwClass>
|
||||||
<input type=radio$checked name=variant id="$idLabel" value="$path'"
|
<input type=radio$checked name=variant id="$idLabel" value="$path'"
|
||||||
data-link="$path"$warning'
|
data-link="$link"$warning'
|
||||||
data-width=$width data-height=$height>
|
data-width=$width data-height=$height>
|
||||||
<label for="$idLabel"$nsfwLabelClass>$label</label>
|
<label for="$idLabel"$nsfwLabelClass>$label</label>
|
||||||
|]
|
|]
|
||||||
where
|
where
|
||||||
|
Image {label, path, nsfw, warning, download} = img
|
||||||
|
Size {width, height} = size
|
||||||
nsfwClass = if nsfw then [b| class=nsfw|] else ""
|
nsfwClass = if nsfw then [b| class=nsfw|] else ""
|
||||||
nsfwLabelClass = if nsfw then [b| class=nsfw-label|] else ""
|
nsfwLabelClass = if nsfw then [b| class=nsfw-label|] else ""
|
||||||
checked = if i == 0 then [b| checked|] else ""
|
checked = if i == 0 then [b| checked|] else ""
|
||||||
idLabel = escId label
|
idLabel = escId label
|
||||||
path' = pageFile path
|
path' = pageFile path
|
||||||
|
link = fromMaybe path download
|
||||||
warning' = ifJust warning \(escAttr -> w) -> [b| data-warning="$w"|]
|
warning' = ifJust warning \(escAttr -> w) -> [b| data-warning="$w"|]
|
||||||
|
|
||||||
makeTags :: FilePath -> [Strict.Text] -> Builder
|
makeTags :: FilePath -> [Strict.Text] -> Builder
|
||||||
|
|
Loading…
Reference in a new issue