Allow post disapprovals to be edited

This commit is contained in:
nonamethanks
2022-04-11 20:48:10 +02:00
parent 05261bf6d7
commit 1a990d5ab9
11 changed files with 76 additions and 19 deletions

View File

@@ -1,9 +1,16 @@
<div id="detailed-rejection-dialog" title="Detailed Rejection" style="display: none;">
<p>You can supply a short message to the uploader explaining why you rejected this upload.</p>
<%= edit_form_for(PostDisapproval.new, url: post_disapprovals_path, remote: true, html: { id: "detailed-rejection-form" }) do |f| %>
<%= f.hidden_field :post_id, value: "x" %>
<%= f.input :reason, collection: PostDisapproval::REASONS.map { |x| [x.humanize, x] } %>
<%= f.input :message, as: :string %>
<% if @previous_disapproval %>
<%= edit_form_for(@previous_disapproval, remote: true, html: { id: "detailed-rejection-form" }) do |f| %>
<%= f.input :reason, collection: PostDisapproval::REASONS.map { |x| [x.humanize, x] }, :selected => @previous_disapproval.reason %>
<%= f.input :message, as: :string, :input_html => {:value => @previous_disapproval.message } %>
<% end %>
<% else %>
<%= edit_form_for(PostDisapproval.new, remote: true, html: { id: "detailed-rejection-form" }) do |f| %>
<%= f.hidden_field :post_id, value: "x" %>
<%= f.input :reason, collection: PostDisapproval::REASONS.map { |x| [x.humanize, x] } %>
<%= f.input :message, as: :string %>
<% end %>
<% end %>
</div>

View File

@@ -0,0 +1 @@
location.reload();