From 20a86063b744bb4899d8783547232e3c663acca0 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 30 Jan 2017 20:56:07 +0100 Subject: [PATCH 1/6] removes reasons for not answering on poll index --- app/views/polls/index.html.erb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/polls/index.html.erb b/app/views/polls/index.html.erb index e23fc81ee..85b2040b6 100644 --- a/app/views/polls/index.html.erb +++ b/app/views/polls/index.html.erb @@ -31,8 +31,7 @@ <% if can? :answer, poll %> <%= link_to t("polls.index.participate_button"), poll, class: "button" %> <% else %> - <%= render 'polls/reasons_for_not_answering', poll: poll %> - <%= link_to t("polls.index.view_button"), poll, class: "button info small" %> + <%= link_to t("polls.index.view_button"), poll %> <% end %> From 88b5a491e810956313c1109172f1aa3223361c1e Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 30 Jan 2017 20:56:50 +0100 Subject: [PATCH 2/6] adds link to poll on poll name in poll index --- app/views/polls/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/polls/index.html.erb b/app/views/polls/index.html.erb index 85b2040b6..d3c7a8031 100644 --- a/app/views/polls/index.html.erb +++ b/app/views/polls/index.html.erb @@ -19,7 +19,7 @@
-

<%= poll.name %>

+

<%= link_to poll.name, poll %>

<%= poll_dates(poll) %>

    <% poll.geozones.each do |g| %> From 5022bd7bf3085794e8318d92b082af7b383d02d7 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 30 Jan 2017 20:57:18 +0100 Subject: [PATCH 3/6] changes back link on polls show --- app/views/polls/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index c5613e580..16698382b 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -4,7 +4,7 @@
    - <%= render "shared/back_link" %> + <%= back_link_to polls_path %>

    <%= @poll.name %>

    From 692ebe88936861b77164263dba12f6b40789052d Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 30 Jan 2017 21:08:35 +0100 Subject: [PATCH 4/6] moves button to header, removes answers on questions show --- app/assets/stylesheets/participation.scss | 9 +++++++ app/views/polls/questions/show.html.erb | 29 +++++++---------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 30d576930..683556229 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -1317,6 +1317,15 @@ ul.ballot-list { color: #92BA48; } + .button { + background: white; + color: $brand; + } + + .callout.warning a { + color: $color-warning; + } + .info { background: #314253; padding: $line-height; diff --git a/app/views/polls/questions/show.html.erb b/app/views/polls/questions/show.html.erb index 52b8e3774..018f3b986 100644 --- a/app/views/polls/questions/show.html.erb +++ b/app/views/polls/questions/show.html.erb @@ -12,6 +12,14 @@ <%= link_to t('poll_questions.show.original_proposal'), @question.proposal %>

    <% end %> + + <% if can? :answer, @question %> + <%= link_to t('poll_questions.show.answer_this_question'), + @question.poll, + class: 'large button' %> + <% else %> + <%= render 'polls/reasons_for_not_answering', poll: @question.poll %> + <% end %>
    @@ -42,27 +50,6 @@
    -
    -
    - <% if can? :answer, @question %> -
    - <%= link_to t('poll_questions.show.answer_this_question'), - @question.poll, - class: 'large button' - %> -
    - <% else %> - <%= render 'polls/reasons_for_not_answering', poll: @question.poll %> - -
    -
    - <%= render "answers", question: @question %> -
    -
    - <% end %> -
    -
    -

    <%= t('poll_questions.show.more_info') %>

    From f3842e70d7b634d74e1220f6e263ba711637a5ac Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 30 Jan 2017 21:08:54 +0100 Subject: [PATCH 5/6] fixes styles on callouts --- app/views/polls/_reasons_for_not_answering.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/polls/_reasons_for_not_answering.html.erb b/app/views/polls/_reasons_for_not_answering.html.erb index 374d319d9..bd0bab3ad 100644 --- a/app/views/polls/_reasons_for_not_answering.html.erb +++ b/app/views/polls/_reasons_for_not_answering.html.erb @@ -1,9 +1,9 @@ <% if poll.incoming? %> -
    +
    <%= t('poll_questions.show.cant_answer_incoming') %>
    <% elsif poll.expired? %> -
    +
    <%= t('poll_questions.show.cant_answer_expired') %>
    <% elsif current_user.nil? %> From b13b27dcaad10206acd0fd7472b09ebf4e586a4b Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 30 Jan 2017 22:06:01 +0100 Subject: [PATCH 6/6] removes answers on polls questions show specs --- spec/features/polls/questions_spec.rb | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/spec/features/polls/questions_spec.rb b/spec/features/polls/questions_spec.rb index 39b60930d..5ccbd33a8 100644 --- a/spec/features/polls/questions_spec.rb +++ b/spec/features/polls/questions_spec.rb @@ -21,12 +21,7 @@ feature 'Poll Questions' do visit question_path(question) - expect(page).to have_content('Han Solo') - expect(page).to have_content('Chewbacca') expect(page).to have_content('You must Sign in or Sign up to participate') - - expect(page).to_not have_link('Han Solo') - expect(page).to_not have_link('Chewbacca') end scenario 'Level 1 users' do @@ -35,12 +30,7 @@ feature 'Poll Questions' do login_as(create(:user, geozone: geozone)) visit question_path(question) - expect(page).to have_content('Han Solo') - expect(page).to have_content('Chewbacca') expect(page).to have_content('You must verify your account in order to answer') - - expect(page).to_not have_link('Han Solo') - expect(page).to_not have_link('Chewbacca') end scenario 'Level 2 users in an poll question for a geozone which is not theirs' do @@ -51,10 +41,7 @@ feature 'Poll Questions' do login_as(create(:user, :level_two, geozone: geozone)) visit question_path(question) - expect(page).to have_content('Vader') - expect(page).to have_content('Palpatine') - expect(page).to_not have_link('Vader') - expect(page).to_not have_link('Palpatine') + expect(page).to have_content('This question is not available on your geozone') end scenario 'Level 2 users who can answer' do