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.2 KiB
Plaintext
39 lines
1.2 KiB
Plaintext
<h3 class="inline-block"><%= t("admin.polls.show.questions_title") %></h3>
|
|
|
|
<%= link_to t("admin.questions.index.create"), new_admin_question_path(poll_id: @poll.id),
|
|
class: "button float-right" %>
|
|
|
|
<% if @poll.questions.empty? %>
|
|
<div class="callout primary margin-top">
|
|
<%= t("admin.polls.show.no_questions") %>
|
|
</div>
|
|
<% else %>
|
|
<table class="margin">
|
|
<thead>
|
|
<tr>
|
|
<th><%= t("admin.polls.show.table_title") %></th>
|
|
<th><%= t("admin.actions.actions") %></th>
|
|
</tr>
|
|
</thead>
|
|
<% @poll.questions.each do |question| %>
|
|
<tr id="<%= dom_id(question) %>">
|
|
<td>
|
|
<strong><%= question.title %></strong>
|
|
<% if question.proposal.present? %>
|
|
<small>
|
|
<%= link_to t("admin.polls.show.see_proposal"),
|
|
proposal_path(question.proposal),
|
|
target: "_blank" %>
|
|
</small>
|
|
<% end %>
|
|
</td>
|
|
<td>
|
|
<%= render Admin::TableActionsComponent.new(question) do |actions| %>
|
|
<%= actions.action(:answers, text: t("admin.polls.show.edit_answers")) %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</table>
|
|
<% end %>
|