diff --git a/app/views/budgets/ballot/_add.html.erb b/app/views/budgets/ballot/_add.html.erb
deleted file mode 100644
index 27c22ae2f..000000000
--- a/app/views/budgets/ballot/_add.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
- <%= format_price(@budget, investment.price) %>
-
-
- <% if @budget.balloting? %>
- <%= link_to budget_ballot_lines_url(investment_id: investment.id,
- investments_ids: @ballot.investment_ids),
- class: "button button-support small expanded",
- title: t('budget.investments.investment.support_title'),
- method: "post",
- remote: true do %>
- <%= t("budget.investments.investment.add") %>
- <% end %>
- <% end %>
-
diff --git a/app/views/budgets/ballot/_remove.html.erb b/app/views/budgets/ballot/_remove.html.erb
deleted file mode 100644
index e789b0ae6..000000000
--- a/app/views/budgets/ballot/_remove.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
">
-
-
-
- <%= format_price(@budget, investment.price) %>
-
-
- <% if @budget.balloting? %>
- <%= link_to t('budgets.ballots.show.remove'),
- budget_ballot_line_path(id: investment.id,
- investments_ids: investment_ids),
- class: "delete small expanded",
- method: :delete,
- remote: true %>
- <% end %>
-
diff --git a/app/views/budgets/investments/_ballot.html.erb b/app/views/budgets/investments/_ballot.html.erb
index b4aa8af97..32a788756 100644
--- a/app/views/budgets/investments/_ballot.html.erb
+++ b/app/views/budgets/investments/_ballot.html.erb
@@ -1,16 +1,46 @@
-<% reason = investment.reason_for_not_being_ballotable_by(current_user, @ballot) %>
+<% reason = investment.reason_for_not_being_ballotable_by(current_user, investment_ballot) %>
- <% if @ballot.has_investment?(investment) %>
- <%= render 'budgets/ballot/remove',
- investment: investment,
- investment_ids: @investments %>
+ <% if investment_ballot.has_investment?(investment) %>
+
+
+
">
+
+
+ <%= investment.formatted_price %>
+
+ <% 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 %>
+
+
<% else %>
- <%= render 'budgets/ballot/add',
- investment: investment,
- investment_ids: @investments %>
+
+
+
+ <%= investment.formatted_price %>
+
+ <% if investment.should_show_ballots? %>
+ <%= link_to t("budget.investments.investment.add"),
+ budget_ballot_lines_url(investment_id: investment.id,
+ budget_id: investment.budget_id,
+ investments_ids: investment_ids),
+ class: "button button-support small expanded",
+ title: t('budget.investments.investment.support_title'),
+ method: :post,
+ remote: true %>
+ <% end %>
+
+
<% end %>
- <% if reason.present? && !@ballot.has_investment?(investment) %>
+ <% if reason.present? && !investment_ballot.has_investment?(investment) %>
@@ -18,7 +48,9 @@
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)))
+ my_heading: link_to(investment.heading.name,
+ budget_investments_path(budget_id: investment.budget_id,
+ heading_id: investment.heading_id))
).html_safe %>
diff --git a/app/views/budgets/investments/_investment.html.erb b/app/views/budgets/investments/_investment.html.erb
index e21b6dc00..e0ea250e4 100644
--- a/app/views/budgets/investments/_investment.html.erb
+++ b/app/views/budgets/investments/_investment.html.erb
@@ -59,7 +59,11 @@
- <%= render 'ballot', investment: investment %>
+ <%= render partial: '/budgets/investments/ballot', locals: {
+ investment: investment,
+ investment_ids: investment_ids,
+ investment_ballot: investment_ballots[investment.budget]
+ } %>
<% end %>