This way it will be easier to change the behavior of all table actions, like adding ARIA attributes. In the past, when we changed the behavior of the `link_to` method, we had to change all table action classes.
39 lines
1.1 KiB
Plaintext
39 lines
1.1 KiB
Plaintext
<%= render Admin::Poll::Questions::FilterComponent.new(@polls) %>
|
|
|
|
<% if @questions.count == 0 %>
|
|
<div class="callout primary margin-top">
|
|
<%= t("admin.questions.index.no_questions") %>
|
|
</div>
|
|
<% else %>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th><%= t("admin.questions.index.table_question") %></th>
|
|
<th><%= t("admin.questions.index.table_poll") %></th>
|
|
<th><%= t("admin.actions.actions") %></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% @questions.each do |question| %>
|
|
<tr id="<%= dom_id(question) %>">
|
|
<td><%= question.title %></td>
|
|
<td>
|
|
<% if question.poll.present? %>
|
|
<%= question.poll.name %>
|
|
<% else %>
|
|
<em><%= t("admin.questions.index.poll_not_assigned") %></em>
|
|
<% end %>
|
|
</td>
|
|
<td>
|
|
<%= render Admin::TableActionsComponent.new(question) do |actions| %>
|
|
<%= actions.action(:answers, text: t("admin.polls.show.edit_answers")) %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<%= paginate @questions %>
|
|
<% end %>
|