diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 977c6fe6b..3c195b1d8 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -2180,6 +2180,11 @@ table { display: inline-block; padding-left: rem-calc(8); width: 100%; + + } + + .comment-form { + display: none; } &:empty { diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 443c69a01..382555b62 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -107,7 +107,6 @@ <% if !valuation || can?(:comment_valuation, comment.commentable) %> <%= render "comments/form", { commentable: comment.commentable, parent_id: comment.id, - toggeable: true, valuation: valuation } %> <% end %> <% end %> diff --git a/app/views/comments/_comment_tree.html.erb b/app/views/comments/_comment_tree.html.erb index 055f94e4d..c8014178c 100644 --- a/app/views/comments/_comment_tree.html.erb +++ b/app/views/comments/_comment_tree.html.erb @@ -27,7 +27,6 @@ <% elsif !valuation || can?(:comment_valuation, commentable) %> <%= render "comments/form", { commentable: commentable, parent_id: nil, - toggeable: false, valuation: valuation } %> <% end %> <% else %> diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb index 39721877c..41b5e61eb 100644 --- a/app/views/comments/_form.html.erb +++ b/app/views/comments/_form.html.erb @@ -1,7 +1,7 @@ <% valuation = local_assigns.fetch(:valuation, false) %> <% cache [locale_and_user_status, parent_id, commentable_cache_key(commentable), valuation] do %> <% css_id = parent_or_commentable_dom_id(parent_id, commentable) %> -
class="comment-form"> +
<%= form_for Comment.new, remote: true, html: { id: "new_comment_#{css_id}" } do |f| %> <%= f.text_area :body, id: "comment-body-#{css_id}", diff --git a/app/views/debates/_comments.html.erb b/app/views/debates/_comments.html.erb index 46cf3fb57..9b0348930 100644 --- a/app/views/debates/_comments.html.erb +++ b/app/views/debates/_comments.html.erb @@ -9,7 +9,7 @@ <%= render "shared/wide_order_selector", i18n_namespace: "comments" %> <% if user_signed_in? %> - <%= render "comments/form", { commentable: @debate, parent_id: nil, toggeable: false } %> + <%= render "comments/form", { commentable: @debate, parent_id: nil } %> <% else %>
<%= render "shared/login_to_comment" %> diff --git a/app/views/legislation/proposals/_comments.html.erb b/app/views/legislation/proposals/_comments.html.erb index a7471102d..a8e657835 100644 --- a/app/views/legislation/proposals/_comments.html.erb +++ b/app/views/legislation/proposals/_comments.html.erb @@ -4,7 +4,7 @@ <%= render "shared/wide_order_selector", i18n_namespace: "comments" %> <% if user_signed_in? %> - <%= render "comments/form", { commentable: @proposal, parent_id: nil, toggeable: false } %> + <%= render "comments/form", { commentable: @proposal, parent_id: nil } %> <% else %>
<%= render "shared/login_to_comment" %> diff --git a/app/views/polls/_comments.html.erb b/app/views/polls/_comments.html.erb index d3309d79d..b99b9f351 100644 --- a/app/views/polls/_comments.html.erb +++ b/app/views/polls/_comments.html.erb @@ -4,7 +4,7 @@ <%= render "shared/wide_order_selector", i18n_namespace: "comments" %> <% if user_signed_in? %> - <%= render "comments/form", { commentable: @poll, parent_id: nil, toggeable: false } %> + <%= render "comments/form", { commentable: @poll, parent_id: nil } %> <% else %>
<%= render "shared/login_to_comment" %> diff --git a/app/views/proposals/_comments.html.erb b/app/views/proposals/_comments.html.erb index a7471102d..a8e657835 100644 --- a/app/views/proposals/_comments.html.erb +++ b/app/views/proposals/_comments.html.erb @@ -4,7 +4,7 @@ <%= render "shared/wide_order_selector", i18n_namespace: "comments" %> <% if user_signed_in? %> - <%= render "comments/form", { commentable: @proposal, parent_id: nil, toggeable: false } %> + <%= render "comments/form", { commentable: @proposal, parent_id: nil } %> <% else %>
<%= render "shared/login_to_comment" %> diff --git a/app/views/topics/_comments.html.erb b/app/views/topics/_comments.html.erb index 485096378..abcaba601 100644 --- a/app/views/topics/_comments.html.erb +++ b/app/views/topics/_comments.html.erb @@ -8,7 +8,7 @@ <%= paginate @comment_tree.root_comments %> <% if user_signed_in? %> - <%= render "comments/form", { commentable: @topic, parent_id: nil, toggeable: false } %> + <%= render "comments/form", { commentable: @topic, parent_id: nil } %> <% else %> <%= render "shared/login_to_comment" %> <% end %>