Sets partial locals correctly in use and management views

This commit is contained in:
kikito
2016-12-16 18:01:20 +01:00
parent 19e19e5c43
commit e0c0b18757
7 changed files with 15 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
<% reason = investment.reason_for_not_being_ballotable_by(current_user, investment_ballot) %> <% reason = investment.reason_for_not_being_ballotable_by(current_user, ballot) %>
<div class="supports ballot"> <div class="supports ballot">
<% if investment_ballot.has_investment?(investment) %> <% if ballot.has_investment?(investment) %>
<div class="remove supported inline-block"> <div class="remove supported inline-block">
<span class="icon-check-circle bounceIn animated" <span class="icon-check-circle bounceIn animated"
@@ -40,7 +40,7 @@
<% end %> <% end %>
<% if reason.present? && !investment_ballot.has_investment?(investment) %> <% if reason.present? && !ballot.has_investment?(investment) %>
<div class="no-supports-allowed" style='display:none'> <div class="no-supports-allowed" style='display:none'>
<p> <p>

View File

@@ -62,7 +62,7 @@
<%= render partial: '/budgets/investments/ballot', locals: { <%= render partial: '/budgets/investments/ballot', locals: {
investment: investment, investment: investment,
investment_ids: investment_ids, investment_ids: investment_ids,
investment_ballot: investment_ballots[investment.budget] ballot: ballot
} %> } %>
</div> </div>

View File

@@ -65,7 +65,11 @@
</div> </div>
<% elsif investment.should_show_ballots? %> <% elsif investment.should_show_ballots? %>
<div id="<%= dom_id(investment) %>_ballot"> <div id="<%= dom_id(investment) %>_ballot">
<%= render 'ballot', investment: investment %> <%= render partial: 'ballot', locals: {
investment: investment,
investment_ids: investment_ids,
ballot: ballot,
} %>
</div> </div>
<% end %> <% end %>
</div> </div>

View File

@@ -40,7 +40,7 @@
investment: investment, investment: investment,
investment_ids: @investment_ids, investment_ids: @investment_ids,
investment_votes: @investment_votes, investment_votes: @investment_votes,
investment_ballots: @investment_ballots ballot: @ballot
} %> } %>
<% end %> <% end %>

View File

@@ -2,7 +2,9 @@
<%= render partial: '/budgets/investments/investment_show', locals: { <%= render partial: '/budgets/investments/investment_show', locals: {
investment: @investment, investment: @investment,
investment_votes: @investment_votes investment_ids: @investment_ids,
investment_votes: @investment_votes,
ballot: @ballot
} %> } %>
<%= render partial: '/comments/comment_tree', locals: { comment_tree: @comment_tree, comment_flags: @comment_flags } %> <%= render partial: '/comments/comment_tree', locals: { comment_tree: @comment_tree, comment_flags: @comment_flags } %>

View File

@@ -22,7 +22,7 @@
investment: investment, investment: investment,
investment_ids: @investment_ids, investment_ids: @investment_ids,
investment_votes: @investment_votes, investment_votes: @investment_votes,
investment_ballots: @investment_ballots ballot: @ballot
} %> } %>
<% end %> <% end %>

View File

@@ -27,7 +27,7 @@
investment: investment, investment: investment,
investment_ids: @investment_ids, investment_ids: @investment_ids,
investment_votes: @investment_votes, investment_votes: @investment_votes,
investment_ballots: @investment_ballots ballot: @ballot
} %> } %>
<% end %> <% end %>