Improved answer documents and question summary views

This commit is contained in:
María Checa
2017-10-05 15:41:55 +02:00
committed by decabeza
parent 590344a576
commit 284fdea2e6
2 changed files with 15 additions and 6 deletions

View File

@@ -1,8 +1,9 @@
<h4><%= link_to @question.title, admin_question_path(@question) %> > <%= @answer.title %></h4>
<%= back_link_to %>
<h2><%= t("admin.questions.show.answers.documents_list") %></h2>
<p><%= link_to @question.poll.name, admin_poll_path(@question.poll) %> > <%= link_to @question.title, admin_question_path(@question) %> > <%= @answer.title %></p>
<div class="poll-question-answer-form">
<%= form_for(@answer, url: admin_question_answer_path(@question, @answer)) do |f| %>

View File

@@ -31,7 +31,7 @@
<table class="margin-top">
<tr>
<th colspan="3" scope="col" class="with-button">
<th colspan="4" scope="col" class="with-button">
<%= t('admin.questions.show.valid_answers') %>
<%= link_to t("admin.questions.show.add_answer"),
new_admin_question_answer_path(@question),
@@ -41,8 +41,9 @@
<tr>
<th><%= t("admin.questions.show.answers.title") %></th>
<th class="medium-7"><%= t("admin.questions.show.answers.description") %></th>
<th class="text-center"><%= t("admin.questions.show.answers.images") %></th>
<th scope="col" class="medium-7"><%= t("admin.questions.show.answers.description") %></th>
<th scope="col" class="text-center"><%= t("admin.questions.show.answers.images") %></th>
<th scope="col" class="text-center"><%= t("admin.questions.show.answers.documents") %></th>
</tr>
<% @question.question_answers.each do |answer| %>
@@ -50,10 +51,17 @@
<td><%= answer.title %></td>
<td><%= answer.description %></td>
<td class="text-center">
(<%= answer.images.count %>)<br>
(<%= answer.images.count %>)
<br>
<%= link_to t("admin.questions.show.answers.images_list"),
admin_answer_images_path(answer) %>
</td>
<td class="text-center">
(<%= answer.documents.count rescue 0 %>)
<br>
<%= link_to t("admin.questions.show.answers.documents_list"),
admin_question_answer_documents_path(@question, answer) %>
</td>
</tr>
<% end %>
</table>