Adds message on polls index if there are no open polls
This commit is contained in:
@@ -9,24 +9,30 @@
|
|||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= render 'shared/filter_subnav', i18n_namespace: "polls.index" %>
|
<%= render 'shared/filter_subnav', i18n_namespace: "polls.index" %>
|
||||||
|
|
||||||
<% polls_by_geozone_restriction = @polls.group_by(&:geozone_restricted) %>
|
<% if @polls.any? %>
|
||||||
|
<% polls_by_geozone_restriction = @polls.group_by(&:geozone_restricted) %>
|
||||||
|
|
||||||
<% if polls_by_geozone_restriction[false].present? %>
|
<% if polls_by_geozone_restriction[false].present? %>
|
||||||
<h3 class="section-title-divider">
|
<h3 class="section-title-divider">
|
||||||
<span><%= t("polls.index.no_geozone_restricted") %></span>
|
<span><%= t("polls.index.no_geozone_restricted") %></span>
|
||||||
</h3>
|
</h3>
|
||||||
<%= render partial: 'poll_group', locals: {poll_group: polls_by_geozone_restriction[false]} %>
|
<%= render partial: 'poll_group', locals: {poll_group: polls_by_geozone_restriction[false]} %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if polls_by_geozone_restriction[true].present? %>
|
||||||
|
<h3 class="section-title-divider">
|
||||||
|
<span><%= t("polls.index.geozone_restricted") %></span>
|
||||||
|
</h3>
|
||||||
|
<%= render partial: 'poll_group', locals: {poll_group: polls_by_geozone_restriction[true]} %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= paginate @polls %>
|
||||||
|
<% else %>
|
||||||
|
<div class="callout primary margin-top">
|
||||||
|
<%= t("polls.index.no_polls") %>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if polls_by_geozone_restriction[true].present? %>
|
|
||||||
<h3 class="section-title-divider">
|
|
||||||
<span><%= t("polls.index.geozone_restricted") %></span>
|
|
||||||
</h3>
|
|
||||||
<%= render partial: 'poll_group', locals: {poll_group: polls_by_geozone_restriction[true]} %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%= paginate @polls %>
|
|
||||||
|
|
||||||
<div id="section_help" class="margin" data-magellan-target="section_help">
|
<div id="section_help" class="margin" data-magellan-target="section_help">
|
||||||
<p class="lead">
|
<p class="lead">
|
||||||
<strong><%= t("polls.index.section_footer.title") %></strong>
|
<strong><%= t("polls.index.section_footer.title") %></strong>
|
||||||
|
|||||||
@@ -487,6 +487,7 @@ en:
|
|||||||
description: Sign up to vote on citizen proposals and questions the City Council ask to the neighbors. Make municipal decisions directly.
|
description: Sign up to vote on citizen proposals and questions the City Council ask to the neighbors. Make municipal decisions directly.
|
||||||
help_text_1: "Voting takes place when a citizen proposal supports reaches 1% of the census with voting rights. Voting can also include questions that the City Council ask to the citizens decision."
|
help_text_1: "Voting takes place when a citizen proposal supports reaches 1% of the census with voting rights. Voting can also include questions that the City Council ask to the citizens decision."
|
||||||
help_text_2: "To participate in the next vote you have to sign up on %{org} and verify your account. All registered voters in the city over 16 years old can vote. The results of all votes are binding on the government."
|
help_text_2: "To participate in the next vote you have to sign up on %{org} and verify your account. All registered voters in the city over 16 years old can vote. The results of all votes are binding on the government."
|
||||||
|
no_polls: "There are no open votings."
|
||||||
show:
|
show:
|
||||||
already_voted_in_booth: "You have already participated in a physical booth. You can not participate again."
|
already_voted_in_booth: "You have already participated in a physical booth. You can not participate again."
|
||||||
already_voted_in_web: "You have already participated in this poll. If you vote again it will be overwritten."
|
already_voted_in_web: "You have already participated in this poll. If you vote again it will be overwritten."
|
||||||
|
|||||||
@@ -487,6 +487,7 @@ es:
|
|||||||
description: Regístrate para poder votar propuestas ciudadanas y las cuestiones que pregunta a sus vecinos el Ayuntamiento. Toma decisiones municipales de forma directa.
|
description: Regístrate para poder votar propuestas ciudadanas y las cuestiones que pregunta a sus vecinos el Ayuntamiento. Toma decisiones municipales de forma directa.
|
||||||
help_text_1: "Las votaciones se convocan cuando una propuesta ciudadana alcanza el 1% de apoyos del censo con derecho a voto. En las votaciones también se pueden incluir cuestiones que el Ayuntamiento somete a decisión directa de la ciudadanía."
|
help_text_1: "Las votaciones se convocan cuando una propuesta ciudadana alcanza el 1% de apoyos del censo con derecho a voto. En las votaciones también se pueden incluir cuestiones que el Ayuntamiento somete a decisión directa de la ciudadanía."
|
||||||
help_text_2: "Para participar en la próxima votación tienes que registrarte en %{org} y verificar tu cuenta. Pueden votar todas las personas empadronadas en la ciudad mayores de 16 años. Los resultados de todas las votaciones serán vinculantes para el gobierno."
|
help_text_2: "Para participar en la próxima votación tienes que registrarte en %{org} y verificar tu cuenta. Pueden votar todas las personas empadronadas en la ciudad mayores de 16 años. Los resultados de todas las votaciones serán vinculantes para el gobierno."
|
||||||
|
no_polls: "No hay votaciones abiertas."
|
||||||
show:
|
show:
|
||||||
already_voted_in_booth: "Ya has participado en esta votación en urnas presenciales, no puedes volver a participar."
|
already_voted_in_booth: "Ya has participado en esta votación en urnas presenciales, no puedes volver a participar."
|
||||||
already_voted_in_web: "Ya has participado en esta votación. Si vuelves a votar se sobreescribirá tu resultado anterior."
|
already_voted_in_web: "Ya has participado en esta votación. Si vuelves a votar se sobreescribirá tu resultado anterior."
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ feature 'Polls' do
|
|||||||
context '#index' do
|
context '#index' do
|
||||||
|
|
||||||
scenario 'Polls can be listed' do
|
scenario 'Polls can be listed' do
|
||||||
|
visit polls_path
|
||||||
|
expect(page).to have_content('There are no open votings')
|
||||||
|
|
||||||
polls = create_list(:poll, 3)
|
polls = create_list(:poll, 3)
|
||||||
create(:image, imageable: polls[0])
|
create(:image, imageable: polls[0])
|
||||||
create(:image, imageable: polls[1])
|
create(:image, imageable: polls[1])
|
||||||
|
|||||||
Reference in New Issue
Block a user