Merge pull request #1387 from consul/polls-officer-text

polls officer text
This commit is contained in:
Juanjo Bazán
2017-02-02 13:35:33 +01:00
committed by GitHub
7 changed files with 51 additions and 25 deletions

View File

@@ -508,3 +508,12 @@ table.investment-projects-summary {
color: $color-alert; color: $color-alert;
font-weight: bold; font-weight: bold;
} }
table {
.callout {
height: $line-height*2;
line-height: $line-height*2;
padding: 0 $line-height/2;
}
}

View File

@@ -1,3 +1,7 @@
<div class="callout warning inline-block"> <div class="row">
<%= t("officing.voters.show.error_already_voted") %> <div class="small-12 medium-8 column">
<div class="callout alert text-center">
<strong><%= t("officing.voters.show.error_already_voted") %></strong>
</div>
</div>
</div> </div>

View File

@@ -1,7 +1,14 @@
<div class="small-12 medium-6 large-4"> <div class="row">
<div class="small-12 medium-6 large-4 column">
<div class="callout success text-center">
<strong><%= t("officing.voters.show.can_vote") %></strong>
</div>
</div>
<div class="small-12 medium-6 large-4 column end">
<%= form_for @user, as: :voter, url: officing_voters_path, method: :post, remote: true do |f| %> <%= form_for @user, as: :voter, url: officing_voters_path, method: :post, remote: true do |f| %>
<%= f.hidden_field :poll_id, value: poll.id %> <%= f.hidden_field :poll_id, value: poll.id %>
<%= f.hidden_field :user_id, value: @user.id %> <%= f.hidden_field :user_id, value: @user.id %>
<%= f.submit t("officing.voters.show.submit"), class: "button success expanded" %> <%= f.submit t("officing.voters.show.submit"), class: "button success expanded" %>
<% end %> <% end %>
</div> </div>
</div>

View File

@@ -1,3 +1,7 @@
<div class="callout success"> <div class="row">
<%= t("officing.voters.show.success") %> <div class="small-12 medium-8 column">
<div class="callout primary text-center">
<strong><%= t("officing.voters.show.success") %></strong>
</div>
</div>
</div> </div>

View File

@@ -64,8 +64,9 @@ en:
new: new:
title: Polls title: Polls
table_poll: Poll table_poll: Poll
table_actions: Validate table_actions: Polls status
show: show:
can_vote: Can vote
error_already_voted: Has already participated in this poll error_already_voted: Has already participated in this poll
submit: Validate vote submit: Confirm vote
success: Vote validated successfully. success: "Vote introduced!"

View File

@@ -64,8 +64,9 @@ es:
new: new:
title: Votaciones title: Votaciones
table_poll: Votación table_poll: Votación
table_actions: Validar table_actions: Estado de las votaciones
show: show:
can_vote: Puede votar
error_already_voted: "Ya ha participado en esta votación." error_already_voted: "Ya ha participado en esta votación."
submit: Validar voto submit: Confirmar voto
success: Voto validado correctamente. success: Voto introducido!"

View File

@@ -21,14 +21,14 @@ feature 'Voters' do
expect(page).to have_content "Polls" expect(page).to have_content "Polls"
expect(page).to have_content poll.name expect(page).to have_content poll.name
click_button "Validate vote" click_button "Confirm vote"
expect(page).to have_content "Vote validated successfully" expect(page).to have_content "Vote introduced!"
expect(page).to_not have_button "Validate vote" expect(page).to_not have_button "Confirm vote"
page.evaluate_script("window.location.reload()") page.evaluate_script("window.location.reload()")
expect(page).to have_content "Has already participated in this poll" expect(page).to have_content "Has already participated in this poll"
expect(page).to_not have_button "Validate vote" expect(page).to_not have_button "Confirm vote"
end end
scenario "Already voted", :js do scenario "Already voted", :js do
@@ -42,11 +42,11 @@ feature 'Voters' do
within("#poll_#{poll1.id}") do within("#poll_#{poll1.id}") do
expect(page).to have_content "Has already participated in this poll" expect(page).to have_content "Has already participated in this poll"
expect(page).to_not have_button "Validate vote" expect(page).to_not have_button "Confirm vote"
end end
within("#poll_#{poll2.id}") do within("#poll_#{poll2.id}") do
expect(page).to have_button "Validate vote" expect(page).to have_button "Confirm vote"
end end
end end