Merge pull request #4062 from consul/voting_styles
Refactor ballot / ballot line voting logic
This commit is contained in:
@@ -1285,6 +1285,7 @@
|
|||||||
.progress {
|
.progress {
|
||||||
background: #212033;
|
background: #212033;
|
||||||
clear: both;
|
clear: both;
|
||||||
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-meter {
|
.progress-meter {
|
||||||
@@ -1293,29 +1294,20 @@
|
|||||||
transition: width 2s;
|
transition: width 2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spent-amount-progress,
|
|
||||||
.spent-amount-meter {
|
|
||||||
background: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.spent-amount-text {
|
.spent-amount-text {
|
||||||
color: #fff;
|
margin-bottom: 0;
|
||||||
font-size: $base-font-size;
|
position: relative;
|
||||||
font-weight: normal;
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
top: 16px;
|
white-space: nowrap;
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
color: #a5a1ff;
|
color: #a5a1ff;
|
||||||
content: "\57";
|
content: "\57";
|
||||||
font-family: "icons";
|
font-family: "icons";
|
||||||
font-size: $small-font-size;
|
font-size: $small-font-size;
|
||||||
|
line-height: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: -6px;
|
right: -0.5em;
|
||||||
top: -17px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1328,7 +1320,6 @@
|
|||||||
|
|
||||||
.amount-available {
|
.amount-available {
|
||||||
display: block;
|
display: block;
|
||||||
text-align: right;
|
|
||||||
|
|
||||||
span {
|
span {
|
||||||
font-size: rem-calc(24);
|
font-size: rem-calc(24);
|
||||||
@@ -1486,6 +1477,7 @@
|
|||||||
height: auto;
|
height: auto;
|
||||||
left: 0;
|
left: 0;
|
||||||
padding: $line-height;
|
padding: $line-height;
|
||||||
|
padding-bottom: $line-height / 2;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ module Budgets
|
|||||||
before_action :load_investments
|
before_action :load_investments
|
||||||
before_action :load_ballot_referer
|
before_action :load_ballot_referer
|
||||||
|
|
||||||
load_and_authorize_resource :budget
|
authorize_resource :budget
|
||||||
load_and_authorize_resource :ballot, class: "Budget::Ballot", through: :budget
|
authorize_resource :ballot
|
||||||
load_and_authorize_resource :line, through: :ballot, find_by: :investment_id, class: "Budget::Ballot::Line"
|
load_and_authorize_resource :line, through: :ballot, find_by: :investment_id, class: "Budget::Ballot::Line"
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ module Budgets
|
|||||||
class BallotsController < ApplicationController
|
class BallotsController < ApplicationController
|
||||||
before_action :authenticate_user!
|
before_action :authenticate_user!
|
||||||
before_action :load_budget
|
before_action :load_budget
|
||||||
load_and_authorize_resource :budget
|
authorize_resource :budget
|
||||||
before_action :load_ballot
|
before_action :load_ballot
|
||||||
after_action :store_referer, only: [:show]
|
after_action :store_referer, only: [:show]
|
||||||
|
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ module Budgets
|
|||||||
def load_heading
|
def load_heading
|
||||||
if params[:heading_id].present?
|
if params[:heading_id].present?
|
||||||
@heading = @budget.headings.find_by_slug_or_id! params[:heading_id]
|
@heading = @budget.headings.find_by_slug_or_id! params[:heading_id]
|
||||||
@assigned_heading = @ballot&.heading_for_group(@heading&.group)
|
@assigned_heading = @ballot&.heading_for_group(@heading.group)
|
||||||
load_map
|
load_map
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
module BallotsHelper
|
|
||||||
def progress_bar_width(amount_available, amount_spent)
|
|
||||||
(amount_spent / amount_available.to_f * 100).to_s + "%"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -163,10 +163,6 @@ class Budget < ApplicationRecord
|
|||||||
formatted_amount(heading_price(heading))
|
formatted_amount(heading_price(heading))
|
||||||
end
|
end
|
||||||
|
|
||||||
def formatted_heading_amount_spent(heading)
|
|
||||||
formatted_amount(amount_spent(heading))
|
|
||||||
end
|
|
||||||
|
|
||||||
def investments_orders
|
def investments_orders
|
||||||
case phase
|
case phase
|
||||||
when "accepting", "reviewing"
|
when "accepting", "reviewing"
|
||||||
|
|||||||
@@ -17,22 +17,6 @@ class Budget
|
|||||||
investments.sum(:price).to_i
|
investments.sum(:price).to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
def amount_spent(heading)
|
|
||||||
investments.by_heading(heading.id).sum(:price).to_i
|
|
||||||
end
|
|
||||||
|
|
||||||
def formatted_amount_spent(heading)
|
|
||||||
budget.formatted_amount(amount_spent(heading))
|
|
||||||
end
|
|
||||||
|
|
||||||
def amount_available(heading)
|
|
||||||
budget.heading_price(heading) - amount_spent(heading)
|
|
||||||
end
|
|
||||||
|
|
||||||
def formatted_amount_available(heading)
|
|
||||||
budget.formatted_amount(amount_available(heading))
|
|
||||||
end
|
|
||||||
|
|
||||||
def has_lines_in_group?(group)
|
def has_lines_in_group?(group)
|
||||||
groups.include?(group)
|
groups.include?(group)
|
||||||
end
|
end
|
||||||
@@ -75,5 +59,20 @@ class Budget
|
|||||||
def casted_offline?
|
def casted_offline?
|
||||||
budget.poll&.voted_by?(user)
|
budget.poll&.voted_by?(user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def voting_style
|
||||||
|
@voting_style ||= voting_style_class.new(self)
|
||||||
|
end
|
||||||
|
delegate :amount_available, :amount_available_info, :amount_spent, :amount_spent_info,
|
||||||
|
:amount_limit_info, :change_vote_info, :enough_resources?, :formatted_amount_available,
|
||||||
|
:formatted_amount_limit, :formatted_amount_spent, :not_enough_resources_error,
|
||||||
|
:percentage_spent, :reason_for_not_being_ballotable, :voted_info,
|
||||||
|
to: :voting_style
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def voting_style_class
|
||||||
|
Budget::VotingStyles::Knapsack
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Budget
|
|||||||
validates :ballot_id, :investment_id, :heading_id, :group_id, :budget_id, presence: true
|
validates :ballot_id, :investment_id, :heading_id, :group_id, :budget_id, presence: true
|
||||||
|
|
||||||
validate :check_selected
|
validate :check_selected
|
||||||
validate :check_sufficient_funds
|
validate :check_enough_resources
|
||||||
validate :check_valid_heading
|
validate :check_valid_heading
|
||||||
|
|
||||||
scope :by_investment, ->(investment_id) { where(investment_id: investment_id) }
|
scope :by_investment, ->(investment_id) { where(investment_id: investment_id) }
|
||||||
@@ -18,9 +18,12 @@ class Budget
|
|||||||
before_validation :set_denormalized_ids
|
before_validation :set_denormalized_ids
|
||||||
after_save :store_user_heading
|
after_save :store_user_heading
|
||||||
|
|
||||||
def check_sufficient_funds
|
def check_enough_resources
|
||||||
ballot.lock!
|
ballot.lock!
|
||||||
errors.add(:money, "insufficient funds") if ballot.amount_available(investment.heading) < investment.price.to_i
|
|
||||||
|
unless ballot.enough_resources?(investment)
|
||||||
|
errors.add(:resources, ballot.not_enough_resources_error)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_valid_heading
|
def check_valid_heading
|
||||||
|
|||||||
@@ -268,8 +268,9 @@ class Budget
|
|||||||
return :not_selected unless selected?
|
return :not_selected unless selected?
|
||||||
return :no_ballots_allowed unless budget.balloting?
|
return :no_ballots_allowed unless budget.balloting?
|
||||||
return :different_heading_assigned unless ballot.valid_heading?(heading)
|
return :different_heading_assigned unless ballot.valid_heading?(heading)
|
||||||
return :not_enough_money if ballot.present? && !enough_money?(ballot)
|
|
||||||
return :casted_offline if ballot.casted_offline?
|
return :casted_offline if ballot.casted_offline?
|
||||||
|
|
||||||
|
ballot.reason_for_not_being_ballotable(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
def permission_problem(user)
|
def permission_problem(user)
|
||||||
@@ -301,15 +302,6 @@ class Budget
|
|||||||
user.headings_voted_within_group(group).where(id: heading.id).exists?
|
user.headings_voted_within_group(group).where(id: heading.id).exists?
|
||||||
end
|
end
|
||||||
|
|
||||||
def ballotable_by?(user)
|
|
||||||
reason_for_not_being_ballotable_by(user).blank?
|
|
||||||
end
|
|
||||||
|
|
||||||
def enough_money?(ballot)
|
|
||||||
available_money = ballot.amount_available(heading)
|
|
||||||
price.to_i <= available_money
|
|
||||||
end
|
|
||||||
|
|
||||||
def register_selection(user)
|
def register_selection(user)
|
||||||
vote_by(voter: user, vote: "yes") if selectable_by?(user)
|
vote_by(voter: user, vote: "yes") if selectable_by?(user)
|
||||||
end
|
end
|
||||||
|
|||||||
50
app/models/budget/voting_styles/base.rb
Normal file
50
app/models/budget/voting_styles/base.rb
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
class Budget::VotingStyles::Base
|
||||||
|
attr_reader :ballot
|
||||||
|
|
||||||
|
def initialize(ballot)
|
||||||
|
@ballot = ballot
|
||||||
|
end
|
||||||
|
|
||||||
|
def name
|
||||||
|
self.class.name.split("::").last.underscore
|
||||||
|
end
|
||||||
|
|
||||||
|
def change_vote_info(link:)
|
||||||
|
I18n.t("budgets.investments.index.sidebar.change_vote_info.#{name}", link: link)
|
||||||
|
end
|
||||||
|
|
||||||
|
def voted_info(heading)
|
||||||
|
I18n.t("budgets.investments.index.sidebar.voted_info.#{name}",
|
||||||
|
count: investments(heading).count,
|
||||||
|
amount_spent: ballot.budget.formatted_amount(investments_price(heading)))
|
||||||
|
end
|
||||||
|
|
||||||
|
def amount_available_info(heading)
|
||||||
|
I18n.t("budgets.ballots.show.amount_available.#{name}",
|
||||||
|
amount: formatted_amount_available(heading))
|
||||||
|
end
|
||||||
|
|
||||||
|
def amount_spent_info(heading)
|
||||||
|
I18n.t("budgets.ballots.show.amount_spent.#{name}",
|
||||||
|
amount: formatted_amount_spent(heading))
|
||||||
|
end
|
||||||
|
|
||||||
|
def amount_limit_info(heading)
|
||||||
|
I18n.t("budgets.ballots.show.amount_limit.#{name}",
|
||||||
|
amount: formatted_amount_limit(heading))
|
||||||
|
end
|
||||||
|
|
||||||
|
def percentage_spent(heading)
|
||||||
|
100.0 * amount_spent(heading) / amount_limit(heading)
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def investments(heading)
|
||||||
|
ballot.investments.by_heading(heading.id)
|
||||||
|
end
|
||||||
|
|
||||||
|
def investments_price(heading)
|
||||||
|
investments(heading).sum(:price).to_i
|
||||||
|
end
|
||||||
|
end
|
||||||
41
app/models/budget/voting_styles/knapsack.rb
Normal file
41
app/models/budget/voting_styles/knapsack.rb
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
class Budget::VotingStyles::Knapsack < Budget::VotingStyles::Base
|
||||||
|
def enough_resources?(investment)
|
||||||
|
investment.price.to_i <= amount_available(investment.heading)
|
||||||
|
end
|
||||||
|
|
||||||
|
def reason_for_not_being_ballotable(investment)
|
||||||
|
:not_enough_money unless enough_resources?(investment)
|
||||||
|
end
|
||||||
|
|
||||||
|
def not_enough_resources_error
|
||||||
|
"insufficient funds"
|
||||||
|
end
|
||||||
|
|
||||||
|
def amount_available(heading)
|
||||||
|
amount_limit(heading) - amount_spent(heading)
|
||||||
|
end
|
||||||
|
|
||||||
|
def amount_spent(heading)
|
||||||
|
investments_price(heading)
|
||||||
|
end
|
||||||
|
|
||||||
|
def amount_limit(heading)
|
||||||
|
ballot.budget.heading_price(heading)
|
||||||
|
end
|
||||||
|
|
||||||
|
def formatted_amount_available(heading)
|
||||||
|
format(amount_available(heading))
|
||||||
|
end
|
||||||
|
|
||||||
|
def formatted_amount_spent(heading)
|
||||||
|
format(amount_spent(heading))
|
||||||
|
end
|
||||||
|
|
||||||
|
def formatted_amount_limit(heading)
|
||||||
|
format(amount_limit(heading))
|
||||||
|
end
|
||||||
|
|
||||||
|
def format(amount)
|
||||||
|
ballot.budget.formatted_amount(amount)
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -19,22 +19,19 @@
|
|||||||
<div class="row ballot">
|
<div class="row ballot">
|
||||||
<% ballot_groups = @ballot.groups.sort_by_name %>
|
<% ballot_groups = @ballot.groups.sort_by_name %>
|
||||||
<% ballot_groups.each do |group| %>
|
<% ballot_groups.each do |group| %>
|
||||||
|
<% heading = @ballot.heading_for_group(group) %>
|
||||||
<div id="<%= dom_id(group) %>" class="small-12 medium-6 column end">
|
<div id="<%= dom_id(group) %>" class="small-12 medium-6 column end">
|
||||||
<div class="margin-top ballot-content">
|
<div class="margin-top ballot-content">
|
||||||
<div class="subtitle">
|
<div class="subtitle">
|
||||||
<h3>
|
<h3>
|
||||||
<%= group.name %> - <%= @ballot.heading_for_group(group).name %>
|
<%= group.name %> - <%= heading.name %>
|
||||||
</h3>
|
</h3>
|
||||||
<%= link_to sanitize(t("budgets.ballots.show.remaining",
|
<%= link_to sanitize(@ballot.amount_available_info(heading)),
|
||||||
amount: @ballot.formatted_amount_available(@ballot.heading_for_group(group)))),
|
|
||||||
budget_group_path(@budget, group) %>
|
budget_group_path(@budget, group) %>
|
||||||
</div>
|
</div>
|
||||||
<% if @ballot.has_lines_in_group?(group) %>
|
<% if @ballot.has_lines_in_group?(group) %>
|
||||||
<h4 class="amount-spent text-right">
|
<h4 class="amount-spent text-right">
|
||||||
<%= t("budgets.ballots.show.amount_spent") %>
|
<%= sanitize(@ballot.amount_spent_info(heading)) %>
|
||||||
<span>
|
|
||||||
<%= @ballot.formatted_amount_spent(@ballot.heading_for_group(group)) %>
|
|
||||||
</span>
|
|
||||||
</h4>
|
</h4>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -1,29 +1,18 @@
|
|||||||
<span class="total-amount">
|
<span class="total-amount">
|
||||||
<%= @budget.formatted_heading_price(@heading) %>
|
<%= sanitize(ballot.amount_limit_info(heading)) %>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div class="progress" role="progressbar" tabindex="0"
|
<div class="progress" role="progressbar" tabindex="0"
|
||||||
id="progress"
|
aria-valuenow="<%= ballot.percentage_spent(heading) %>" aria-valuemin="0" aria-valuemax="100">
|
||||||
aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
|
|
||||||
<div class="progress-meter"
|
<div class="progress-meter"
|
||||||
style="width:
|
style="width: <%= ballot.percentage_spent(heading) %>%">
|
||||||
<%= progress_bar_width(@budget.heading_price(@heading),
|
|
||||||
@ballot.amount_spent(@heading)) %>">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="progress spent-amount-progress" role="progressbar" tabindex="0"
|
<p id="amount-spent" class="spent-amount-text" style="width: <%= ballot.percentage_spent(heading) %>%">
|
||||||
aria-valuenow="20" aria-valuemin="0" aria-valuetext="25 percent" aria-valuemax="100">
|
<small><%= t("budgets.progress_bar.assigned") %></small><%= ballot.formatted_amount_spent(heading) %>
|
||||||
<span class="progress-meter spent-amount-meter"
|
|
||||||
style="width:
|
|
||||||
<%= progress_bar_width(@budget.heading_price(@heading),
|
|
||||||
@ballot.amount_spent(@heading)) %>">
|
|
||||||
<p id="amount-spent" class="progress-meter-text spent-amount-text">
|
|
||||||
<small><%= t("budgets.progress_bar.assigned") %></small><%= @ballot.formatted_amount_spent(@heading) %>
|
|
||||||
<span id="amount-available" class="amount-available">
|
<span id="amount-available" class="amount-available">
|
||||||
<small><%= t("budgets.progress_bar.available") %></small>
|
<small><%= t("budgets.progress_bar.available") %></small>
|
||||||
<span><%= @ballot.formatted_amount_available(@heading) %></span>
|
<span><%= ballot.formatted_amount_available(heading) %></span>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
$("#progress_bar").html("<%= j render("/budgets/ballot/progress_bar", ballot: @ballot) %>");
|
$("#progress_bar").html("<%= j render("/budgets/ballot/progress_bar", ballot: @ballot, heading: @heading) %>");
|
||||||
$("#sidebar").html("<%= j render("/budgets/investments/sidebar") %>");
|
$("#sidebar").html("<%= j render("/budgets/investments/sidebar") %>");
|
||||||
$("#<%= dom_id(@investment) %>_ballot").html("<%= j render("/budgets/investments/ballot",
|
|
||||||
investment: @investment,
|
|
||||||
investment_ids: @investment_ids,
|
|
||||||
ballot: @ballot) %>");
|
|
||||||
|
|
||||||
<%= render "refresh_ballots",
|
<%= render "refresh_ballots",
|
||||||
investment: @investment,
|
|
||||||
investment_ids: @investment_ids,
|
investment_ids: @investment_ids,
|
||||||
ballot: @ballot %>
|
ballot: @ballot %>
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
$("#progress_bar").html("<%= j render("budgets/ballot/progress_bar", ballot: @ballot) %>");
|
$("#progress_bar").html("<%= j render("budgets/ballot/progress_bar", ballot: @ballot, heading: @heading) %>");
|
||||||
$("#sidebar").html("<%= j render("budgets/investments/sidebar") %>");
|
$("#sidebar").html("<%= j render("budgets/investments/sidebar") %>");
|
||||||
$("#ballot").html("<%= j render("budgets/ballot/ballot") %>")
|
$("#ballot").html("<%= j render("budgets/ballot/ballot") %>")
|
||||||
|
|
||||||
$("#<%= dom_id(@investment) %>_ballot").html("<%= j render("/budgets/investments/ballot",
|
|
||||||
investment: @investment,
|
|
||||||
investment_ids: @investment_ids,
|
|
||||||
ballot: @ballot) %>");
|
|
||||||
<%= render "refresh_ballots",
|
<%= render "refresh_ballots",
|
||||||
investment: @investment,
|
|
||||||
investment_ids: @investment_ids,
|
investment_ids: @investment_ids,
|
||||||
ballot: @ballot %>
|
ballot: @ballot %>
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<%= t("budgets.investments.index.by_heading", heading: @heading.name) %>
|
<%= t("budgets.investments.index.by_heading", heading: @heading.name) %>
|
||||||
</h2>
|
</h2>
|
||||||
<div id="progress_bar" class="no-margin-top">
|
<div id="progress_bar" class="no-margin-top">
|
||||||
<%= render "budgets/ballot/progress_bar" %>
|
<%= render "budgets/ballot/progress_bar", ballot: @ballot, heading: @heading %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
|
|
||||||
<% if @heading && can?(:show, @ballot) %>
|
<% if @heading && can?(:show, @ballot) %>
|
||||||
<p class="callout">
|
<p class="callout">
|
||||||
<%= sanitize(t("budgets.investments.index.sidebar.voted_info",
|
<%= sanitize(@ballot.change_vote_info(
|
||||||
link: link_to(t("budgets.investments.index.sidebar.voted_info_link"),
|
link: link_to(t("budgets.investments.index.sidebar.change_vote_link"),
|
||||||
budget_ballot_path(@budget)))) %>
|
budget_ballot_path(@budget)))) %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -39,11 +39,7 @@
|
|||||||
|
|
||||||
<% if @ballot.investments.by_heading(@heading.id).count > 0 %>
|
<% if @ballot.investments.by_heading(@heading.id).count > 0 %>
|
||||||
<p>
|
<p>
|
||||||
<em>
|
<em><%= sanitize(@ballot.voted_info(@heading)) %></em>
|
||||||
<%= sanitize(t("budgets.investments.index.sidebar.voted",
|
|
||||||
count: @ballot.investments.by_heading(@heading.id).count,
|
|
||||||
amount_spent: @ballot.formatted_amount_spent(@heading))) %>
|
|
||||||
</em>
|
|
||||||
</p>
|
</p>
|
||||||
<% elsif @assigned_heading.present? %>
|
<% elsif @assigned_heading.present? %>
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ ignore_unused:
|
|||||||
- "budgets.phase.*"
|
- "budgets.phase.*"
|
||||||
- "budgets.investments.index.orders.*"
|
- "budgets.investments.index.orders.*"
|
||||||
- "budgets.index.section_header.*"
|
- "budgets.index.section_header.*"
|
||||||
|
- "budgets.investments.index.sidebar.voted_info.*"
|
||||||
- "activerecord.*"
|
- "activerecord.*"
|
||||||
- "activemodel.*"
|
- "activemodel.*"
|
||||||
- "attributes.*"
|
- "attributes.*"
|
||||||
|
|||||||
@@ -3,8 +3,12 @@ en:
|
|||||||
ballots:
|
ballots:
|
||||||
show:
|
show:
|
||||||
title: Your ballot
|
title: Your ballot
|
||||||
amount_spent: Amount spent
|
amount_available:
|
||||||
remaining: "You still have <span>%{amount}</span> to invest."
|
knapsack: "You still have <span>%{amount}</span> to invest."
|
||||||
|
amount_spent:
|
||||||
|
knapsack: "Amount spent <span>%{amount}</span>"
|
||||||
|
amount_limit:
|
||||||
|
knapsack: "%{amount}"
|
||||||
no_balloted_group_yet: "You have not voted on this group yet, go vote!"
|
no_balloted_group_yet: "You have not voted on this group yet, go vote!"
|
||||||
remove: Remove vote
|
remove: Remove vote
|
||||||
voted:
|
voted:
|
||||||
@@ -84,11 +88,13 @@ en:
|
|||||||
other: " containing the term <strong>'%{search_term}'</strong>"
|
other: " containing the term <strong>'%{search_term}'</strong>"
|
||||||
sidebar:
|
sidebar:
|
||||||
my_ballot: My ballot
|
my_ballot: My ballot
|
||||||
voted:
|
voted_info:
|
||||||
|
knapsack:
|
||||||
one: "<strong>You voted one proposal with a cost of %{amount_spent}</strong>"
|
one: "<strong>You voted one proposal with a cost of %{amount_spent}</strong>"
|
||||||
other: "<strong>You voted %{count} proposals with a cost of %{amount_spent}</strong>"
|
other: "<strong>You voted %{count} proposals with a cost of %{amount_spent}</strong>"
|
||||||
voted_info: You can %{link} at any time until the close of this phase. No need to spend all the money available.
|
change_vote_info:
|
||||||
voted_info_link: change your vote
|
knapsack: "You can %{link} at any time until the close of this phase. No need to spend all the money available."
|
||||||
|
change_vote_link: "change your vote"
|
||||||
different_heading_assigned: "You have active votes in another heading: %{heading_link}"
|
different_heading_assigned: "You have active votes in another heading: %{heading_link}"
|
||||||
change_ballot: "If your change your mind you can remove your votes in %{check_ballot} and start again."
|
change_ballot: "If your change your mind you can remove your votes in %{check_ballot} and start again."
|
||||||
check_ballot_link: "check and confirm my ballot"
|
check_ballot_link: "check and confirm my ballot"
|
||||||
|
|||||||
@@ -3,8 +3,12 @@ es:
|
|||||||
ballots:
|
ballots:
|
||||||
show:
|
show:
|
||||||
title: Mis votos
|
title: Mis votos
|
||||||
amount_spent: Coste total
|
amount_available:
|
||||||
remaining: "Te quedan <span>%{amount}</span> para invertir"
|
knapsack: "Te quedan <span>%{amount}</span> para invertir"
|
||||||
|
amount_spent:
|
||||||
|
knapsack: "Coste total <span>%{amount}</span>"
|
||||||
|
amount_limit:
|
||||||
|
knapsack: "%{amount}"
|
||||||
no_balloted_group_yet: "Todavía no has votado proyectos de este grupo, ¡vota!"
|
no_balloted_group_yet: "Todavía no has votado proyectos de este grupo, ¡vota!"
|
||||||
remove: Quitar voto
|
remove: Quitar voto
|
||||||
voted:
|
voted:
|
||||||
@@ -84,11 +88,13 @@ es:
|
|||||||
other: " que contienen <strong>'%{search_term}'</strong>"
|
other: " que contienen <strong>'%{search_term}'</strong>"
|
||||||
sidebar:
|
sidebar:
|
||||||
my_ballot: Mis votos
|
my_ballot: Mis votos
|
||||||
voted:
|
voted_info:
|
||||||
|
knapsack:
|
||||||
one: "<strong>Has votado un proyecto por un valor de %{amount_spent}</strong>"
|
one: "<strong>Has votado un proyecto por un valor de %{amount_spent}</strong>"
|
||||||
other: "<strong>Has votado %{count} proyectos por un valor de %{amount_spent}</strong>"
|
other: "<strong>Has votado %{count} proyectos por un valor de %{amount_spent}</strong>"
|
||||||
voted_info: Puedes %{link} en cualquier momento hasta el cierre de esta fase. No hace falta que gastes todo el dinero disponible.
|
change_vote_info:
|
||||||
voted_info_link: cambiar tus votos
|
knapsack: "Puedes %{link} en cualquier momento hasta el cierre de esta fase. No hace falta que gastes todo el dinero disponible."
|
||||||
|
change_vote_link: "cambiar tus votos"
|
||||||
different_heading_assigned: "Ya apoyaste proyectos de otra sección del presupuesto: %{heading_link}"
|
different_heading_assigned: "Ya apoyaste proyectos de otra sección del presupuesto: %{heading_link}"
|
||||||
change_ballot: "Si cambias de opinión puedes borrar tus votos en %{check_ballot} y volver a empezar."
|
change_ballot: "Si cambias de opinión puedes borrar tus votos en %{check_ballot} y volver a empezar."
|
||||||
check_ballot_link: "revisar y confirmar mis votos"
|
check_ballot_link: "revisar y confirmar mis votos"
|
||||||
|
|||||||
Reference in New Issue
Block a user