views: factor out FontAwesome icons.

Factor out FontAwesome icons into a set of helpers. This is so that it's
easier to keep track of which icons we're using and easier to change
icons globally.
This commit is contained in:
evazion
2021-01-21 04:12:13 -06:00
parent 748fcdddcf
commit 63e3b4b447
29 changed files with 199 additions and 73 deletions

View File

@@ -89,21 +89,18 @@
<% if policy(comment).update? %>
<%= menu.item do %>
<%= link_to edit_comment_path(comment.id), id: "edit_comment_link_#{comment.id}", class: "edit_comment_link" do %>
<i class="icon fas fa-edit"></i>
Edit
<%= edit_icon %> Edit
<% end %>
<% end %>
<%= menu.item do %>
<% if comment.is_deleted? %>
<%= link_to undelete_comment_path(comment.id), method: :post, remote: true do %>
<i class="icon fas fa-trash-restore-alt"></i>
Undelete
<%= undelete_icon %> Undelete
<% end %>
<% else %>
<%= link_to comment_path(comment.id), "data-confirm": "Are you sure you want to delete this comment?", method: :delete, remote: true do %>
<i class="icon fas fa-trash-alt"></i>
Delete
<%= delete_icon %> Delete
<% end %>
<% end %>
<% end %>
@@ -112,8 +109,7 @@
<% if policy(comment).reportable? %>
<%= menu.item do %>
<%= link_to new_moderation_report_path(moderation_report: { model_type: "Comment", model_id: comment.id }), remote: true do %>
<i class="icon fas fa-flag"></i>
Report
<%= flag_icon %> Report
<% end %>
<% end %>
<% end %>