diff --git a/app/views/polls/_poll_group.html.erb b/app/views/polls/_poll_group.html.erb index 6595e3721..f4dcc5423 100644 --- a/app/views/polls/_poll_group.html.erb +++ b/app/views/polls/_poll_group.html.erb @@ -60,7 +60,15 @@
- <%= link_to t("polls.index.participate_button"), poll, class: "button expanded" %> + <%= link_to poll, class: "button expanded" do %> + <% if poll.expired? %> + <%= t("polls.index.participate_button_expired") %> + <% elsif poll.incoming? %> + <%= t("polls.index.participate_button_incoming") %> + <% else %> + <%= t("polls.index.participate_button") %> + <% end %> + <% end %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 9697cb913..bc676128d 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -403,6 +403,8 @@ en: expired: "Expired" title: "Polls" participate_button: "Participate in this poll" + participate_button_incoming: "More information" + participate_button_expired: "Poll ended" no_geozone_restricted: "All city" geozone_restricted: "Districts" geozone_info: "Can participate people in the Census of: " diff --git a/config/locales/es.yml b/config/locales/es.yml index fc4b87029..cae74281d 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -403,6 +403,8 @@ es: expired: "Terminadas" title: "Votaciones" participate_button: "Participar en esta votación" + participate_button_incoming: "Más información" + participate_button_expired: "Votación terminada" no_geozone_restricted: "Toda la ciudad" geozone_restricted: "Distritos" geozone_info: "Pueden participar las personas empadronadas en: " diff --git a/spec/features/polls/polls_spec.rb b/spec/features/polls/polls_spec.rb index fe5957181..047c71146 100644 --- a/spec/features/polls/polls_spec.rb +++ b/spec/features/polls/polls_spec.rb @@ -22,18 +22,21 @@ feature 'Polls' do visit polls_path expect(page).to have_content('Current poll') + expect(page).to have_link('Participate in this poll') expect(page).to_not have_content('Incoming poll') expect(page).to_not have_content('Expired poll') visit polls_path(filter: 'incoming') expect(page).to_not have_content('Current poll') expect(page).to have_content('Incoming poll') + expect(page).to have_link('More information') expect(page).to_not have_content('Expired poll') visit polls_path(filter: 'expired') expect(page).to_not have_content('Current poll') expect(page).to_not have_content('Incoming poll') expect(page).to have_content('Expired poll') + expect(page).to have_link('Poll ended') end scenario "Current filter is properly highlighted" do