changes to flags/appeals

This commit is contained in:
albert
2011-12-15 10:57:25 -05:00
parent 3463e45675
commit 4e99ca2613
3 changed files with 10 additions and 13 deletions

View File

@@ -4,7 +4,13 @@ module PostFlagsHelper
html << '<ul>'
post.flags.each do |flag|
html << '<li>' + flag.reason + ' - ' + link_to(flag.creator.name, user_path(flag.creator)) + ' ' + time_ago_in_words(flag.created_at) + ' ago</li>'
html << '<li>' + flag.reason
if CurrentUser.is_janitor?
html << ' - ' + link_to(flag.creator.name, user_path(flag.creator))
end
html << ' ' + time_ago_in_words(flag.created_at) + ' ago</li>'
end
html << '</ul>'

View File

@@ -12,8 +12,8 @@ class PostAppeal < ActiveRecord::Base
scope :recent, lambda {where(["created_at >= ?", 1.day.ago])}
def validate_creator_is_not_limited
if appeal_count_for_creator >= 5
errors[:creator] << "can appeal 5 posts a day"
if appeal_count_for_creator >= 1
errors[:creator] << "can appeal one post a day"
false
else
true

View File

@@ -2,16 +2,7 @@
<div id="a-index">
<p>If this post was automatically deleted, <strong>then it means at least ten janitors all thought it didn't belong on the site</strong>. If you still believe this image was wrongfully deleted, then you can appeal its deletion.</p>
<p>Some valid reasons for appealing include:</p>
<ul>
<li>Funny</li>
<li>Weird</li>
<li>Translated</li>
<li>Part of a pool</li>
</ul>
<p>All users are limited to 5 appeals a day. For more details, please read the <%= link_to "wiki", wiki_pages_path(:title => "help:deletion_appeals") %>.</p>
<p>All users are limited to one appeal a day. For more details, please read the <%= link_to "wiki", wiki_pages_path(:title => "help:deletion_appeals") %>.</p>
<%= simple_form_for(@post_appeal, :remote => true, :format => :js) do |f| %>
<%= hidden_field_tag "post_appeal[post_id]", @post_appeal.post_id %>