+ <% ballot_groups = @ballot.groups.order(name: :asc) %>
+ <% ballot_groups.each do |group| %>
+
<% end %>
+
+ <% no_balloted_groups = @budget.groups.order(name: :asc) - ballot_groups %>
+ <% no_balloted_groups.each do |group| %>
+
+
+
+
+ <%= group.name %>
+
+
+ <%= link_to t("budgets.ballots.show.no_balloted_group_yet"), budget_group_path(@budget, group) %>
+
+
+
+
+ <% end %>
+
diff --git a/config/locales/budgets.en.yml b/config/locales/budgets.en.yml
index 49d1558cf..191a41f14 100644
--- a/config/locales/budgets.en.yml
+++ b/config/locales/budgets.en.yml
@@ -5,6 +5,7 @@ en:
title: Your ballot
amount_spent: Amount spent
remaining: "You still have
%{amount} to invest."
+ no_balloted_group_yet: "You have not voted on this group yet, go vote!"
remove: Remove vote
voted_html:
one: "You have voted
one proposal."
diff --git a/config/locales/budgets.es.yml b/config/locales/budgets.es.yml
index 98ef4ad4e..b036d1aa4 100644
--- a/config/locales/budgets.es.yml
+++ b/config/locales/budgets.es.yml
@@ -5,6 +5,7 @@ es:
title: Mis votos
amount_spent: Coste total
remaining: "Te quedan
%{amount} para invertir"
+ no_balloted_group_yet: "Todavía no has votado proyectos de este grupo, ¡vota!"
remove: Quitar voto
voted_html:
one: "Has votado
una propuesta."
diff --git a/spec/features/budgets/ballots_spec.rb b/spec/features/budgets/ballots_spec.rb
index 227241ee7..b789fcb86 100644
--- a/spec/features/budgets/ballots_spec.rb
+++ b/spec/features/budgets/ballots_spec.rb
@@ -350,6 +350,18 @@ feature 'Ballots' do
end
end
+ scenario 'Display links to vote on groups with no investments voted yet' do
+ group = create(:budget_group, budget: budget)
+ heading = create(:budget_heading, name: "District 1", group: group, price: 100)
+
+ ballot = create(:budget_ballot, user: user, budget: budget)
+
+ login_as(user)
+ visit budget_ballot_path(budget)
+
+ expect(page).to have_link "You have not voted on this group yet, go vote!", href: budget_group_path(budget, group)
+ end
+
end
scenario 'Removing investments from ballot', :js do