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

35 lines
1.2 KiB
Text
Raw Normal View History

2019-11-18 06:05:42 +01:00
- link = assigns[:link] || Routes.image_path(@conn, :show, @image)
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-08-18 18:17:05 +02:00
= if @image.thumbnails_generated do
2019-10-11 03:47:13 +02:00
- uris = thumb_urls(@image, false)
- vid = @image.image_mime_type == "video/webm"
- tags = Enum.map(@image.tags, & &1.name) |> Enum.sort() |> Enum.join(", ")
- alt = "Size: #{@image.image_width}x#{@image.image_height} | Tagged: #{tags}"
= if vid do
video alt=alt autoplay="autoplay" muted="muted" loop="loop" playsinline="playsinline"
source src=uris[@size] type="video/webm"
source src=String.replace(uris[@size], ".webm", ".mp4") type="video/mp4"
- else
picture
img alt=alt src=thumb_url(@image, false, @size) srcset="#{uris[@size]} 1x, #{uris[:medium]} 2x"
2019-08-18 18:17:05 +02:00
- else
| Thumbnails not yet generated