posts/show: load flag/appeal/replacement dialogs via ajax (#3922).

This commit is contained in:
evazion
2018-09-26 17:17:46 -05:00
parent d1e9f9c3ce
commit f886f2fdb3
18 changed files with 74 additions and 148 deletions

View File

@@ -22,9 +22,9 @@
<li><span id="status-locked-notice">Status locked</span></li>
<% else %>
<% if !post.is_deleted? && !post.is_pending? && !post.is_flagged? %>
<li><%= link_to "Flag", new_post_flag_path(:post_id => post.id), :id => "flag" %></li>
<li><%= link_to "Flag", new_post_flag_path(post_flag: { post_id: post.id }), id: "flag", remote: true %></li>
<% elsif post.is_flagged? || post.is_deleted? %>
<li><%= link_to "Appeal", new_post_appeal_path(:post_id => post.id), :id => "appeal" %></li>
<li><%= link_to "Appeal", new_post_appeal_path(post_appeal: { post_id: post.id }), id: "appeal", remote: true %></li>
<% end %>
<% if CurrentUser.can_approve_posts? %>
@@ -53,7 +53,7 @@
<% end %>
<% if CurrentUser.is_moderator? %>
<li><%= link_to "Replace Image", new_post_replacement_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", remote: true %></li>
<li><%= link_to "Down vote report", reports_down_voting_post_path(post_id: post.id) %></li>
<% end %>
<% end %>

View File

@@ -135,18 +135,6 @@
</section>
</div>
<div id="flag-dialog" class="prose" title="Flag post" style="display: none;">
<%= render "post_flags/new", post_flag: @post.flags.new %>
</div>
<div id="appeal-dialog" class="prose" title="Appeal post" style="display: none;">
<%= render "post_appeals/new", post_appeal: @post.appeals.new %>
</div>
<div id="replace-image-dialog" class="prose" title="Replace image" style="display: none;">
<%= render "post_replacements/new", post_replacement: @post.replacements.new %>
</div>
<div id="add-to-pool-dialog" title="Add to pool" style="display: none;">
<%= render "pool_elements/new" %>
</div>