From dcb68a7322e810698a059491c15d0257fe08ff18 Mon Sep 17 00:00:00 2001 From: NamelessContributor Date: Thu, 5 May 2022 18:21:16 +0200 Subject: [PATCH] post tooltips: add support for non-web sources Show "non-web source" in the tooltip instead of "no source", link to the `non-web_source` tag and show the source on mouseover. --- app/views/posts/show.html+tooltip.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/posts/show.html+tooltip.erb b/app/views/posts/show.html+tooltip.erb index bbaa83ad8..820a14593 100644 --- a/app/views/posts/show.html+tooltip.erb +++ b/app/views/posts/show.html+tooltip.erb @@ -24,6 +24,8 @@ <% if @post.source_domain.present? %> <%= link_to @post.source_domain, @post.normalized_source, class: "post-tooltip-source post-tooltip-info" %> + <% elsif @post.source.present? %> + <%= link_to "non-web source", posts_path(tags: "non-web_source"), title: @post.source, class: "post-tooltip-source post-tooltip-info" %> <% else %> <%= link_to "no source", posts_path(tags: "source:none"), class: "post-tooltip-source post-tooltip-info" %> <% end %>