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

@@ -1,9 +1,13 @@
<%= format_text(WikiPage.titled(Danbooru.config.appeal_notice_wiki_page).first.try(&:body)) %>
<div class="appeal-dialog-body">
<div class="prose">
<%= format_text(WikiPage.titled(Danbooru.config.appeal_notice_wiki_page).first.try(&:body)) %>
</div>
<%# XXX dtext_field expects there to be a `post_appeal` instance variable. %>
<% @post_appeal = post_appeal %>
<%= simple_form_for(@post_appeal, format: :js, remote: true) do |f| %>
<%= f.hidden_field :post_id %>
<%= dtext_field "post_appeal", "reason", preview_id: "dtext-preview-for-post-appeal" %>
<%= dtext_preview_button "post_appeal", "reason", preview_id: "dtext-preview-for-post-appeal" %>
<% end %>
<%# XXX dtext_field expects there to be a `post_appeal` instance variable. %>
<% @post_appeal = post_appeal %>
<%= simple_form_for(@post_appeal, format: :js, remote: true) do |f| %>
<%= f.hidden_field :post_id %>
<%= dtext_field "post_appeal", "reason", preview_id: "dtext-preview-for-post-appeal", type: "string" %>
<%= dtext_preview_button "post_appeal", "reason", preview_id: "dtext-preview-for-post-appeal" %>
<% end %>
</div>

View File

@@ -0,0 +1 @@
Danbooru.Utility.dialog("Appeal post", "<%= j render "post_appeals/new", post_appeal: @post_appeal %>");