Files
grecia/app/views/debates/_comments.html.erb
Álvaro Durán Tovar 92ae988251 adds close button to alert boxes, also adds
data-alert attribute to enable javascript
on them
2015-09-06 19:54:12 +02:00

31 lines
1.1 KiB
Plaintext

<% cache [locale_and_user_status, @all_visible_comments, @all_visible_comments.map(&:author), @debate.comments_count, @comment_flags] do %>
<section class="row-full comments">
<div class="row">
<div id="comments" class="small-12 column">
<h2>
<%= t("debates.show.comments_title") %>
<span>(<%= @debate.comments_count %>)</span>
</h2>
<% if user_signed_in? %>
<%= render 'comments/form', {commentable: @debate, parent_id: nil, toggeable: false} %>
<% else %>
<br>
<div data-alert class="alert-box radius info">
<a href="#" class="close">&times;</a>
<%= t("debates.show.login_to_comment",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
</div>
<% end %>
<% @root_comments.each do |comment| %>
<%= render 'comments/comment', comment: comment %>
<% end %>
<%= paginate @root_comments %>
</div>
</div>
</section>
<% end %>