philomena/lib/philomena_web/templates/image/_image_container.html.slime

44 lines
1.4 KiB
Text
Raw Normal View History

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