In general, we always use relative URLs (using `_path`), but sometimes we were accidentally using absolute URLs (using `_url`). It's been reported i might cause some isuses if accepting both HTTP and HTTPS connections, although we've never seen the case. In any case, this change makes the code more consistent and makes the generated HTML cleaner.
65 lines
2.6 KiB
Plaintext
65 lines
2.6 KiB
Plaintext
<% reason = investment.reason_for_not_being_ballotable_by(current_user, ballot) %>
|
|
<div class="js-participation supports ballot">
|
|
<% if ballot.has_investment?(investment) %>
|
|
|
|
<div class="remove supported inline-block">
|
|
<span class="icon-check-circle"
|
|
title="<%= t("budgets.investments.investment.already_added") %>">
|
|
</span>
|
|
<p class="investment-project-amount">
|
|
<%= investment.formatted_price %>
|
|
</p>
|
|
<% if investment.should_show_ballots? %>
|
|
<%= link_to t("budgets.ballots.show.remove"),
|
|
budget_ballot_line_path(id: investment.id,
|
|
budget_id: investment.budget_id,
|
|
investments_ids: investment_ids),
|
|
class: "delete small expanded",
|
|
method: :delete,
|
|
remote: true %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% else %>
|
|
|
|
<div class="add in-favor">
|
|
<p class="investment-project-amount">
|
|
<%= investment.formatted_price %>
|
|
</p>
|
|
<% if investment.should_show_ballots? %>
|
|
<%= link_to t("budgets.investments.investment.add"),
|
|
budget_ballot_lines_path(investment_id: investment.id,
|
|
budget_id: investment.budget_id,
|
|
investments_ids: investment_ids),
|
|
class: "button button-support small expanded",
|
|
title: t("budgets.investments.investment.support_title"),
|
|
method: :post,
|
|
remote: true %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% if reason.present? && !ballot.has_investment?(investment) %>
|
|
|
|
<div class="js-participation-not-allowed participation-not-allowed" style="display:none">
|
|
<% my_heading = link_to(investment.heading.name,
|
|
budget_investments_path(budget_id: investment.budget_id,
|
|
heading_id: investment.heading_id)) %>
|
|
<% change_ballot = link_to(t("budgets.ballots.reasons_for_not_balloting.change_ballot"),
|
|
budget_ballot_path(@budget)) %>
|
|
|
|
<p>
|
|
<small>
|
|
<%= sanitize(t("budgets.ballots.reasons_for_not_balloting.#{reason}",
|
|
verify_account: link_to_verify_account, signin: link_to_signin,
|
|
signup: link_to_signup, my_heading: my_heading,
|
|
change_ballot: change_ballot,
|
|
heading_link: heading_link(@assigned_heading, @budget))) %>
|
|
</small>
|
|
</p>
|
|
</div>
|
|
|
|
<% end %>
|
|
</div>
|