Simplify the conditions to render comment avatars
It was hard to understand that the nested `if` could actually be `elsif`, and the indentation was a bit broken.
This commit is contained in:
@@ -2,12 +2,10 @@
|
||||
<%= image_tag("avatar_admin.png", size: 32, class: "admin-avatar float-left", alt: "") %>
|
||||
<% elsif comment.as_moderator? %>
|
||||
<%= image_tag("avatar_moderator.png", size: 32, class: "moderator-avatar float-left", alt: "") %>
|
||||
<% elsif comment.user.hidden? || comment.user.erased? %>
|
||||
<span class="icon-deleted user-deleted"></span>
|
||||
<% elsif comment.user.organization? %>
|
||||
<%= image_tag("avatar_collective.png", size: 32, class: "avatar float-left", alt: "") %>
|
||||
<% else %>
|
||||
<% if comment.user.hidden? || comment.user.erased? %>
|
||||
<span class="icon-deleted user-deleted"></span>
|
||||
<% elsif comment.user.organization? %>
|
||||
<%= image_tag("avatar_collective.png", size: 32, class: "avatar float-left", alt: "") %>
|
||||
<% else %>
|
||||
<%= render Shared::AvatarComponent.new(comment.user, size: 32, class: "float-left") %>
|
||||
<% end %>
|
||||
<%= render Shared::AvatarComponent.new(comment.user, size: 32, class: "float-left") %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user