uploads: add new source:<url> dupe check (fix #3873)

* On the /uploads/new page, instead of just showing a "This post has
probably already been uploaded" message, show the actual thumbnails of
posts having the same source as what the user is trying to upload.

* Move the iqdb results section up top, beside the related posts section.
This commit is contained in:
evazion
2018-09-06 20:12:56 -05:00
parent 07c0695ac1
commit 950fcdb7b2
9 changed files with 62 additions and 22 deletions

View File

@@ -4,6 +4,7 @@ class UploadsController < ApplicationController
skip_before_action :verify_authenticity_token, only: [:preprocess]
def new
@source = Sources::Strategies.find(params[:url], params[:ref]) if params[:url].present?
@upload_notice_wiki = WikiPage.titled(Danbooru.config.upload_notice_wiki_page).first
@upload, @remote_size = UploadService::ControllerHelper.prepare(
url: params[:url], ref: params[:ref]
@@ -13,7 +14,7 @@ class UploadsController < ApplicationController
def batch
@url = params.dig(:batch, :url) || params[:url]
@source = UploadService::ControllerHelper.batch(@url, params[:ref])
@source = Sources::Strategies.find(@url, params[:ref]) if @url.present?
respond_with(@source)
end