Refactor and extract code to partials.
This commit is contained in:
22
app/views/communities/_participant.html.erb
Normal file
22
app/views/communities/_participant.html.erb
Normal file
@@ -0,0 +1,22 @@
|
||||
<div class="comment-body">
|
||||
<div class="comment-info">
|
||||
|
||||
<%= avatar_image( participant, seed: participant.id, size: 32, class: 'author-photo') %>
|
||||
|
||||
<div class="comment-info">
|
||||
|
||||
<span class="user-name">
|
||||
<%= link_to participant.name, user_path(participant)%>
|
||||
</span>
|
||||
|
||||
<% if is_author?(@community, participant) %>
|
||||
•
|
||||
<span class="label round is-author">
|
||||
<%= t("comments.comment.author") %>
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -14,28 +14,7 @@
|
||||
</ul>
|
||||
|
||||
<% @participants.each do |participant| %>
|
||||
<div class="comment-body">
|
||||
<div class="comment-info">
|
||||
|
||||
<%= avatar_image( participant, seed: participant.id, size: 32, class: 'author-photo') %>
|
||||
|
||||
<div class="comment-info">
|
||||
|
||||
<span class="user-name">
|
||||
<%= link_to participant.name, user_path(participant)%>
|
||||
</span>
|
||||
|
||||
<% if is_author?(@community, participant) %>
|
||||
•
|
||||
<span class="label round is-author">
|
||||
<%= t("comments.comment.author") %>
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<%= render 'participant', participant: participant %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user