Refactor and extract code to partials.

This commit is contained in:
taitus
2017-09-06 14:41:58 +02:00
parent 79d4a82bfa
commit f0667937fb
5 changed files with 64 additions and 63 deletions

View 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) %>
&nbsp;&bull;&nbsp;
<span class="label round is-author">
<%= t("comments.comment.author") %>
</span>
<% end %>
</div>
</div>
</div>

View File

@@ -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) %>
&nbsp;&bull;&nbsp;
<span class="label round is-author">
<%= t("comments.comment.author") %>
</span>
<% end %>
</div>
</div>
</div>
<%= render 'participant', participant: participant %>
<% end %>
</div>