diff --git a/lib/philomena_web/templates/image/_image_target.html.slime b/lib/philomena_web/templates/image/_image_target.html.slime index bbe5b338..94cacced 100644 --- a/lib/philomena_web/templates/image/_image_target.html.slime +++ b/lib/philomena_web/templates/image/_image_target.html.slime @@ -18,7 +18,7 @@ picture - else .image-show.hidden - a href=Routes.image_path(@conn, :show, @image) + a href=Routes.image_path(@conn, :show, @image) title=title_text(@image) span.imgspoiler - thumb_url = thumb_url(@image, can?(@conn, :show, @image), size) diff --git a/lib/philomena_web/views/image_view.ex b/lib/philomena_web/views/image_view.ex index 9cca6d7e..0992ada5 100644 --- a/lib/philomena_web/views/image_view.ex +++ b/lib/philomena_web/views/image_view.ex @@ -6,14 +6,19 @@ defmodule PhilomenaWeb.ImageView do def show_vote_counts?(%{hide_vote_counts: true}), do: false def show_vote_counts?(_user), do: true - # this is a bit ridculous + def title_text(image) do + tags = Tag.display_order(image.tags) |> Enum.map_join(", ", & &1.name) + + "Size: #{image.image_width}x#{image.image_height} | Tagged: #{tags}" + end + + # this is a bit ridiculous def render_intent(_conn, %{thumbnails_generated: false}, _size), do: :not_rendered def render_intent(conn, image, size) do uris = thumb_urls(image, can?(conn, :show, image)) vid? = image.image_mime_type == "video/webm" gif? = image.image_mime_type == "image/gif" - tags = Tag.display_order(image.tags) |> Enum.map_join(", ", & &1.name) - alt = "Size: #{image.image_width}x#{image.image_height} | Tagged: #{tags}" + alt = title_text(image) hidpi? = conn.cookies["hidpi"] == "true" webm? = conn.cookies["webm"] == "true"