pundit: convert tags to pundit.

This commit is contained in:
evazion
2020-03-17 17:35:59 -05:00
parent 4cd0b2cbfe
commit 4bb036aff1
6 changed files with 27 additions and 31 deletions

View File

@@ -9,7 +9,7 @@
<%= f.input :category, :collection => TagCategory.canonical_mapping.to_a, :include_blank => false %>
<% end %>
<% if CurrentUser.is_moderator? %>
<% if policy(@tag).can_lock? %>
<%= f.input :is_locked, :collection => [["No", "false"], ["Yes", "true"]], :include_blank => false %>
<% end %>

View File

@@ -16,7 +16,9 @@
<% end %>
<% end %>
<% t.column column: "control" do |tag| %>
<%= link_to_if tag.editable_by?(CurrentUser.user), "Edit", edit_tag_path(tag) %> |
<% if policy(tag).update? %>
<%= link_to "Edit", edit_tag_path(tag) %> |
<% end %>
<%= link_to "History", post_versions_path(search: { changed_tags: tag.name }) %> |
<%= link_to "Related", related_tag_path(search: { query: tag.name }) %> |
<%= link_to "Similar", tags_path(search: { fuzzy_name_matches: tag.name, order: :similarity }) %>