iqdb: add more info to iqdb thumbnails.

* Add the source (twitter, pixiv, etc) and upload date ("X minutes ago")
  to iqdb thumbnails.
* Link the filesize to the full file so you can compare files in new tabs.
* Link the similarity to a iqdb search so you can pivot your search to other posts.
This commit is contained in:
evazion
2019-10-14 21:16:04 -05:00
parent fa37b1edcd
commit 5b0c77d126
3 changed files with 17 additions and 5 deletions

View File

@@ -13,12 +13,23 @@
<% end -%>
<% if similarity -%>
<p class="desc">
Similarity: <%= similarity %>
<% if post.source =~ %r!\Ahttps?://!i %>
<%= external_link_to post.normalized_source, post.source_domain %>
(<%= time_ago_in_words_tagged(post.created_at, compact: true) %>)
<% else %>
<%= time_ago_in_words_tagged(post.created_at, compact: true) %>
<% end %>
</p>
<% end -%>
<% end %>
<% if size -%>
<p class="desc">
<%= number_to_human_size(size) %> (<%= width %>x<%= height %>)
<%= link_to number_to_human_size(size), post.file_url %>
(<%= width %>x<%= height %>)
</p>
<% end -%>
<% if similarity -%>
<p class="desc">
<%= link_to "#{similarity}%", iqdb_queries_path(post_id: post.id) %> similarity
</p>
<% end -%>
<% end -%>