From 9fc35e9087d957fd205d958854bc9f97fac2dfc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Fri, 20 Oct 2017 18:44:56 +0200 Subject: [PATCH 01/11] Added `results_enabled` and `stats_enabled` to Poll --- ...20163240_add_results_and_stats_to_polls.rb | 6 ++ db/schema.rb | 56 ++++++++++++++++--- 2 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 db/migrate/20171020163240_add_results_and_stats_to_polls.rb diff --git a/db/migrate/20171020163240_add_results_and_stats_to_polls.rb b/db/migrate/20171020163240_add_results_and_stats_to_polls.rb new file mode 100644 index 000000000..af6f82aaa --- /dev/null +++ b/db/migrate/20171020163240_add_results_and_stats_to_polls.rb @@ -0,0 +1,6 @@ +class AddResultsAndStatsToPolls < ActiveRecord::Migration + def change + add_column :polls, :results_enabled, :boolean, default: false + add_column :polls, :stats_enabled, :boolean, default: false + end +end diff --git a/db/schema.rb b/db/schema.rb index c3ccbeac7..f8dd19c13 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171017221546) do +ActiveRecord::Schema.define(version: 20171020163240) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -486,6 +486,10 @@ ActiveRecord::Schema.define(version: 20171017221546) do t.boolean "draft_publication_enabled", default: false t.boolean "result_publication_enabled", default: false t.boolean "published", default: true + t.date "proposals_phase_start_date" + t.date "proposals_phase_end_date" + t.boolean "proposals_phase_enabled" + t.text "proposals_description" end add_index "legislation_processes", ["allegations_end_date"], name: "index_legislation_processes_on_allegations_end_date", using: :btree @@ -498,6 +502,36 @@ ActiveRecord::Schema.define(version: 20171017221546) do add_index "legislation_processes", ["result_publication_date"], name: "index_legislation_processes_on_result_publication_date", using: :btree add_index "legislation_processes", ["start_date"], name: "index_legislation_processes_on_start_date", using: :btree + create_table "legislation_proposals", force: :cascade do |t| + t.integer "legislation_process_id" + t.string "title", limit: 80 + t.text "description" + t.string "question" + t.string "external_url" + t.integer "author_id" + t.datetime "hidden_at" + t.integer "flags_count", default: 0 + t.datetime "ignored_flag_at" + t.integer "cached_votes_up", default: 0 + t.integer "comments_count", default: 0 + t.datetime "confirmed_hide_at" + t.integer "hot_score", limit: 8, default: 0 + t.integer "confidence_score", default: 0 + t.string "responsible_name", limit: 60 + t.text "summary" + t.string "video_url" + t.tsvector "tsv" + t.integer "geozone_id" + t.datetime "retired_at" + t.string "retired_reason" + t.text "retired_explanation" + t.integer "community_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "legislation_proposals", ["legislation_process_id"], name: "index_legislation_proposals_on_legislation_process_id", using: :btree + create_table "legislation_question_options", force: :cascade do |t| t.integer "legislation_question_id" t.string "value" @@ -666,6 +700,7 @@ ActiveRecord::Schema.define(version: 20171017221546) do t.text "description" t.integer "question_id" t.integer "given_order", default: 1 + t.boolean "most_voted", default: false end add_index "poll_question_answers", ["question_id"], name: "index_poll_question_answers_on_question_id", using: :btree @@ -759,6 +794,8 @@ ActiveRecord::Schema.define(version: 20171017221546) do t.integer "comments_count", default: 0 t.integer "author_id" t.datetime "hidden_at" + t.boolean "results_enabled", default: false + t.boolean "stats_enabled", default: false end add_index "polls", ["starts_at", "ends_at"], name: "index_polls_on_starts_at_and_ends_at", using: :btree @@ -918,16 +955,20 @@ ActiveRecord::Schema.define(version: 20171017221546) do add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree create_table "tags", force: :cascade do |t| - t.string "name", limit: 40 - t.integer "taggings_count", default: 0 - t.integer "debates_count", default: 0 - t.integer "proposals_count", default: 0 - t.integer "spending_proposals_count", default: 0 + t.string "name", limit: 40 + t.integer "taggings_count", default: 0 + t.integer "debates_count", default: 0 + t.integer "proposals_count", default: 0 + t.integer "spending_proposals_count", default: 0 t.string "kind" - t.integer "budget/investments_count", default: 0 + t.integer "budget/investments_count", default: 0 + t.integer "legislation/proposals_count", default: 0 + t.integer "legislation/processes_count", default: 0 end add_index "tags", ["debates_count"], name: "index_tags_on_debates_count", using: :btree + add_index "tags", ["legislation/processes_count"], name: "index_tags_on_legislation/processes_count", using: :btree + add_index "tags", ["legislation/proposals_count"], name: "index_tags_on_legislation/proposals_count", using: :btree add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree add_index "tags", ["proposals_count"], name: "index_tags_on_proposals_count", using: :btree add_index "tags", ["spending_proposals_count"], name: "index_tags_on_spending_proposals_count", using: :btree @@ -1105,6 +1146,7 @@ ActiveRecord::Schema.define(version: 20171017221546) do add_foreign_key "identities", "users" add_foreign_key "images", "users" add_foreign_key "legislation_draft_versions", "legislation_processes" + add_foreign_key "legislation_proposals", "legislation_processes" add_foreign_key "locks", "users" add_foreign_key "managers", "users" add_foreign_key "moderators", "users" From 62b1998ec6ccbb4e9e5571ae044d1bc4deb4883d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Fri, 20 Oct 2017 18:45:34 +0200 Subject: [PATCH 02/11] Added `results_enabled` and `stats_enabled` to Poll admin form --- app/controllers/admin/poll/polls_controller.rb | 7 ++++--- app/models/poll.rb | 8 ++++++++ app/views/admin/poll/polls/_form.html.erb | 9 +++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/poll/polls_controller.rb b/app/controllers/admin/poll/polls_controller.rb index 5103275fb..b146f66cc 100644 --- a/app/controllers/admin/poll/polls_controller.rb +++ b/app/controllers/admin/poll/polls_controller.rb @@ -54,9 +54,10 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController end def poll_params - params.require(:poll).permit(:name, :starts_at, :ends_at, :geozone_restricted, :summary, :description, - geozone_ids: [], - image_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]) + params.require(:poll).permit(:name, :starts_at, :ends_at, :geozone_restricted, + :summary, :description, :results_enabled,:stats_enabled, + geozone_ids: [], + image_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]) end def search_params diff --git a/app/models/poll.rb b/app/models/poll.rb index 27125d8a1..e1a1c2754 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -90,4 +90,12 @@ class Poll < ActiveRecord::Base end end + def results_enabled? + results_enabled + end + + def stats_enabled? + stats_enabled + end + end diff --git a/app/views/admin/poll/polls/_form.html.erb b/app/views/admin/poll/polls/_form.html.erb index aff19d9d7..21f1a97f3 100644 --- a/app/views/admin/poll/polls/_form.html.erb +++ b/app/views/admin/poll/polls/_form.html.erb @@ -53,6 +53,15 @@ +
+
+ <%= t('admin.polls.new.show_results_and_stats') %> + <%= f.check_box :results_enabled, checked: @poll.results_enabled?, label: t('admin.polls.new.show_results') %> + <%= f.check_box :stats_enabled, checked: @poll.stats_enabled?, label: t('admin.polls.new.show_stats') %> +

<%= t('admin.polls.new.results_and_stats_reminder') %> +

+
+
<%= f.submit t("admin.polls.#{admin_submit_action(@poll)}.submit_button"), From b64ef9f68972fef5518b08a321fd25813f6f2203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Fri, 20 Oct 2017 18:45:43 +0200 Subject: [PATCH 03/11] New translations --- config/locales/en/admin.yml | 4 ++++ config/locales/es/admin.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 38abe6f56..084a0443c 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -560,6 +560,10 @@ en: geozone_restricted: "Restricted to districts" new: title: "New poll" + show_results_and_stats: "Show results and stats" + show_results: "Show results" + show_stats: "Show stats" + results_and_stats_reminder: "Marking these checkboxes the results and/or stats of this poll will be publicly available and every user will see them." submit_button: "Create poll" edit: title: "Edit poll" diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 3336cdc5b..c13292f89 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -560,6 +560,10 @@ es: geozone_restricted: "Restringida a los distritos" new: title: "Nueva votación" + show_results_and_stats: "Mostrar resultados y estadísticas" + show_results: "Mostrar resultados" + show_stats: "Mostrar estadísticas" + results_and_stats_reminder: "Si marcas estas casillas los resultados y/o estadísticas de esta votación serán públicos y podrán verlos todos los usuarios." submit_button: "Crear votación" edit: title: "Editar votación" From 8ee35df35f5743b958f7d45ea3658b3dd88df672 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 20 Oct 2017 20:56:01 +0200 Subject: [PATCH 04/11] changes poll title link if results or stats are enabled --- app/views/polls/_poll_group.html.erb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/app/views/polls/_poll_group.html.erb b/app/views/polls/_poll_group.html.erb index 529e9a99e..9d83d5233 100644 --- a/app/views/polls/_poll_group.html.erb +++ b/app/views/polls/_poll_group.html.erb @@ -19,11 +19,27 @@
<% if poll.questions.count == 1 %> <% poll.questions.each do |question| %> -

<%= link_to question.title, poll %>

+

+ <% if poll.results_enabled? %> + <%= link_to question.title, poll_results_path(poll) %> + <% elsif poll.stats_enabled? %> + <%= link_to question.title, poll_stats_path(poll) %> + <% else %> + <%= link_to question.title, poll %> + <% end %> +

<%= poll_dates(poll) %> <% end %> <% else %> -

<%= link_to poll.name, poll %>

+

+ <% if poll.results_enabled? %> + <%= link_to poll.name, poll_results_path(poll) %> + <% elsif poll.stats_enabled? %> + <%= link_to poll.name, poll_stats_path(poll) %> + <% else %> + <%= link_to poll.name, poll %> + <% end %> +

<%= poll_dates(poll) %>
    <% poll.questions.each do |question| %> From d21f0aa8a1427e25a7299f8984e89c27bdff8509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Fri, 20 Oct 2017 21:11:54 +0200 Subject: [PATCH 05/11] Hide results and stats from poll create form --- app/views/admin/poll/polls/_form.html.erb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/views/admin/poll/polls/_form.html.erb b/app/views/admin/poll/polls/_form.html.erb index 21f1a97f3..4926e28ac 100644 --- a/app/views/admin/poll/polls/_form.html.erb +++ b/app/views/admin/poll/polls/_form.html.erb @@ -53,14 +53,16 @@
-
-
- <%= t('admin.polls.new.show_results_and_stats') %> - <%= f.check_box :results_enabled, checked: @poll.results_enabled?, label: t('admin.polls.new.show_results') %> - <%= f.check_box :stats_enabled, checked: @poll.stats_enabled?, label: t('admin.polls.new.show_stats') %> -

<%= t('admin.polls.new.results_and_stats_reminder') %> -

-
+ <% if controller_name == "polls" && action_name == "edit" %> +
+
+ <%= t('admin.polls.new.show_results_and_stats') %> + <%= f.check_box :results_enabled, checked: @poll.results_enabled?, label: t('admin.polls.new.show_results') %> + <%= f.check_box :stats_enabled, checked: @poll.stats_enabled?, label: t('admin.polls.new.show_stats') %> +

<%= t('admin.polls.new.results_and_stats_reminder') %> +

+
+ <% end %>
From 70713e08c3469965bb2930404743486b88a78d5b Mon Sep 17 00:00:00 2001 From: decabeza Date: Sat, 21 Oct 2017 18:25:30 +0200 Subject: [PATCH 06/11] adds missing space --- app/controllers/admin/poll/polls_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/poll/polls_controller.rb b/app/controllers/admin/poll/polls_controller.rb index b146f66cc..0860e8518 100644 --- a/app/controllers/admin/poll/polls_controller.rb +++ b/app/controllers/admin/poll/polls_controller.rb @@ -55,7 +55,7 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController def poll_params params.require(:poll).permit(:name, :starts_at, :ends_at, :geozone_restricted, - :summary, :description, :results_enabled,:stats_enabled, + :summary, :description, :results_enabled, :stats_enabled, geozone_ids: [], image_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]) end From f8e5f791b34154767c3d93cccd1d5d6e18e65e4b Mon Sep 17 00:00:00 2001 From: decabeza Date: Sat, 21 Oct 2017 18:25:58 +0200 Subject: [PATCH 07/11] adds missing p close tag --- app/views/admin/poll/polls/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/poll/polls/_form.html.erb b/app/views/admin/poll/polls/_form.html.erb index 4926e28ac..c0439af7b 100644 --- a/app/views/admin/poll/polls/_form.html.erb +++ b/app/views/admin/poll/polls/_form.html.erb @@ -59,7 +59,7 @@ <%= t('admin.polls.new.show_results_and_stats') %> <%= f.check_box :results_enabled, checked: @poll.results_enabled?, label: t('admin.polls.new.show_results') %> <%= f.check_box :stats_enabled, checked: @poll.stats_enabled?, label: t('admin.polls.new.show_stats') %> -

<%= t('admin.polls.new.results_and_stats_reminder') %> +

<%= t('admin.polls.new.results_and_stats_reminder') %>

<% end %> From 6b5c29f23ec2429119fe7dc63e5d4922460bd896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Mon, 23 Oct 2017 12:25:51 +0200 Subject: [PATCH 08/11] Added tests --- spec/features/admin/poll/polls_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/features/admin/poll/polls_spec.rb b/spec/features/admin/poll/polls_spec.rb index 2a2d26ea5..8180a89f2 100644 --- a/spec/features/admin/poll/polls_spec.rb +++ b/spec/features/admin/poll/polls_spec.rb @@ -60,6 +60,10 @@ feature 'Admin polls' do fill_in 'poll_ends_at', with: end_date.strftime("%d/%m/%Y") fill_in 'poll_summary', with: "Upcoming poll's summary. This poll..." fill_in 'poll_description', with: "Upcomming poll's description. This poll..." + + expect(page).to_not have_css("#poll_results_enabled") + expect(page).to_not have_css("#poll_stats_enabled") + click_button "Create poll" expect(page).to have_content "Poll created successfully" @@ -79,6 +83,9 @@ feature 'Admin polls' do expect(page).to have_css("img[alt='#{poll.image.title}']") + expect(page).to have_css("#poll_results_enabled") + expect(page).to have_css("#poll_stats_enabled") + fill_in "poll_name", with: "Next Poll" fill_in 'poll_ends_at', with: end_date.strftime("%d/%m/%Y") From fad5841d8ff501279d4193c81ae3e5876339ae96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Mon, 23 Oct 2017 12:57:41 +0200 Subject: [PATCH 09/11] Improvements --- app/models/poll.rb | 8 ------- db/schema.rb | 52 ++++++---------------------------------------- 2 files changed, 6 insertions(+), 54 deletions(-) diff --git a/app/models/poll.rb b/app/models/poll.rb index e1a1c2754..27125d8a1 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -90,12 +90,4 @@ class Poll < ActiveRecord::Base end end - def results_enabled? - results_enabled - end - - def stats_enabled? - stats_enabled - end - end diff --git a/db/schema.rb b/db/schema.rb index f8dd19c13..506153b6a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -486,10 +486,6 @@ ActiveRecord::Schema.define(version: 20171020163240) do t.boolean "draft_publication_enabled", default: false t.boolean "result_publication_enabled", default: false t.boolean "published", default: true - t.date "proposals_phase_start_date" - t.date "proposals_phase_end_date" - t.boolean "proposals_phase_enabled" - t.text "proposals_description" end add_index "legislation_processes", ["allegations_end_date"], name: "index_legislation_processes_on_allegations_end_date", using: :btree @@ -502,36 +498,6 @@ ActiveRecord::Schema.define(version: 20171020163240) do add_index "legislation_processes", ["result_publication_date"], name: "index_legislation_processes_on_result_publication_date", using: :btree add_index "legislation_processes", ["start_date"], name: "index_legislation_processes_on_start_date", using: :btree - create_table "legislation_proposals", force: :cascade do |t| - t.integer "legislation_process_id" - t.string "title", limit: 80 - t.text "description" - t.string "question" - t.string "external_url" - t.integer "author_id" - t.datetime "hidden_at" - t.integer "flags_count", default: 0 - t.datetime "ignored_flag_at" - t.integer "cached_votes_up", default: 0 - t.integer "comments_count", default: 0 - t.datetime "confirmed_hide_at" - t.integer "hot_score", limit: 8, default: 0 - t.integer "confidence_score", default: 0 - t.string "responsible_name", limit: 60 - t.text "summary" - t.string "video_url" - t.tsvector "tsv" - t.integer "geozone_id" - t.datetime "retired_at" - t.string "retired_reason" - t.text "retired_explanation" - t.integer "community_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - - add_index "legislation_proposals", ["legislation_process_id"], name: "index_legislation_proposals_on_legislation_process_id", using: :btree - create_table "legislation_question_options", force: :cascade do |t| t.integer "legislation_question_id" t.string "value" @@ -700,7 +666,6 @@ ActiveRecord::Schema.define(version: 20171020163240) do t.text "description" t.integer "question_id" t.integer "given_order", default: 1 - t.boolean "most_voted", default: false end add_index "poll_question_answers", ["question_id"], name: "index_poll_question_answers_on_question_id", using: :btree @@ -955,20 +920,16 @@ ActiveRecord::Schema.define(version: 20171020163240) do add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree create_table "tags", force: :cascade do |t| - t.string "name", limit: 40 - t.integer "taggings_count", default: 0 - t.integer "debates_count", default: 0 - t.integer "proposals_count", default: 0 - t.integer "spending_proposals_count", default: 0 + t.string "name", limit: 40 + t.integer "taggings_count", default: 0 + t.integer "debates_count", default: 0 + t.integer "proposals_count", default: 0 + t.integer "spending_proposals_count", default: 0 t.string "kind" - t.integer "budget/investments_count", default: 0 - t.integer "legislation/proposals_count", default: 0 - t.integer "legislation/processes_count", default: 0 + t.integer "budget/investments_count", default: 0 end add_index "tags", ["debates_count"], name: "index_tags_on_debates_count", using: :btree - add_index "tags", ["legislation/processes_count"], name: "index_tags_on_legislation/processes_count", using: :btree - add_index "tags", ["legislation/proposals_count"], name: "index_tags_on_legislation/proposals_count", using: :btree add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree add_index "tags", ["proposals_count"], name: "index_tags_on_proposals_count", using: :btree add_index "tags", ["spending_proposals_count"], name: "index_tags_on_spending_proposals_count", using: :btree @@ -1146,7 +1107,6 @@ ActiveRecord::Schema.define(version: 20171020163240) do add_foreign_key "identities", "users" add_foreign_key "images", "users" add_foreign_key "legislation_draft_versions", "legislation_processes" - add_foreign_key "legislation_proposals", "legislation_processes" add_foreign_key "locks", "users" add_foreign_key "managers", "users" add_foreign_key "moderators", "users" From b1e91cdc03acf3072d6d5b27c8d14965d2d0cb53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Mon, 23 Oct 2017 12:57:52 +0200 Subject: [PATCH 10/11] Tests improvements --- spec/features/admin/poll/polls_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/features/admin/poll/polls_spec.rb b/spec/features/admin/poll/polls_spec.rb index 8180a89f2..210b2ff6a 100644 --- a/spec/features/admin/poll/polls_spec.rb +++ b/spec/features/admin/poll/polls_spec.rb @@ -88,12 +88,20 @@ feature 'Admin polls' do fill_in "poll_name", with: "Next Poll" fill_in 'poll_ends_at', with: end_date.strftime("%d/%m/%Y") + check 'poll_results_enabled' + check 'poll_stats_enabled' click_button "Update poll" expect(page).to have_content "Poll updated successfully" expect(page).to have_content "Next Poll" expect(page).to have_content I18n.l(end_date.to_date) + + click_link "Edit poll" + + expect(page).to have_field('poll_results_enabled', checked: true) + expect(page).to have_field('poll_stats_enabled', checked: true) + end scenario 'Edit from index' do From f38f333fe55288919254f0c6412de2a90b632757 Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 23 Oct 2017 13:02:37 +0200 Subject: [PATCH 11/11] undo changes on poll title links --- app/views/polls/_poll_group.html.erb | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/app/views/polls/_poll_group.html.erb b/app/views/polls/_poll_group.html.erb index 9d83d5233..529e9a99e 100644 --- a/app/views/polls/_poll_group.html.erb +++ b/app/views/polls/_poll_group.html.erb @@ -19,27 +19,11 @@
<% if poll.questions.count == 1 %> <% poll.questions.each do |question| %> -

- <% if poll.results_enabled? %> - <%= link_to question.title, poll_results_path(poll) %> - <% elsif poll.stats_enabled? %> - <%= link_to question.title, poll_stats_path(poll) %> - <% else %> - <%= link_to question.title, poll %> - <% end %> -

+

<%= link_to question.title, poll %>

<%= poll_dates(poll) %> <% end %> <% else %> -

- <% if poll.results_enabled? %> - <%= link_to poll.name, poll_results_path(poll) %> - <% elsif poll.stats_enabled? %> - <%= link_to poll.name, poll_stats_path(poll) %> - <% else %> - <%= link_to poll.name, poll %> - <% end %> -

+

<%= link_to poll.name, poll %>

<%= poll_dates(poll) %>
    <% poll.questions.each do |question| %>