fixes #2540: Add is_resolved to post appeal results
This commit is contained in:
@@ -8,7 +8,7 @@ class PostAppealsController < ApplicationController
|
||||
end
|
||||
|
||||
def index
|
||||
@query = PostAppeal.order("id desc").search(params[:search])
|
||||
@query = PostAppeal.order("id desc").includes(:post).search(params[:search])
|
||||
@post_appeals = @query.paginate(params[:page], :limit => params[:limit])
|
||||
respond_with(@post_appeals) do |format|
|
||||
format.xml do
|
||||
|
||||
@@ -68,6 +68,10 @@ class PostAppeal < ActiveRecord::Base
|
||||
|
||||
extend SearchMethods
|
||||
|
||||
def resolved?
|
||||
!post.is_deleted? && !post.is_flagged?
|
||||
end
|
||||
|
||||
def validate_creator_is_not_limited
|
||||
if appeal_count_for_creator >= Danbooru.config.max_appeals_per_day
|
||||
errors[:creator] << "can appeal at most #{Danbooru.config.max_appeals_per_day} post a day"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<th width="10%">Creator</th>
|
||||
<th>Reason</th>
|
||||
<th width="15%">Date</th>
|
||||
<th width="5%">Resolved?</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -19,6 +20,7 @@
|
||||
<td><%= link_to_user post_appeal.creator %></td>
|
||||
<td><%= format_text post_appeal.reason %></td>
|
||||
<td><%= compact_time post_appeal.updated_at %></td>
|
||||
<td><%= post_appeal.resolved? %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user