pundit: convert post flags to pundit.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<li class="post-flag-reason">
|
||||
<span class="prose"><%= format_text(flag.reason, inline: true) %></span>
|
||||
|
||||
<% if CurrentUser.can_view_flagger_on_post?(flag) %>
|
||||
<% if policy(flag).can_view_flagger? %>
|
||||
- <%= link_to_user(flag.creator) %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<%= f.input :reason_matches, label: "Reason", hint: "Use * for wildcard searches", input_html: { value: params[:search][:reason_matches] } %>
|
||||
<%= f.input :post_tags_match, label: "Tags", input_html: { value: params[:search][:post_tags_match], data: { autocomplete: "tag-query" } } %>
|
||||
<%= f.input :post_id, label: "Post ID", input_html: { value: params[:search][:post_id] } %>
|
||||
<% if CurrentUser.is_moderator? %>
|
||||
<% 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] %>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<% end %>
|
||||
<% t.column "Flagged", width: "15%" do |post_flag| %>
|
||||
<%= compact_time post_flag.created_at %>
|
||||
<% if CurrentUser.can_view_flagger_on_post?(post_flag) %>
|
||||
<% if policy(post_flag).can_view_flagger? %>
|
||||
<br> by <%= link_to_user post_flag.creator %>
|
||||
<%= link_to "»", post_flags_path(search: params[:search].merge(creator_name: post_flag.creator.name)) %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user