improves text and layouts for officing voters views

This commit is contained in:
decabeza
2017-10-13 14:16:21 +02:00
parent c097cf236c
commit 386fe785c7
5 changed files with 43 additions and 21 deletions

View File

@@ -605,6 +605,7 @@ table {
.callout { .callout {
height: $line-height * 2; height: $line-height * 2;
line-height: $line-height * 2; line-height: $line-height * 2;
margin: 0;
padding: 0 $line-height / 2; padding: 0 $line-height / 2;
} }
} }

View File

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

View File

@@ -7,7 +7,8 @@
<thead> <thead>
<tr> <tr>
<th><%= t("officing.voters.new.table_poll") %></th> <th><%= t("officing.voters.new.table_poll") %></th>
<th><%= t("officing.voters.new.table_actions") %></th> <th><%= t("officing.voters.new.table_status") %></th>
<th class="text-center"><%= t("officing.voters.new.table_actions") %></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -16,13 +17,33 @@
<td> <td>
<%= poll.name %> <%= poll.name %>
</td> </td>
<td id="actions">
<% if poll.votable_by?(@user) %> <% if poll.votable_by?(@user) %>
<%= render "can_vote", poll: poll %> <td class="text-center">
<% else %> <p class="callout success">
<%= render "already_voted" %> <strong><%= t("officing.voters.show.can_vote") %></strong>
</p>
</td>
<td id="actions" class="text-center">
<%= form_for @user, as: :voter, url: officing_voters_path,
method: :post, remote: true,
html: { id: "new_officing_voter" } do |f| %>
<%= f.hidden_field :poll_id, value: poll.id %>
<%= f.hidden_field :user_id, value: @user.id %>
<%= f.submit t("officing.voters.show.submit"),
class: "button success",
data: { disable_with: t("officing.voters.can_vote.submit_disable_with") } %>
<% end %> <% end %>
</td> </td>
<% else %>
<td>
<p class="callout alert text-center">
<strong><%= t("officing.voters.show.error_already_voted") %></strong>
</p>
</td>
<td class="text-center">
<small><%= t("officing.voters.show.no_actions") %></small>
</td>
<% end %>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

View File

@@ -58,11 +58,13 @@ en:
new: new:
title: Polls title: Polls
table_poll: Poll table_poll: Poll
table_actions: Polls status table_status: Polls status
table_actions: Actions
show: show:
can_vote: Can vote can_vote: Can vote
error_already_voted: Has already participated in this poll error_already_voted: Has already participated in this poll
no_actions: There is no available actions
submit: Confirm vote submit: Confirm vote
success: "Vote introduced!" success: "Vote introduced!"
can_vote: can_vote:
submit_disable_with: "WAIT, confirming vote" submit_disable_with: "Wait, confirming vote..."

View File

@@ -58,11 +58,13 @@ es:
new: new:
title: Votaciones title: Votaciones
table_poll: Votación table_poll: Votación
table_actions: Estado de las votaciones table_status: Estado de las votaciones
table_actions: Acciones
show: show:
can_vote: Puede votar can_vote: Puede votar
error_already_voted: "Ya ha participado en esta votación." error_already_voted: "Ya ha participado en esta votación"
no_actions: No hay acciones disponibles
submit: Confirmar voto submit: Confirmar voto
success: "¡Voto introducido!" success: "¡Voto introducido!"
can_vote: can_vote:
submit_disable_with: "ESPERA, confirmando voto" submit_disable_with: "Espera, confirmando voto..."