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