moves table content to partials

This commit is contained in:
decabeza
2017-10-13 14:40:39 +02:00
parent f94a376392
commit 6b721e7750
3 changed files with 26 additions and 24 deletions

View File

@@ -0,0 +1,8 @@
<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>

View File

@@ -0,0 +1,16 @@
<td class="text-center">
<p class="callout success">
<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 %>
</td>

View File

@@ -18,31 +18,9 @@
<%= poll.name %>
</td>
<% if poll.votable_by?(@user) %>
<td class="text-center">
<p class="callout success">
<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 %>
</td>
<%= render "can_vote", poll: poll %>
<% 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>
<%= render "already_voted" %>
<% end %>
</tr>
<% end %>