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

33 lines
1.7 KiB
Text
Raw Permalink Normal View History

- size = assigns[:size] || :full
- embed_display = assigns[:embed_display] || false
= content_tag :div, [data: image_container_data(@conn, @image, size), class: "image-show-container"] do
2019-11-12 01:31:22 +01:00
.block.block--fixed.block--warning.block--no-margin.image-filtered.hidden
strong
= link("This image is blocked by your current filter - click here to display it anyway", to: "#", data: [click_unfilter: @image.id])
p
2024-04-28 05:01:16 +02:00
= img_tag(static_path(@conn, "/images/tagblocked.svg"), width: 250, height: 250, data: [click_unfilter: @image.id])
2019-11-12 01:31:22 +01:00
span.filter-explanation
=< link("your current filter", to: ~p"/filters/#{@conn.assigns.current_filter}", class: "filter-link")
2019-12-06 18:12:55 +01:00
' .
2019-11-12 01:31:22 +01:00
= if size == :full and not embed_display do
.image-target.hidden.image-show data-scaled=scaled_value(@conn.assigns.current_user) data-uris=Jason.encode!(thumb_urls(@image, can?(@conn, :hide, @image))) data-width=@image.image_width data-height=@image.image_height data-image-size=@image.image_size data-mime-type=@image.image_mime_type
= if @image.image_mime_type == "video/webm" do
video controls=true
- else
picture
- else
.image-show.hidden
a href=~p"/images/#{@image}" title=title_text(@image)
span.imgspoiler
- thumb_url = thumb_url(@image, can?(@conn, :show, @image), size)
= if @image.image_mime_type == "video/webm" do
video data-image-id=@image.id autoplay="autoplay" loop="loop" muted="muted" playsinline="playsinline"
source src=thumb_url type="video/webm"
source src=String.replace(thumb_url, ".webm", ".mp4") type="video/mp4"
- else
picture data-image-id=@image.id
img src=thumb_url