Files
grecia/app/views/budgets/investments/_ballot.html.erb
2016-09-10 16:22:40 +02:00

28 lines
1.1 KiB
Plaintext

<% reason = investment.reason_for_not_being_ballotable_by(current_user, @ballot) %>
<div class="supports ballot">
<% if @ballot.has_investment?(investment) %>
<%= render 'budgets/ballot/remove',
investment: investment,
investment_ids: @investments %>
<% else %>
<%= render 'budgets/ballot/add',
investment: investment,
investment_ids: @investments %>
<% end %>
<% if reason.present? && !@ballot.has_investment?(investment) %>
<div class="no-supports-allowed" style='display:none'>
<p>
<%= t("votes.budget_investments.#{reason}",
verify_account: link_to(t("votes.verify_account"), verification_path),
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path),
my_heading: link_to(@ballot.try(:heading).try(:name), budget_investments_path(budget_id: @budget.id, heading_id: @ballot.try(:heading_id)))
).html_safe %>
</p>
</div>
<% end %>
</div>