Replaces comments by calls to user.methods

This commit is contained in:
kikito
2015-08-18 19:40:18 +02:00
committed by Juanjo Bazán
parent 21c2fa2e3d
commit b4c66133da
2 changed files with 18 additions and 15 deletions

View File

@@ -11,31 +11,33 @@
<div class="comment-info">
<span class="user-name"><%= comment.user.name %></span>
&nbsp;&bullet;&nbsp;<%= time_ago_in_words(comment.created_at) %>
<!-- if user is official (change level-X CSS class) -->
<% if comment.user.official? %>
&nbsp;&bullet;&nbsp;
<span class="label round level-1">
Cargo oficial
<span class="label round level-<%= comment.user.official_level %>">
<%= comment.user.official_position %>
</span>
<!-- if user is a VERIFICATED association -->
&nbsp;&bullet;&nbsp;
<span class="label round is-association">
Puesto en la asociación
</span>
<!-- if user is debate's author -->
<% end %>
<% if comment.user.verified_organization? %>
&nbsp;&bullet;&nbsp;
<span class="label round is-association">
<%= t("shared.organization") %>
</span>
<% end %>
<% if comment.user == @debate.author %>
&nbsp;&bullet;&nbsp;
<span class="label round is-author">
<%= t("debates.comment.author") %>
</span>
<!-- end -->
<% end %>
</div>
<!-- if user is official -->
<% if comment.user.official? %>
<p class="comment-user is-official"><%= comment.body %></p>
<!-- elsif user is author -->
<% elsif comment.user == @debate.author %>
<p class="comment-user is-author"><%= comment.body %></p>
<!-- else -->
<% else %>
<p class="comment-user"><%= comment.body %></p>
<!-- end -->
<% end %>
<span id="<%= dom_id(comment) %>_votes" class="comment-votes right">
<%= render 'comments/votes', comment: comment %>
</span>
@@ -64,4 +66,4 @@
</div>
</div>
</div>
</div>