<% if proposal.image.present? %>
<%= image_tag proposal.image_url(:thumb), alt: proposal.image.title %>
diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml
index 156a38eff..427fec5ad 100644
--- a/config/i18n-tasks.yml
+++ b/config/i18n-tasks.yml
@@ -154,6 +154,7 @@ ignore_unused:
- 'users.show.filters.*'
- 'polls.index.filters.*'
- 'polls.index.section_header.*'
+ - 'polls.index.orders.*'
- 'debates.index.select_order'
- 'debates.index.orders.*'
- 'debates.index.section_header.*'
diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml
index a3751615a..eadcae62d 100644
--- a/config/locales/en/admin.yml
+++ b/config/locales/en/admin.yml
@@ -593,7 +593,6 @@ en:
author: Author
title: Title
valid_answers: Valid answers
- description: Description
video_url: External video
documents: Documents (1)
recounts:
@@ -607,7 +606,7 @@ en:
index:
title: "Results"
no_results: "There are no results"
- table_whites: "Blank ballots"
+ table_whites: "Totally blank ballots"
table_nulls: "Invalid ballots"
table_total: "Total ballots"
table_answer: Answer
diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml
index ff8a77014..c06fe78aa 100644
--- a/config/locales/en/general.yml
+++ b/config/locales/en/general.yml
@@ -482,7 +482,7 @@ en:
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."
show:
already_voted_in_booth: "You have already participated in a booth for this poll."
- dates_title: "Participation dates"
+ back: Back to voting
cant_answer_not_logged_in: "You must %{signin} or %{signup} to participate."
signin: Sign in
signup: Sign up
@@ -490,15 +490,13 @@ en:
verify_link: "verify your account"
cant_answer_incoming: "This poll has not yet started."
cant_answer_expired: "This poll has finished."
+ more_info_title: "More information"
+ documents: Documents
+ zoom_plus: Expand image
poll_questions:
create_question: "Create question"
default_valid_answers: "Yes, No"
show:
- answer_this_question: "Go to voting page"
- original_proposal: "Original proposal"
- author: "Created by"
- dates_title: "Participation dates"
- more_info: "More information"
not_logged_in: "You must %{signin} or %{signup} to participate."
signin: Sign in
signup: Sign up
@@ -509,7 +507,6 @@ en:
cant_answer_wrong_geozone: "This question is not available on your geozone."
vote_answer: "Vote %{answer}"
voted: "You have voted %{answer}"
- poll: "Poll"
proposal_notifications:
new:
title: "Send message"
@@ -524,9 +521,6 @@ en:
edit: 'Edit'
save: 'Save'
delete: 'Delete'
- comments:
- title: 'Comments'
- login_to_comment: 'You must %{signin} or %{signup} to leave a comment.'
"yes": "Yes"
"no": "No"
search_results: "Search results"
@@ -607,6 +601,10 @@ en:
budget: Participatory budget
searcher: Searcher
go_to_page: "Go to page of "
+ share: Share
+ orbit:
+ previous_slide: Previous Slide
+ next_slide: Next Slide
social:
blog: "%{org} Blog"
facebook: "%{org} Facebook"
diff --git a/config/locales/en/officing.yml b/config/locales/en/officing.yml
index 2dfc29ac3..378b87b15 100644
--- a/config/locales/en/officing.yml
+++ b/config/locales/en/officing.yml
@@ -29,7 +29,7 @@ en:
date: "Date"
select_booth: "Select booth"
select_date: "Select date"
- ballots_white: "Blank ballots"
+ ballots_white: "Totally blank ballots"
ballots_null: "Invalid ballots"
ballots_total: "Total ballots"
submit: "Save"
@@ -40,7 +40,7 @@ en:
results: Results
table_answer: Answer
table_votes: Votes
- table_whites: "Blank ballots"
+ table_whites: "Totally blank ballots"
table_nulls: "Invalid ballots"
table_total: "Total ballots"
residence:
diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml
index f95c2d39f..fc3945ddf 100644
--- a/config/locales/es/admin.yml
+++ b/config/locales/es/admin.yml
@@ -593,7 +593,6 @@ es:
author: Autor
title: Título
valid_answers: Respuestas válidas
- description: Descripción
video_url: Video externo
documents: Documentos (1)
recounts:
@@ -607,7 +606,7 @@ es:
index:
title: "Resultados"
no_results: "No hay resultados"
- table_whites: Papeletas en blanco
+ table_whites: Papeletas totalmente en blanco
table_nulls: Papeletas nulas
table_total: Papeletas totales
table_answer: Respuesta
diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml
index aaa59a900..77dcdc3f7 100644
--- a/config/locales/es/general.yml
+++ b/config/locales/es/general.yml
@@ -482,7 +482,7 @@ es:
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."
show:
already_voted_in_booth: "Ya has participado en esta votación en una urna."
- dates_title: "Fechas de participación"
+ back: Volver a votaciones
cant_answer_not_logged_in: "Necesitas %{signin} o %{signup} para participar."
signin: iniciar sesión
signup: registrarte
@@ -490,15 +490,13 @@ es:
verify_link: "verifica tu cuenta"
cant_answer_incoming: "Esta votación todavía no ha comenzado."
cant_answer_expired: "Esta votación ha terminado."
+ more_info_title: "Más información"
+ documents: Documentación
+ zoom_plus: Ampliar imagen
poll_questions:
create_question: "Crear pregunta para votación"
default_valid_answers: "Sí, No"
show:
- answer_this_question: "Responder a esta pregunta"
- original_proposal: "Propuesta original"
- author: "Creado por"
- dates_title: "Fechas de participación"
- more_info: "Más información"
not_logged_in: "Necesitas %{signin} o %{signup} para participar."
signin: iniciar sesión
signup: registrarte
@@ -509,7 +507,6 @@ es:
cant_answer_wrong_geozone: "Esta votación no está disponible en tu zona."
vote_answer: "Votar %{answer}"
voted: "Has votado %{answer}"
- poll: "Votación"
proposal_notifications:
new:
title: "Enviar mensaje"
@@ -524,9 +521,6 @@ es:
edit: 'Editar'
save: 'Guardar'
delete: 'Borrar'
- comments:
- title: 'Comentarios'
- login_to_comment: 'Necesitas %{signin} o %{signup} para comentar.'
"yes": "Sí"
"no": "No"
search_results: "Resultados de búsqueda"
@@ -607,6 +601,10 @@ es:
budget: Presupuestos participativos
searcher: Buscador
go_to_page: "Ir a la página de "
+ share: Compartir
+ orbit:
+ previous_slide: Imagen anterior
+ next_slide: Siguiente imagen
social:
blog: "Blog de %{org}"
facebook: "Facebook de %{org}"
diff --git a/config/locales/es/officing.yml b/config/locales/es/officing.yml
index 74358ab56..354b59710 100644
--- a/config/locales/es/officing.yml
+++ b/config/locales/es/officing.yml
@@ -29,7 +29,7 @@ es:
date: "Día"
select_booth: "Elige urna"
select_date: "Elige día"
- ballots_white: "Papeletas en blanco"
+ ballots_white: "Papeletas totalmente en blanco"
ballots_null: "Papeletas nulas"
ballots_total: "Papeletas totales"
submit: "Guardar"
@@ -40,7 +40,7 @@ es:
results: "Resultados"
table_answer: Respuesta
table_votes: Votos
- table_whites: Papeletas en blanco
+ table_whites: Papeletas totalmente en blanco
table_nulls: Papeletas nulas
table_total: Papeletas totales
residence:
diff --git a/config/routes.rb b/config/routes.rb
index 51e1f351d..2b9c4250c 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -113,7 +113,7 @@ Rails.application.routes.draw do
end
resources :polls, only: [:show, :index] do
- resources :questions, only: [:show], controller: 'polls/questions', shallow: true do
+ resources :questions, controller: 'polls/questions', shallow: true do
post :answer, on: :member
end
end
diff --git a/db/migrate/20171003170029_remove_description_from_poll_questions.rb b/db/migrate/20171003170029_remove_description_from_poll_questions.rb
new file mode 100644
index 000000000..31e1b9578
--- /dev/null
+++ b/db/migrate/20171003170029_remove_description_from_poll_questions.rb
@@ -0,0 +1,5 @@
+class RemoveDescriptionFromPollQuestions < ActiveRecord::Migration
+ def change
+ remove_column :poll_questions, :description
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index a53b0c490..c0fccda89 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -675,7 +675,6 @@ ActiveRecord::Schema.define(version: 20171003223152) do
t.string "author_visible_name"
t.string "title"
t.string "valid_answers"
- t.text "description"
t.integer "comments_count"
t.datetime "hidden_at"
t.datetime "created_at"
diff --git a/spec/factories.rb b/spec/factories.rb
index a127d1bc9..9f1fca8ed 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -498,7 +498,6 @@ FactoryGirl.define do
poll
association :author, factory: :user
sequence(:title) { |n| "Question title #{n}" }
- sequence(:description) { |n| "Question description #{n}" }
valid_answers { Faker::Lorem.words(3).join(', ') }
end
diff --git a/spec/features/admin/poll/questions_spec.rb b/spec/features/admin/poll/questions_spec.rb
index ca3706a24..52e3783f0 100644
--- a/spec/features/admin/poll/questions_spec.rb
+++ b/spec/features/admin/poll/questions_spec.rb
@@ -24,7 +24,6 @@ feature 'Admin poll questions' do
visit admin_question_path(question)
expect(page).to have_content(question.title)
- expect(page).to have_content(question.description)
expect(page).to have_content(question.author.name)
expect(page).to have_content(question.valid_answers.join(" "))
end
@@ -45,13 +44,11 @@ feature 'Admin poll questions' do
select 'Movies', from: 'poll_question_poll_id'
fill_in 'poll_question_title', with: title
- fill_in 'poll_question_description', with: description
fill_in 'poll_question_video_url', with: video_url
click_button 'Save'
expect(page).to have_content(title)
- expect(page).to have_content(description)
expect(page).to have_content(video_url)
end
@@ -64,7 +61,6 @@ feature 'Admin poll questions' do
expect(current_path).to eq(new_admin_question_path)
expect(page).to have_field('poll_question_title', with: proposal.title)
- expect(page).to have_field('poll_question_description', with: proposal.description)
expect(page).to have_field('poll_question_valid_answers', with: "Yes, No")
select 'Proposals', from: 'poll_question_poll_id'
@@ -72,7 +68,6 @@ feature 'Admin poll questions' do
click_button 'Save'
expect(page).to have_content(proposal.title)
- expect(page).to have_content(proposal.description)
expect(page).to have_link(proposal.title, href: proposal_path(proposal))
expect(page).to have_link(proposal.author.name, href: user_path(proposal.author))
end
diff --git a/spec/features/polls/questions_spec.rb b/spec/features/polls/questions_spec.rb
index 06dd9df08..9e7efeedc 100644
--- a/spec/features/polls/questions_spec.rb
+++ b/spec/features/polls/questions_spec.rb
@@ -11,121 +11,4 @@ feature 'Poll Questions' do
expect(proposal_question.title).to appear_before(normal_question.title)
end
-
- scenario 'shows the author visible name instead of a link to the author' do
- poll = create(:poll)
- question_with_author = create(:poll_question, poll: poll)
- question_with_author_visible_name = create(:poll_question, poll: poll, author_visible_name: 'potato')
-
- visit question_path(question_with_author)
- expect(page).to have_link(question_with_author.author.name)
-
- visit question_path(question_with_author_visible_name)
- expect(page).to_not have_link(question_with_author_visible_name.author.name)
- expect(page).to have_content(question_with_author_visible_name.author_visible_name)
- end
-
- scenario '#show view has video_url present' do
- poll = create(:poll)
- normal_question = create(:poll_question, poll: poll, video_url: "https://puppyvideos.com")
-
- visit question_path(normal_question)
-
- expect(page).to have_link(normal_question.video_url)
- end
-
- scenario '#show view has document present' do
- poll = create(:poll)
- normal_question = create(:poll_question, poll: poll)
- document = create(:document, documentable: normal_question)
-
- visit question_path(normal_question)
-
- expect(page).to have_content(document.title)
- end
-
- context 'Answering' do
- let(:geozone) { create(:geozone) }
- let(:poll) { create(:poll, geozone_restricted: true, geozone_ids: [geozone.id]) }
-
- scenario 'Non-logged in users' do
- question = create(:poll_question, valid_answers: 'Han Solo, Chewbacca')
-
- visit question_path(question)
-
- expect(page).to have_content('You must Sign in or Sign up to participate')
- end
-
- scenario 'Level 1 users' do
- question = create(:poll_question, poll: poll, valid_answers: 'Han Solo, Chewbacca')
-
- login_as(create(:user, geozone: geozone))
- visit question_path(question)
-
- expect(page).to have_content('You must verify your account in order to answer')
- end
-
- scenario 'Level 2 users in an poll question for a geozone which is not theirs' do
-
- other_poll = create(:poll, geozone_restricted: true, geozone_ids: [create(:geozone).id])
- question = create(:poll_question, poll: other_poll, valid_answers: 'Vader, Palpatine')
-
- login_as(create(:user, :level_two, geozone: geozone))
- visit question_path(question)
-
- expect(page).to have_content('This question is not available on your geozone')
- end
-
- scenario 'Level 2 users who can answer' do
- question = create(:poll_question, poll: poll, valid_answers: 'Han Solo, Chewbacca')
-
- login_as(create(:user, :level_two, geozone: geozone))
- visit question_path(question)
-
- expect(page).to have_link('Go to voting page')
- end
-
- scenario 'Level 2 users who have already answered' do
- question = create(:poll_question, poll: poll, valid_answers: 'Han Solo, Chewbacca')
-
- user = create(:user, :level_two, geozone: geozone)
- create(:poll_answer, question: question, author: user, answer: 'Chewbacca')
-
- login_as user
- visit question_path(question)
-
- expect(page).to have_link('Go to voting page')
- end
-
- scenario 'Level 2 users answering', :js do
- question = create(:poll_question, poll: poll, valid_answers: 'Han Solo, Chewbacca')
- user = create(:user, :level_two, geozone: geozone)
-
- login_as user
- visit question_path(question)
-
- expect(page).to have_link('Go to voting page')
- end
-
- scenario 'Records participation', :js do
- question = create(:poll_question, poll: poll, valid_answers: 'Han Solo, Chewbacca')
- user = create(:user, :level_two, geozone: geozone, gender: 'female', date_of_birth: 33.years.ago)
-
- login_as user
- visit question_path(question)
-
- click_link 'Go to voting page'
- click_link 'Han Solo'
-
- expect(page).to_not have_link('Han Solo')
-
- voter = poll.voters.first
- expect(voter.document_number).to eq(user.document_number)
- expect(voter.geozone_id).to eq(user.geozone_id)
- expect(voter.gender).to eq(user.gender)
- expect(voter.age).to eq(33)
- expect(voter.poll_id).to eq(poll.id)
- end
-
- end
end
diff --git a/spec/features/polls/voter_spec.rb b/spec/features/polls/voter_spec.rb
index c12a9f0e4..d925d3394 100644
--- a/spec/features/polls/voter_spec.rb
+++ b/spec/features/polls/voter_spec.rb
@@ -10,12 +10,13 @@ feature "Voter" do
user = create(:user, :level_two)
login_as user
- visit question_path(question)
+ visit poll_path(poll)
- click_link 'Go to voting page'
- click_link 'Yes'
+ within("#poll_question_#{question.id}_answers") do
+ click_link 'Yes'
+ expect(page).to_not have_link('Yes')
+ end
- expect(page).to_not have_link('Yes')
expect(Poll::Voter.count).to eq(1)
expect(Poll::Voter.first.origin).to eq("web")
end
@@ -56,7 +57,7 @@ feature "Voter" do
scenario "Trying to vote in web and then in booth", :js do
login_as user
- vote_for_poll_via_web
+ vote_for_poll_via_web(poll, question)
click_link "Sign out"
@@ -79,9 +80,7 @@ feature "Voter" do
click_link "Sign out"
login_as user
- visit question_path(question)
-
- click_link 'Go to voting page'
+ visit poll_path(poll)
expect(page).to_not have_link('Yes')
expect(page).to have_content "You have already participated in a booth for this poll."
diff --git a/spec/shared/features/nested_documentable.rb b/spec/shared/features/nested_documentable.rb
index 10a2c9fbf..8780936a7 100644
--- a/spec/shared/features/nested_documentable.rb
+++ b/spec/shared/features/nested_documentable.rb
@@ -322,5 +322,4 @@ end
def documentable_fill_new_valid_poll_question
page.select documentable.poll.name, from: 'poll_question_poll_id'
fill_in 'poll_question_title', with: "Star Wars: Episode IV - A New Hope"
- fill_in_ckeditor "poll_question_description", with: "Description"
end
diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb
index eda55986f..256b070e4 100644
--- a/spec/support/common_actions.rb
+++ b/spec/support/common_actions.rb
@@ -298,13 +298,14 @@ module CommonActions
end
end
- def vote_for_poll_via_web
- visit question_path(question)
+ def vote_for_poll_via_web(poll, question)
+ visit poll_path(poll)
- click_link 'Go to voting page'
- click_link 'Yes'
+ within("#poll_question_#{question.id}_answers") do
+ click_link 'Yes'
+ expect(page).to_not have_link('Yes')
+ end
- expect(page).to_not have_link('Yes')
expect(Poll::Voter.count).to eq(1)
end
- <%= t("shared.comments.title") %> - (<%= @commentable.comments_count %>) -
- - <%= render 'shared/wide_order_selector', i18n_namespace: "comments" %> - - <% if user_signed_in? %> - <%= render 'comments/form', {commentable: @commentable, parent_id: nil, toggeable: false} %> - <% else %> -- -