moves table content to partials
This commit is contained in:
8
app/views/officing/voters/_already_voted.html.erb
Normal file
8
app/views/officing/voters/_already_voted.html.erb
Normal 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>
|
||||
16
app/views/officing/voters/_can_vote.html.erb
Normal file
16
app/views/officing/voters/_can_vote.html.erb
Normal 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>
|
||||
@@ -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 %>
|
||||
|
||||
Reference in New Issue
Block a user