Complete create comment details

This commit is contained in:
Fernando Blat
2017-01-14 16:06:45 +01:00
parent f47cef5a93
commit 046c021c0c
3 changed files with 32 additions and 21 deletions

View File

@@ -8,16 +8,24 @@
<div class="comments-wrapper">
<div class="comment-input">
<%= form_for Legislation::Annotation.new, url: legislation_process_draft_version_annotations_path(@process, @draft_version), remote: true do |f| %>
<%= f.text_area :text %>
<% if user_signed_in? %>
<%= form_for Legislation::Annotation.new, url: legislation_process_draft_version_annotations_path(@process, @draft_version), remote: true do |f| %>
<%= f.text_area :text %>
<div class="comment-actions">
<a class="cancel-comment" href="#" data-cancel-annotation><%= t('legislation.annotations.comments.cancel') %></a>
<%= f.submit t('legislation.annotations.comments.publish_comment'), class: 'button strong publish-comment' %>
</div>
<div class="comment-actions">
<a class="cancel-comment" href="#" data-cancel-annotation><%= t('legislation.annotations.comments.cancel') %></a>
<%= f.submit t('legislation.annotations.comments.publish_comment'), class: 'button strong publish-comment' %>
</div>
<%= f.hidden_field :quote %>
<%= f.hidden_field :ranges %>
<%= f.hidden_field :quote %>
<%= f.hidden_field :ranges %>
<% end %>
<% else %>
<div data-alert class="callout primary">
<%= 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 %>
</div>
</div>

View File

@@ -1,2 +1,2 @@
$("#comments-box").html("<%= j render('comments_box', annotation: @annotation) %>");
$("#comments-box").html("<%= j render('comments_box', annotation: @annotation) %>").show();