2019-12-01 18:11:00 +01:00
|
|
|
- link = assigns[:link] || Routes.image_path(@conn, :show, @image)
|
2019-11-18 06:05:42 +01:00
|
|
|
|
2019-12-09 05:41:35 +01:00
|
|
|
= image_container @conn, @image, @size, fn ->
|
2019-08-18 18:17:05 +02:00
|
|
|
= cond do
|
|
|
|
- @image.duplicate_id ->
|
|
|
|
.media-box__overlay
|
|
|
|
strong Marked Duplicate
|
2019-12-01 18:11:00 +01:00
|
|
|
|
2019-08-18 18:17:05 +02:00
|
|
|
- @image.destroyed_content ->
|
|
|
|
.media-box__overlay
|
|
|
|
strong Destroyed Content
|
2019-12-01 18:11:00 +01:00
|
|
|
|
2019-08-18 18:17:05 +02:00
|
|
|
- @image.hidden_from_users ->
|
|
|
|
.media-box__overlay
|
|
|
|
strong Deleted:
|
|
|
|
=< @image.deletion_reason
|
2023-11-23 17:07:49 +01:00
|
|
|
|
2019-08-18 18:17:05 +02:00
|
|
|
- true ->
|
|
|
|
|
2019-12-07 21:36:02 +01:00
|
|
|
= case render_intent(@conn, @image, @size) do
|
|
|
|
- {:hidpi, small_url, medium_url, hover_text} ->
|
2020-01-01 05:11:17 +01:00
|
|
|
.media-box__overlay.js-spoiler-info-overlay
|
2019-12-07 21:36:02 +01:00
|
|
|
a href=link title=hover_text
|
2023-11-23 17:07:49 +01:00
|
|
|
img.media-box__image src=small_url srcset="#{small_url} 1x, #{medium_url} 2x" alt=hover_text
|
2019-10-11 03:47:13 +02:00
|
|
|
|
2019-12-07 21:36:02 +01:00
|
|
|
- {:image, small_url, hover_text} ->
|
2020-01-01 05:11:17 +01:00
|
|
|
.media-box__overlay.js-spoiler-info-overlay
|
|
|
|
= if @image.image_mime_type == "video/webm" do
|
|
|
|
| WebM
|
|
|
|
|
2019-12-07 21:36:02 +01:00
|
|
|
a href=link title=hover_text
|
2023-11-23 17:07:49 +01:00
|
|
|
img.media-box__image src=small_url alt=hover_text
|
2019-11-30 23:40:53 +01:00
|
|
|
|
2019-12-07 21:36:02 +01:00
|
|
|
- {:video, webm, mp4, hover_text} ->
|
2020-01-01 05:11:17 +01:00
|
|
|
.media-box__overlay.js-spoiler-info-overlay
|
2019-12-07 21:36:02 +01:00
|
|
|
a href=link title=hover_text
|
2019-11-30 23:40:53 +01:00
|
|
|
video alt=hover_text autoplay="autoplay" muted="muted" loop="loop" playsinline="playsinline"
|
|
|
|
source src=webm type="video/webm"
|
|
|
|
source src=mp4 type="video/mp4"
|
2023-11-23 17:07:49 +01:00
|
|
|
img.media-box__image alt=hover_text
|
2019-11-30 23:40:53 +01:00
|
|
|
|
2019-12-07 21:36:02 +01:00
|
|
|
- {:filtered_image, hover_text} ->
|
2020-01-01 05:11:17 +01:00
|
|
|
.media-box__overlay.js-spoiler-info-overlay
|
2019-12-07 21:36:02 +01:00
|
|
|
a href=link title=hover_text
|
2023-11-23 17:07:49 +01:00
|
|
|
img.media-box__image alt=hover_text
|
2019-11-30 23:40:53 +01:00
|
|
|
|
2019-12-07 21:36:02 +01:00
|
|
|
- {:filtered_video, hover_text} ->
|
2020-01-01 05:11:17 +01:00
|
|
|
.media-box__overlay.js-spoiler-info-overlay
|
2019-12-07 21:36:02 +01:00
|
|
|
a href=link title=hover_text
|
2019-11-30 23:40:53 +01:00
|
|
|
video autoplay="autoplay" muted="muted" loop="loop" playsinline="playsinline"
|
2023-11-23 17:07:49 +01:00
|
|
|
img.media-box__image alt=hover_text
|
2019-10-11 03:47:13 +02:00
|
|
|
|
2019-12-07 21:36:02 +01:00
|
|
|
- :not_rendered ->
|
2020-01-01 05:11:17 +01:00
|
|
|
.media-box__overlay.js-spoiler-info-overlay
|
2019-12-07 21:36:02 +01:00
|
|
|
a href=link
|
2020-01-01 05:11:17 +01:00
|
|
|
' Thumbnails not yet generated
|