flags/appeals: replace is_resolved flag with statuses.

Replace references to the `is_resolved` field with the `status` field.
Post flags were marked as resolved when a post was approved (but not
when the post was deleted because it went unapproved). The status field
supercedes the resolved field.
This commit is contained in:
evazion
2020-08-07 18:53:25 -05:00
parent 2b0cd3c90b
commit 3a17b5a13e
14 changed files with 33 additions and 54 deletions

View File

@@ -8,10 +8,6 @@
<% end %>
- <%= time_ago_in_words_tagged(flag.created_at) %>
<% if flag.is_resolved? %>
<span class="resolved">RESOLVED</span>
<% end %>
</li>
<% end %>
</ul>

View File

@@ -5,7 +5,7 @@
<% if policy(PostFlag).can_search_flagger? %>
<%= f.input :creator_name, label: "Creator", input_html: { value: params[:search][:creator_name], data: { autocomplete: "user" } } %>
<% end %>
<%= f.input :is_resolved, label: "Resolved?", collection: [["Yes", true], ["No", false]], include_blank: true, selected: params[:search][:is_resolved] %>
<%= f.input :category, label: "Category", collection: ["normal", "unapproved", "rejected", "deleted"], include_blank: true, selected: params[:search][:category] %>
<%= f.input :status, collection: PostFlag.statuses, include_blank: true, selected: params[:search][:status] %>
<%= f.submit "Search" %>
<% end %>

View File

@@ -19,8 +19,8 @@
<% t.column "Category", width: "1%" do |post_flag| %>
<%= link_to post_flag.category.to_s, post_flags_path(search: params[:search].merge(category: post_flag.category)) %>
<% end %>
<% t.column "Resolved?", width: "1%" do |post_flag| %>
<%= link_to post_flag.is_resolved?.to_s, post_flags_path(search: params[:search].merge(is_resolved: post_flag.is_resolved?)) %>
<% t.column "Status", width: "5%" do |post_flag| %>
<%= link_to post_flag.status, post_flags_path(search: { status: post_flag.status }) %>
<% end %>
<% t.column "Uploaded", width: "15%" do |post_flag| %>
<%= compact_time post_flag.post.created_at %>