Extract partial to show "sign in to vote" message

This commit is contained in:
Javi Martín
2019-10-01 21:32:13 +02:00
parent f5d8badeb6
commit 9289a051c3
6 changed files with 11 additions and 25 deletions

View File

@@ -27,11 +27,7 @@
</p>
</div>
<% elsif !user_signed_in? %>
<div class="participation-not-allowed" style="display:none" aria-hidden="false">
<%= t("votes.unauthenticated",
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_vote" %>
<% end %>
<% if voted_for?(@featured_proposals_votes, proposal) %>

View File

@@ -60,11 +60,7 @@
</div>
<% elsif !user_signed_in? %>
<div tabindex="0">
<div class="participation-not-allowed" style="display:none" aria-hidden="false">
<%= t("users.login_to_continue",
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_vote" %>
</div>
<% end %>