From ba8ff9e0a04ba4de9ca1216dbae1c49458403440 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 29 Nov 2022 03:11:25 -0600 Subject: [PATCH] media assets: add link to Danbooru post beneath image. On the show page, add a icon beneath the image linking to the Danbooru post if the asset has been posted. FIXME: Downstream boorus should change the icon to something else. --- app/views/media_assets/show.html.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/media_assets/show.html.erb b/app/views/media_assets/show.html.erb index 5e1d0d3a5..11c13aa4c 100644 --- a/app/views/media_assets/show.html.erb +++ b/app/views/media_assets/show.html.erb @@ -14,6 +14,10 @@ <% component.with_footer do %>
+ <% if @media_asset.post.present? %> + <%= link_to image_icon_tag("danbooru-logo.png", class: "h-4"), @media_asset.post, class: "inline-block align-top" %> + <% end %> + <% @media_asset.source_urls.take(5).each do |url| %> <%= external_link_to url, external_site_icon(Source::URL.site_name(url), class: "h-4"), title: url, class: "inline-block align-top" %> <% end %>