View comments for draft text
This commit is contained in:
42
app/views/legislation/annotations/_comments_for.html.erb
Normal file
42
app/views/legislation/annotations/_comments_for.html.erb
Normal file
@@ -0,0 +1,42 @@
|
||||
<div class="comment-header">
|
||||
<span class="icon-comment" aria-hidden="true"></span>
|
||||
<div class="comment-number"><%= t('legislation.annotations.comments.comments_count', count: annotation.comments_count) %></div>
|
||||
<%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation) do %>
|
||||
<span class="icon-expand" aria-hidden="true"></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="comments-wrapper">
|
||||
<% annotation.comments.each do |comment| %>
|
||||
<div class="comment">
|
||||
<div class="comment-text">
|
||||
<p><%= comment.body %></p>
|
||||
</div>
|
||||
<div class="comment-meta">
|
||||
<div class="comment-more-info">
|
||||
<div class="comment-expand">
|
||||
<%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation) do %>
|
||||
<%= t('legislation.annotations.comments.see_complete') %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="comment-replies">
|
||||
<%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation) do %>
|
||||
<%= t('legislation.annotations.comments.replies_count', count: comment.children.size) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="comment-votes">
|
||||
<div id="<%= dom_id(comment) %>_votes" class="comment-votes float-right">
|
||||
<%= render 'comments/votes', comment: comment %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<div class="comment-footer">
|
||||
<%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation), class: "button strong" do %>
|
||||
<%= t('legislation.annotations.comments.see_all') %>
|
||||
<% end %>
|
||||
<a class="button strong publish-comment" title="Publicar comentario" href="#">Publicar comentario</a>
|
||||
</div>
|
||||
2
app/views/legislation/annotations/comments.js.erb
Normal file
2
app/views/legislation/annotations/comments.js.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
$("#comments-box").html("<%= j render('comments_for', annotation: @annotation) %>");
|
||||
|
||||
@@ -64,6 +64,13 @@
|
||||
<span class="panel-title"><%= t('.text_comments') %></span>
|
||||
</div>
|
||||
|
||||
<div class="comment-box" id="comments-box">
|
||||
<div class="comment-header">
|
||||
<span class="icon-comment" aria-hidden="true"></span>
|
||||
<div class="comment-number"><%= t('.loading_comments') %></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user