fixes #2540: Add is_resolved to post appeal results

This commit is contained in:
r888888888
2015-10-27 11:23:26 -07:00
parent b695a7980f
commit 3008a70b10
3 changed files with 7 additions and 1 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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>