Merge pull request #1379 from consul/polls-polish

polls polish
This commit is contained in:
Raimond Garcia
2017-01-30 22:21:42 +01:00
committed by GitHub
6 changed files with 23 additions and 41 deletions

View File

@@ -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;

View File

@@ -1,9 +1,9 @@
<% if poll.incoming? %>
<div class="callout alert">
<div class="callout primary">
<%= t('poll_questions.show.cant_answer_incoming') %>
</div>
<% elsif poll.expired? %>
<div class="callout primary">
<div class="callout alert">
<%= t('poll_questions.show.cant_answer_expired') %>
</div>
<% elsif current_user.nil? %>

View File

@@ -19,7 +19,7 @@
<div class="poll">
<div class="row">
<div class="small-12 medium-6 column">
<h3><%= poll.name %></h3>
<h3><%= link_to poll.name, poll %></h3>
<p class="dates"><%= poll_dates(poll) %></p>
<ul class="no-bullet margin-top tags">
<% 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 %>
</div>
</div>

View File

@@ -12,6 +12,14 @@
<%= link_to t('poll_questions.show.original_proposal'), @question.proposal %>
</div>
<% 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 %>
</div>
<div class="small-12 medium-3 column info">
@@ -42,27 +50,6 @@
</div>
</div>
<div class="row margin-top">
<div class="small-12 column">
<% if can? :answer, @question %>
<div class="text-center">
<%= link_to t('poll_questions.show.answer_this_question'),
@question.poll,
class: 'large button'
%>
</div>
<% else %>
<%= render 'polls/reasons_for_not_answering', poll: @question.poll %>
<div class="small-12 small-centered text-center column">
<div id="<%= dom_id(@question) %>_answers">
<%= render "answers", question: @question %>
</div>
</div>
<% end %>
</div>
</div>
<div class="row margin-top">
<div class="small-12 medium-9 column">
<h3><%= t('poll_questions.show.more_info') %></h3>

View File

@@ -4,7 +4,7 @@
<div class="expanded no-margin-top dark-heading poll-show">
<div class="row">
<div class="small-12 medium-9 column padding">
<%= render "shared/back_link" %>
<%= back_link_to polls_path %>
<h2><%= @poll.name %></h2>
<p>

View File

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