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/_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? %> diff --git a/app/views/polls/index.html.erb b/app/views/polls/index.html.erb index e23fc81ee..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| %> @@ -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 %>
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') %>

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 %>

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