Extract partial to show "login to comment" message
This commit is contained in:
@@ -34,11 +34,7 @@
|
||||
<% end %>
|
||||
<% else %>
|
||||
<br>
|
||||
<div data-alert class="callout primary">
|
||||
<%= t("users.login_to_comment",
|
||||
signin: link_to(t("users.signin"), new_user_session_path),
|
||||
signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
|
||||
</div>
|
||||
<%= render "shared/login_to_comment" %>
|
||||
<% end %>
|
||||
|
||||
<% comment_tree.root_comments.each do |comment| %>
|
||||
|
||||
@@ -18,12 +18,7 @@
|
||||
valuation: valuation } %>
|
||||
<% else %>
|
||||
<br>
|
||||
|
||||
<div data-alert class="callout primary">
|
||||
<%= t("users.login_to_comment",
|
||||
signin: link_to(t("users.signin"), new_user_session_path),
|
||||
signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
|
||||
</div>
|
||||
<%= render "shared/login_to_comment" %>
|
||||
<% end %>
|
||||
|
||||
<% @comment_tree.root_comments.each do |comment| %>
|
||||
|
||||
@@ -12,12 +12,7 @@
|
||||
<%= render "comments/form", { commentable: @debate, parent_id: nil, toggeable: false } %>
|
||||
<% else %>
|
||||
<br>
|
||||
|
||||
<div data-alert class="callout primary">
|
||||
<%= t("users.login_to_comment",
|
||||
signin: link_to(t("users.signin"), new_user_session_path),
|
||||
signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
|
||||
</div>
|
||||
<%= render "shared/login_to_comment" %>
|
||||
<% end %>
|
||||
|
||||
<% @comment_tree.root_comments.each do |comment| %>
|
||||
|
||||
@@ -23,11 +23,7 @@
|
||||
<%= f.hidden_field :ranges %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div data-alert class="callout primary">
|
||||
<%= t("users.login_to_comment",
|
||||
signin: link_to(t("users.signin"), new_user_session_path),
|
||||
signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
|
||||
</div>
|
||||
<%= render "shared/login_to_comment" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,12 +7,7 @@
|
||||
<%= render "comments/form", { commentable: @proposal, parent_id: nil, toggeable: false } %>
|
||||
<% else %>
|
||||
<br>
|
||||
|
||||
<div data-alert class="callout primary">
|
||||
<%= t("users.login_to_comment",
|
||||
signin: link_to(t("users.signin"), new_user_session_path),
|
||||
signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
|
||||
</div>
|
||||
<%= render "shared/login_to_comment" %>
|
||||
<% end %>
|
||||
|
||||
<% @comment_tree.root_comments.each do |comment| %>
|
||||
|
||||
@@ -7,12 +7,7 @@
|
||||
<%= render "comments/form", { commentable: @poll, parent_id: nil, toggeable: false } %>
|
||||
<% else %>
|
||||
<br>
|
||||
|
||||
<div data-alert class="callout primary">
|
||||
<%= t("users.login_to_comment",
|
||||
signin: link_to(t("users.signin"), new_user_session_path),
|
||||
signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
|
||||
</div>
|
||||
<%= render "shared/login_to_comment" %>
|
||||
<% end %>
|
||||
|
||||
<% @comment_tree.root_comments.each do |comment| %>
|
||||
|
||||
@@ -7,12 +7,7 @@
|
||||
<%= render "comments/form", { commentable: @proposal, parent_id: nil, toggeable: false } %>
|
||||
<% else %>
|
||||
<br>
|
||||
|
||||
<div data-alert class="callout primary">
|
||||
<%= t("users.login_to_comment",
|
||||
signin: link_to(t("users.signin"), new_user_session_path),
|
||||
signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
|
||||
</div>
|
||||
<%= render "shared/login_to_comment" %>
|
||||
<% end %>
|
||||
|
||||
<% @comment_tree.root_comments.each do |comment| %>
|
||||
|
||||
6
app/views/shared/_login_to_comment.html.erb
Normal file
6
app/views/shared/_login_to_comment.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div data-alert class="callout primary">
|
||||
<%= t("users.login_to_comment",
|
||||
signin: link_to(t("users.signin"), new_user_session_path),
|
||||
signup: link_to(t("users.signup"), new_user_registration_path)
|
||||
).html_safe %>
|
||||
</div>
|
||||
@@ -13,14 +13,8 @@
|
||||
<% if user_signed_in? %>
|
||||
<%= render "comments/form", { commentable: @topic, parent_id: nil, toggeable: false } %>
|
||||
<% else %>
|
||||
|
||||
<div data-alert class="callout primary">
|
||||
<%= t("users.login_to_comment",
|
||||
signin: link_to(t("users.signin"), new_user_session_path),
|
||||
signup: link_to(t("users.signup"), new_user_registration_path)).html_safe %>
|
||||
</div>
|
||||
<%= render "shared/login_to_comment" %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user