Move post replacement create action to post replacements controller.

This commit is contained in:
evazion
2017-05-14 18:52:34 -05:00
parent cb09b6661d
commit 648cc9ecb7
9 changed files with 35 additions and 25 deletions

View File

@@ -1,5 +0,0 @@
<div id="c-moderator-post-posts">
<div id="a-replace">
<%= render "moderator/post/posts/replace" %>
</div>
</div>

View File

@@ -1,4 +1,4 @@
<%= simple_form_for(@post, url: replace_moderator_post_post_path, method: :post) do |f| %>
<%= simple_form_for(post_replacement, url: post_replacements_path(post_id: post_replacement.post_id), method: :post) do |f| %>
<h1>Replace Image</h1>
<p>
@@ -7,5 +7,5 @@
lower-quality images, such as image samples, to higher-quality versions.
</p>
<%= f.input :source, label: "New Source", input_html: { value: "" } %>
<%= f.input :replacement_url, label: "New Source", input_html: { value: "" } %>
<% end %>

View File

@@ -0,0 +1,5 @@
<div id="c-post-replacements">
<div id="a-new">
<%= render "new", post_replacement: @post.replacements.new %>
</div>
</div>

View File

@@ -55,7 +55,7 @@
<li><%= link_to "Expunge", expunge_moderator_post_post_path(:post_id => post.id), :remote => true, :method => :post, :id => "expunge", :data => {:confirm => "This will permanently delete this post (meaning the file will be deleted). Are you sure you want to delete this post?"} %></li>
<% end %>
<li><%= link_to "Replace Image", replace_moderator_post_post_path(:post_id => post.id), :id => "replace-image" %></li>
<li><%= link_to "Replace Image", new_post_replacement_path(:post_id => post.id), :id => "replace-image" %></li>
<li id="mobile-version-list"><%= link_to "Mobile version", mobile_post_path(post) %></li>
<% end %>

View File

@@ -122,7 +122,7 @@
</div>
<div id="replace-image-dialog" class="prose" title="Replace image" style="display: none;">
<%= render "moderator/post/posts/replace" %>
<%= render "post_replacements/new", post_replacement: @post.replacements.new %>
</div>
<div id="add-to-pool-dialog" title="Add to pool" style="display: none;">