implemented javascripts for approval/disapproval/unapproval from post/show page

This commit is contained in:
albert
2011-02-10 19:08:23 -05:00
parent 00ea319743
commit 33f5350677
19 changed files with 234 additions and 17 deletions

View File

@@ -0,0 +1,9 @@
var errors = <%= @unapproval.errors.full_messages.to_json.html_safe %>;
if (errors.length > 0) {
Danbooru.Utility.j_error(errors.join("; "));
} else {
Danbooru.Utility.j_alert("Unapproval", "Unapproval successful");
$("a#approve").show();
$("a#disapprove").show();
$("a#unapprove").hide();
}

View File

@@ -1,4 +1,5 @@
<p>You can unapprove a post if you believe it breaks the rules or doesn't belong on this site. You must provide a reason.</p>
<%= form_for(@unapproval) do |f| %>
<%= form_for(@unapproval, :remote => true, :format => :js) do |f| %>
<%= hidden_field_tag "unapproval[post_id]", @unapproval.post_id %>
<%= f.text_area :reason, :size => "40x5" %>
<% end %>