We were adding <div> tags with the `images` or `documents` HTML class prettly much every time we rendered a NestedComponent. We're now including the HTML class inside the component, as we usually do. We're also rendering the nested components directly, since it's been a while since the partials were changed to simply render the components.
47 lines
1.3 KiB
Plaintext
47 lines
1.3 KiB
Plaintext
<%= back_link_to admin_question_path(@answer.question) %>
|
|
|
|
<h2><%= t("admin.questions.show.answers.documents_list") %></h2>
|
|
|
|
<ul class="breadcrumbs">
|
|
<li><%= answer.question.title %></li>
|
|
<li><%= answer.title %></li>
|
|
</ul>
|
|
|
|
<div class="poll-question-form">
|
|
<% if can?(:update, @answer) %>
|
|
<%= form_for(Poll::Question::Answer.new, url: admin_answer_documents_path(answer)) do |f| %>
|
|
<%= render "shared/errors", resource: answer %>
|
|
|
|
<%= render Documents::NestedComponent.new(f) %>
|
|
|
|
<div class="small-12 medium-6 large-2">
|
|
<%= f.submit(class: "button expanded", value: t("shared.save")) %>
|
|
</div>
|
|
<% end %>
|
|
<% else %>
|
|
<div class="callout warning">
|
|
<strong><%= t("admin.questions.no_edit") %></strong>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% if documents.present? %>
|
|
<table>
|
|
<tr>
|
|
<th scope="col"><%= t("admin.questions.show.answers.document_title") %></th>
|
|
<th scope="col"><%= t("admin.questions.show.answers.document_actions") %></th>
|
|
</tr>
|
|
|
|
<% documents.each do |document| %>
|
|
<tr>
|
|
<td>
|
|
<%= document.title %>
|
|
</td>
|
|
<td>
|
|
<%= render Admin::Poll::Questions::Answers::Documents::TableActionsComponent.new(document) %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</table>
|
|
<% end %>
|
|
</div>
|