- <% if user_signed_in? %>
+ <% if current_user %>
<%= link_to vote_legislation_process_proposal_path(process_id: proposal.process, id: proposal, value: "no"), class: "unlike #{voted_classes[:against]}", title: t("votes.disagree"), method: "post", remote: true do %>
<%= t("votes.disagree") %>
@@ -45,20 +45,20 @@
<%= t("proposals.proposal.votes", count: proposal.votes_score) %>
- <% if user_signed_in? && current_user.organization? %>
+ <% if current_user&.organization? %>
<%= t("votes.organizations") %>
- <% elsif user_signed_in? && !proposal.votable_by?(current_user) %>
+ <% elsif current_user && !proposal.votable_by?(current_user) %>
<%= sanitize(t("legislation.proposals.not_verified",
verify_account: link_to_verify_account)) %>
- <% elsif !user_signed_in? %>
+ <% elsif !current_user %>
<%= render "shared/login_to_vote" %>
diff --git a/app/components/legislation/proposals/votes_component.rb b/app/components/legislation/proposals/votes_component.rb
index 0dabb29ec..f59d11d68 100644
--- a/app/components/legislation/proposals/votes_component.rb
+++ b/app/components/legislation/proposals/votes_component.rb
@@ -1,6 +1,6 @@
class Legislation::Proposals::VotesComponent < ApplicationComponent
attr_reader :proposal
- delegate :css_classes_for_vote, :current_user, :link_to_verify_account, :user_signed_in?, :votes_percentage, to: :helpers
+ delegate :css_classes_for_vote, :current_user, :link_to_verify_account, :votes_percentage, to: :helpers
def initialize(proposal)
@proposal = proposal
diff --git a/app/components/proposals/votes_component.html.erb b/app/components/proposals/votes_component.html.erb
index 1834cc094..5ca164d94 100644
--- a/app/components/proposals/votes_component.html.erb
+++ b/app/components/proposals/votes_component.html.erb
@@ -6,7 +6,7 @@
<%= t("proposals.proposal.already_supported") %>
- <% elsif user_signed_in? && proposal.votable_by?(current_user) %>
+ <% elsif current_user && proposal.votable_by?(current_user) %>
<%= link_to vote_url,
class: "button button-support small expanded",
title: t("proposals.proposal.support_title"), method: "post", remote: true do %>
@@ -19,13 +19,13 @@
<% end %>
- <% if user_signed_in? && current_user.organization? %>
+ <% if current_user&.organization? %>