Merge pull request #3875 from evazion/fix-3873
Fix #3873: Batch bookmarklet for tumblr reports wrong posts as already uploaded
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
<% if @matches.present? %>
|
||||
<h3>Similar</h3>
|
||||
<h3>Similar Posts</h3>
|
||||
<p class="hint">Found <%= pluralize(@matches.length, "similar post") %>:</p>
|
||||
|
||||
<% @matches.each do |match| %>
|
||||
<%= PostPresenter.preview(match["post"], :tags => "status:any", :similarity => match["score"], :size => true) %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<h3>Similar</h3>
|
||||
<p>No matches found</p>
|
||||
<h3>Similar Posts</h3>
|
||||
<p class="hint">No similar posts found.</p>
|
||||
<% end %>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
<%# source %>
|
||||
|
||||
<div id="source-info">
|
||||
<p><%= link_to "Fetch source data", source_path(:format => "json"), :id => "fetch-data-manual" %></p>
|
||||
<p><%= content_tag "span", "Loading source data...", :id => "loading-data", :style => "display: none;" %></p>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<%= image_tag(@source.image_url, :title => "Preview", :id => "image") %>
|
||||
<% end %>
|
||||
|
||||
<ul>
|
||||
<ul id="upload-image-metadata">
|
||||
<% if @remote_size %>
|
||||
<li><strong>Size:</strong> <%= number_to_human_size(@remote_size) %></li>
|
||||
<% end %>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<%# post %>
|
||||
<% if post %>
|
||||
<h2 style="margin-bottom: 1em;">
|
||||
This post was probably already uploaded (<%= link_to "post ##{post.id}", post_path(post), :target => "_blank" %>)
|
||||
</h2>
|
||||
<% end %>
|
||||
27
app/views/uploads/_related_posts.html.erb
Normal file
27
app/views/uploads/_related_posts.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<%# source %>
|
||||
|
||||
<% if source.present? && source.related_posts.present? %>
|
||||
<div id="related-posts-by-source">
|
||||
<h3>Related Posts</h3>
|
||||
|
||||
<p class="hint">
|
||||
Found <%= link_to pluralize(source.related_posts.total_count, "other post"), posts_path(tags: source.related_posts_search_query) %> from the same source:
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<% source.related_posts.each do |post| %>
|
||||
<%= PostPresenter.preview(post, show_deleted: true, size: true) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if Danbooru.config.iqdbs_server %>
|
||||
<% if params[:url] %>
|
||||
<div class="input" id="iqdb-similar">
|
||||
<p><em>Loading similar...</em></p>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="input" id="iqdb-similar" style="display: none;"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -12,8 +12,8 @@
|
||||
<% end %>
|
||||
|
||||
<%= render "image" %>
|
||||
<%= render "post", :post => @post %>
|
||||
<%= render "sources/info", :source => @source %>
|
||||
<%= render "related_posts", source: @source %>
|
||||
<%= render "sources/info" %>
|
||||
|
||||
<div id="client-errors" class="error-messages ui-state-error ui-corner-all" style="display:none"></div>
|
||||
|
||||
@@ -91,16 +91,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if Danbooru.config.iqdbs_server %>
|
||||
<% if params[:url] %>
|
||||
<div class="input" id="iqdb-similar">
|
||||
<p><em>Loading similar...</em></p>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="input" id="iqdb-similar" style="display: none;"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<div class="input">
|
||||
<div>
|
||||
<%= f.label :tag_string, "Tags" %>
|
||||
|
||||
Reference in New Issue
Block a user