tweaks admin/polls pages and specs
This commit is contained in:
@@ -12,12 +12,25 @@
|
||||
<thead>
|
||||
<th><%= t("admin.polls.show.name") %></th>
|
||||
<th><%= t("admin.polls.show.location") %></th>
|
||||
<th><%= t("admin.polls.show.officers") %></th>
|
||||
<th> </th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @poll.booths.each do |booth| %>
|
||||
<%= render partial: "admin/poll/booths/booth", locals: { booth: booth } %>
|
||||
<tr id="booth_<%= booth.id %>" class="booth">
|
||||
<td>
|
||||
<strong>
|
||||
<%= link_to booth.name, admin_booth_path(booth) %>
|
||||
</strong>
|
||||
</td>
|
||||
<td>
|
||||
<%= booth.location %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<%= link_to t("admin.polls.show.remove_booth"),
|
||||
"#",
|
||||
class: "button hollow alert" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<div class="small-12 column">
|
||||
<% if @poll.officers.empty? %>
|
||||
<div class="callout primary text-center">
|
||||
<%= t("admin.polls.show.no_booths") %>
|
||||
<%= t("admin.polls.show.no_officers") %>
|
||||
</div>
|
||||
<% else %>
|
||||
|
||||
<h2><%= t("admin.polls.show.booths_title") %></h2>
|
||||
<h2><%= t("admin.polls.show.officers_title") %></h2>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
|
||||
@@ -3,27 +3,28 @@
|
||||
<%= link_to "Añadir pregunta",
|
||||
new_admin_question_path(poll_id: @poll.id),
|
||||
class: "button success" %>
|
||||
|
||||
<% if @poll.questions.empty? %>
|
||||
<div class="callout primary text-center">
|
||||
<%= t('admin.polls.show.no_questions') %>
|
||||
</div>
|
||||
<% else %>
|
||||
<table>
|
||||
<% @poll.questions.each do |question| %>
|
||||
<tr id="<%= dom_id(question) %>">
|
||||
<td><%= link_to question.title, admin_question_path(question) %></td>
|
||||
<td class="text-right">
|
||||
<%= link_to t('shared.edit'),
|
||||
edit_admin_question_path(question),
|
||||
class: "button hollow" %>
|
||||
<%= link_to t('shared.delete'),
|
||||
admin_question_path(question),
|
||||
class: "button hollow alert",
|
||||
method: :delete %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if @poll.questions.count == 0 %>
|
||||
<div class="callout primary text-center">
|
||||
<%= t('admin.questions.index.no_questions') %>
|
||||
</div>
|
||||
<% else %>
|
||||
<table>
|
||||
<% @poll.questions.each do |question| %>
|
||||
<tr id="<%= dom_id(question) %>">
|
||||
<td><%= link_to question.title, admin_question_path(question) %></td>
|
||||
<td class="text-right">
|
||||
<%= link_to t('shared.edit'),
|
||||
edit_admin_question_path(question),
|
||||
class: "button hollow" %>
|
||||
<%= link_to t('shared.delete'),
|
||||
admin_question_path(question),
|
||||
class: "button hollow alert",
|
||||
method: :delete %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user