From 8881edaf9fe2ca5ca53dfee3fb1c5aee2601a835 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 21 Jan 2020 00:54:07 -0600 Subject: [PATCH] post replacements: fix dialog submit not working. --- app/views/post_replacements/_new.html.erb | 2 +- app/views/post_replacements/create.js.erb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 app/views/post_replacements/create.js.erb diff --git a/app/views/post_replacements/_new.html.erb b/app/views/post_replacements/_new.html.erb index a8f0be173..63b5f3072 100644 --- a/app/views/post_replacements/_new.html.erb +++ b/app/views/post_replacements/_new.html.erb @@ -3,7 +3,7 @@ <%= format_text(WikiPage.titled(Danbooru.config.replacement_notice_wiki_page).first.try(&:body)) %> - <%= edit_form_for(post_replacement, url: post_replacements_path(post_id: post_replacement.post_id), method: :post) do |f| %> + <%= edit_form_for(post_replacement, url: post_replacements_path(post_id: post_replacement.post_id), method: :post, remote: true) do |f| %> <%= f.input :replacement_file, label: "File", as: :file %> <%= f.input :replacement_url, label: "Replacement URL", hint: "The source URL to download the replacement from.", as: :string, input_html: { value: post_replacement.post.normalized_source } %> <%= f.input :final_source, label: "Final Source", hint: "If present, the source field will be changed to this after replacement.", as: :string, input_html: { value: post_replacement.post.source } %> diff --git a/app/views/post_replacements/create.js.erb b/app/views/post_replacements/create.js.erb new file mode 100644 index 000000000..7662f71ec --- /dev/null +++ b/app/views/post_replacements/create.js.erb @@ -0,0 +1,2 @@ +Danbooru.notice("Post replaced."); +location.reload();