Adds voting in selecting phase
This commit is contained in:
@@ -43,18 +43,23 @@
|
||||
</div>
|
||||
|
||||
<% unless investment.unfeasible? %>
|
||||
<% if feature?("investment_features.phase2") %>
|
||||
|
||||
<% if @budget.selecting? || @budget.on_hold? %>
|
||||
|
||||
<div id="<%= dom_id(investment) %>_votes"
|
||||
class="small-12 medium-3 column text-center">
|
||||
<%= render 'votes',
|
||||
{ investment: investment, vote_url: vote_investment_path(investment, value: 'yes') } %>
|
||||
{ investment: investment,
|
||||
vote_url: vote_budget_investment_path(@budget, investment, value: 'yes') } %>
|
||||
</div>
|
||||
|
||||
<% elsif feature?("investment_features.phase3") %>
|
||||
<div id="<%= dom_id(investment) %>_ballot"
|
||||
class="small-12 medium-3 column text-center">
|
||||
<%= render 'ballot', investment: investment %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="supported">
|
||||
<%= t("budget.investments.investment.already_supported") %>
|
||||
</div>
|
||||
<% elsif voting_allowed %>
|
||||
<% elsif @budget.selecting? %>
|
||||
|
||||
<%= link_to vote_url,
|
||||
class: "button button-support small expanded",
|
||||
|
||||
@@ -45,15 +45,19 @@
|
||||
</div>
|
||||
|
||||
<% if (@budget.selecting? && !@investment.unfeasible?) ||
|
||||
(@budget.balloting? && @investment.feasible?) %>
|
||||
(@budget.balloting? && @investment.feasible? ||
|
||||
(@budget.on_hold?)) %>
|
||||
<aside class="small-12 medium-3 column">
|
||||
<div class="sidebar-divider"></div>
|
||||
<h3><%= t("votes.supports") %></h3>
|
||||
<div class="text-center">
|
||||
<% if @budget.selecting? %>
|
||||
|
||||
<% if @budget.selecting? || @budget.on_hold? %>
|
||||
<div id="<%= dom_id(@investment) %>_votes">
|
||||
<%= render 'votes',
|
||||
{ investment: @investment, vote_url: vote_budget_investment_path(budget_id: @budget.id, id: @investment.id) } %>
|
||||
{ investment: @investment,
|
||||
vote_url: vote_budget_investment_path(@budget, @investment, value: 'yes') }
|
||||
%>
|
||||
</div>
|
||||
<% else %>
|
||||
<div id="<%= dom_id(@investment) %>_ballot">
|
||||
|
||||
1
app/views/budgets/investments/vote.js.erb
Normal file
1
app/views/budgets/investments/vote.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$("#<%= dom_id(@investment) %>_votes").html('<%= j render("budgets/investments/votes", investment: @investment, vote_url: vote_budget_investment_path(@budget, @investment, value: "yes")) %>');
|
||||
Reference in New Issue
Block a user