mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 23:08:00 +01:00
34 lines
1.2 KiB
Text
34 lines
1.2 KiB
Text
- link = assigns[:link] || "/images/#{@image.id}"
|
|
|
|
= image_container @image, @size, fn ->
|
|
= 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
|
|
a href=link
|
|
= if @image.thumbnails_generated do
|
|
- 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"
|
|
|
|
- else
|
|
| Thumbnails not yet generated
|