From e10df5bdf75d31e65b2faf82d5218cedc6963f3e Mon Sep 17 00:00:00 2001 From: evazion Date: Fri, 24 Aug 2018 17:27:28 -0500 Subject: [PATCH] Fix #3839: Allow prepopulating upload form with url params. --- app/views/uploads/new.html.erb | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/app/views/uploads/new.html.erb b/app/views/uploads/new.html.erb index 5ad8ed55e..881c39890 100644 --- a/app/views/uploads/new.html.erb +++ b/app/views/uploads/new.html.erb @@ -27,7 +27,7 @@ <% if CurrentUser.can_upload_free? %>
@@ -44,11 +44,7 @@
<%= f.label :source %> - <% if params[:url].present? %> - <%= f.text_field :source, :size => 50, :value => params[:url] %> - <% else %> - <%= f.text_field :source, :size => 50 %> - <% end %> + <%= f.text_field :source, :size => 50, :value => params[:url] %> <%= button_tag "Similar", :id => "similar-button", :type => "button", :class => "ui-button ui-widget ui-corner-all sub gradient" %> <%= button_tag "Artist", :id => "find-artist-button", :type => "button", :class => "ui-button ui-widget ui-corner-all sub gradient" %> You can enter a URL to have <%= Danbooru.config.app_name %> automatically download and process it @@ -58,20 +54,20 @@ <%= f.label :rating %>
- <%= f.radio_button :rating, :e %> + <%= f.radio_button :rating, :e, :checked => (params[:rating] == "e") %> <%= f.label :rating_e, "Explicit", :title => "Hardcore porn, visible genitals" %> - <%= f.radio_button :rating, :q %> + <%= f.radio_button :rating, :q, :checked => (params[:rating] == "q") %> <%= f.label :rating_q, "Questionable", :title => "Nudity, anything erotic" %> - <%= f.radio_button :rating, :s %> + <%= f.radio_button :rating, :s, :checked => (params[:rating] == "s") %> <%= f.label :rating_s, "Safe", :title => "Everything else" %>
<%= f.label :parent_id, "Parent ID" %> - <%= f.text_field :parent_id %> + <%= f.text_field :parent_id, :value => params[:parent_id] %>
@@ -81,17 +77,17 @@