Adds voting in selecting phase

This commit is contained in:
rgarcia
2016-09-05 14:47:11 +02:00
parent a69475bf99
commit 29cad341f5
6 changed files with 137 additions and 20 deletions

View File

@@ -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>

View File

@@ -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",

View File

@@ -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">

View 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")) %>');