allow changing the link

This commit is contained in:
byte[] 2019-11-18 00:05:42 -05:00
parent cd48d948cb
commit bc82e368a5
2 changed files with 7 additions and 4 deletions

View file

@ -1,10 +1,11 @@
- link = Routes.gallery_path(@conn, :show, @gallery)
.media-box
a.media-box__header.media-box__header--link href=Routes.gallery_path(@conn, :show, @gallery) title=@gallery.title
a.media-box__header.media-box__header--link href=link title=@gallery.title
= @gallery.title
.media-box__overlay
= @gallery.spoiler_warning
.media-box__content.media-box__content--large
a href=Routes.gallery_path(@conn, :show, @gallery)
= render PhilomenaWeb.ImageView, "_image_container.html", image: @gallery.thumbnail, size: :thumb, conn: @conn
= render PhilomenaWeb.ImageView, "_image_container.html", image: @gallery.thumbnail, size: :thumb, conn: @conn, link: link

View file

@ -1,3 +1,5 @@
- link = assigns[:link] || Routes.image_path(@conn, :show, @image)
= image_container @image, @size, fn ->
= cond do
- @image.duplicate_id ->
@ -13,7 +15,7 @@
- true ->
.media-box__overlay.js-spoiler-info-overlay
a href="/#{@image.id}"
a href=link
= if @image.thumbnails_generated do
- uris = thumb_urls(@image, false)
- vid = @image.image_mime_type == "video/webm"