diff --git a/app/components/budgets/investments/votes_component.html.erb b/app/components/budgets/investments/votes_component.html.erb index 5a38de879..6087f6820 100644 --- a/app/components/budgets/investments/votes_component.html.erb +++ b/app/components/budgets/investments/votes_component.html.erb @@ -1,15 +1,11 @@ -<% reason = investment.reason_for_not_being_selectable_by(current_user) %> -<% voting_allowed = true unless reason.presence == :not_voting_allowed %> -<% user_voted_for = voted_for?(investment_votes, investment) %> -
- "> + "> <%= t("budgets.investments.investment.supports", count: investment.total_votes) %>
- <% if user_voted_for %> + <% if user_voted_for? %>
<%= t("budgets.investments.investment.already_supported") %>
@@ -21,13 +17,13 @@ remote: !display_support_alert?, data: (display_support_alert? ? { confirm: t("budgets.investments.investment.confirm_group", count: investment.group.max_votable_headings) } : nil), - "aria-hidden" => css_for_aria_hidden(reason) do %> + "aria-hidden" => css_for_aria_hidden do %> <%= t("budgets.investments.investment.give_support") %> <% end %> <% end %>
- <% if reason.present? && !user_voted_for %> + <% if reason.present? && !user_voted_for? %> <% end %> - <% if user_voted_for && setting["twitter_handle"] %> + <% if user_voted_for? && setting["twitter_handle"] %>