Use CSS to hide reply forms
We were using inline styles and passing local variables around, while the rule we were following is very simple: it's only hidden if it's a form to reply to a comment.
This commit is contained in:
@@ -2180,6 +2180,11 @@ table {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding-left: rem-calc(8);
|
padding-left: rem-calc(8);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-form {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:empty {
|
&:empty {
|
||||||
|
|||||||
@@ -107,7 +107,6 @@
|
|||||||
<% if !valuation || can?(:comment_valuation, comment.commentable) %>
|
<% if !valuation || can?(:comment_valuation, comment.commentable) %>
|
||||||
<%= render "comments/form", { commentable: comment.commentable,
|
<%= render "comments/form", { commentable: comment.commentable,
|
||||||
parent_id: comment.id,
|
parent_id: comment.id,
|
||||||
toggeable: true,
|
|
||||||
valuation: valuation } %>
|
valuation: valuation } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
<% elsif !valuation || can?(:comment_valuation, commentable) %>
|
<% elsif !valuation || can?(:comment_valuation, commentable) %>
|
||||||
<%= render "comments/form", { commentable: commentable,
|
<%= render "comments/form", { commentable: commentable,
|
||||||
parent_id: nil,
|
parent_id: nil,
|
||||||
toggeable: false,
|
|
||||||
valuation: valuation } %>
|
valuation: valuation } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<% valuation = local_assigns.fetch(:valuation, false) %>
|
<% valuation = local_assigns.fetch(:valuation, false) %>
|
||||||
<% cache [locale_and_user_status, parent_id, commentable_cache_key(commentable), valuation] do %>
|
<% cache [locale_and_user_status, parent_id, commentable_cache_key(commentable), valuation] do %>
|
||||||
<% css_id = parent_or_commentable_dom_id(parent_id, commentable) %>
|
<% css_id = parent_or_commentable_dom_id(parent_id, commentable) %>
|
||||||
<div id="js-comment-form-<%= css_id %>" <%= raw("style='display:none'") if toggeable %> class="comment-form">
|
<div id="js-comment-form-<%= css_id %>" class="comment-form">
|
||||||
<%= form_for Comment.new, remote: true, html: { id: "new_comment_#{css_id}" } do |f| %>
|
<%= form_for Comment.new, remote: true, html: { id: "new_comment_#{css_id}" } do |f| %>
|
||||||
<%= f.text_area :body,
|
<%= f.text_area :body,
|
||||||
id: "comment-body-#{css_id}",
|
id: "comment-body-#{css_id}",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<%= render "shared/wide_order_selector", i18n_namespace: "comments" %>
|
<%= render "shared/wide_order_selector", i18n_namespace: "comments" %>
|
||||||
|
|
||||||
<% if user_signed_in? %>
|
<% if user_signed_in? %>
|
||||||
<%= render "comments/form", { commentable: @debate, parent_id: nil, toggeable: false } %>
|
<%= render "comments/form", { commentable: @debate, parent_id: nil } %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<br>
|
<br>
|
||||||
<%= render "shared/login_to_comment" %>
|
<%= render "shared/login_to_comment" %>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<%= render "shared/wide_order_selector", i18n_namespace: "comments" %>
|
<%= render "shared/wide_order_selector", i18n_namespace: "comments" %>
|
||||||
|
|
||||||
<% if user_signed_in? %>
|
<% if user_signed_in? %>
|
||||||
<%= render "comments/form", { commentable: @proposal, parent_id: nil, toggeable: false } %>
|
<%= render "comments/form", { commentable: @proposal, parent_id: nil } %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<br>
|
<br>
|
||||||
<%= render "shared/login_to_comment" %>
|
<%= render "shared/login_to_comment" %>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<%= render "shared/wide_order_selector", i18n_namespace: "comments" %>
|
<%= render "shared/wide_order_selector", i18n_namespace: "comments" %>
|
||||||
|
|
||||||
<% if user_signed_in? %>
|
<% if user_signed_in? %>
|
||||||
<%= render "comments/form", { commentable: @poll, parent_id: nil, toggeable: false } %>
|
<%= render "comments/form", { commentable: @poll, parent_id: nil } %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<br>
|
<br>
|
||||||
<%= render "shared/login_to_comment" %>
|
<%= render "shared/login_to_comment" %>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<%= render "shared/wide_order_selector", i18n_namespace: "comments" %>
|
<%= render "shared/wide_order_selector", i18n_namespace: "comments" %>
|
||||||
|
|
||||||
<% if user_signed_in? %>
|
<% if user_signed_in? %>
|
||||||
<%= render "comments/form", { commentable: @proposal, parent_id: nil, toggeable: false } %>
|
<%= render "comments/form", { commentable: @proposal, parent_id: nil } %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<br>
|
<br>
|
||||||
<%= render "shared/login_to_comment" %>
|
<%= render "shared/login_to_comment" %>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<%= paginate @comment_tree.root_comments %>
|
<%= paginate @comment_tree.root_comments %>
|
||||||
|
|
||||||
<% if user_signed_in? %>
|
<% if user_signed_in? %>
|
||||||
<%= render "comments/form", { commentable: @topic, parent_id: nil, toggeable: false } %>
|
<%= render "comments/form", { commentable: @topic, parent_id: nil } %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= render "shared/login_to_comment" %>
|
<%= render "shared/login_to_comment" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user