Merge branch 'master' into aperez-edit-poll-question-answers

This commit is contained in:
Raimond Garcia
2017-10-06 18:47:04 +02:00
committed by GitHub
14 changed files with 122 additions and 26 deletions

View File

@@ -21,7 +21,7 @@
<tbody>
<% @officer_assignments.each do |officer_assignment| %>
<tr id="<%= dom_id officer_assignment %>">
<td><%= officer_assignment.final? ? t('polls.final_date') : l(officer_assignment.date.to_date) %></td>
<td><%= l(officer_assignment.date.to_date)%> <%= content_tag :strong, t('polls.final_date') if officer_assignment.final %></td>
<td><%= booth_name_with_location(officer_assignment.booth_assignment.booth) %></td>
</tr>
<% end %>

View File

@@ -12,7 +12,7 @@
ckeditor: { language: I18n.locale } %>
</div>
<div class="small-12 medium-6 large-4">
<div class="small-12 medium-6 large-4 margin-top">
<%= f.submit(class: "button expanded", value: t("shared.save")) %>
</div>

View File

@@ -0,0 +1,55 @@
<%= back_link_to %>
<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">
<%= form_for(Poll::Question::Answer.new,
url: admin_answer_path(@answer),
method: :put) do |f| %>
<%= render 'shared/errors', resource: @answer %>
<div class="row">
<div class="small-12 column">
<div class="documents small-12">
<%= render 'documents/nested_documents', documentable: @answer, f: f %>
</div>
<div class="row">
<div class="actions small-12 medium-4 margin-top">
<%= f.submit(class: "button expanded", value: t("shared.save")) %>
</div>
</div>
</div>
</div>
<% end %>
<% if @answer.documents.present? %>
<table>
<tr>
<th scope="col"><%= t("admin.questions.show.answers.document_title") %></th>
<th scope="col" class="text-right"><%= t("admin.questions.show.answers.document_actions") %></th>
</tr>
<% @answer.documents.each do |document| %>
<tr>
<td>
<%= link_to document.title, document.attachment.url %>
</td>
<td class="text-right">
<%= link_to t('documents.buttons.download_document'),
document.attachment.url,
target: "_blank",
rel: "nofollow",
class: 'button hollow' %>
</td>
</tr>
<% end %>
</table>
<% end %>
</div>

View File

@@ -31,7 +31,7 @@
<table class="margin-top">
<tr>
<th colspan="3" class="with-button">
<th colspan="5" 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,9 +41,10 @@
<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><%= t("admin.questions.show.answers.videos") %></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>
<th scope="col" class="text-center"><%= t("admin.questions.show.answers.videos") %></th>
</tr>
<% @question.question_answers.each do |answer| %>
@@ -51,12 +52,22 @@
<td><%= link_to answer.title, admin_answer_path(answer) %></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><%= link_to t("admin.questions.show.answers.video_list",
count: answer.videos.count),
admin_answer_videos_path(answer) %></td>
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_answer_documents_path(answer) %>
</td>
<td class="text-center">
<%= link_to t("admin.questions.show.answers.video_list",
count: answer.videos.count),
admin_answer_videos_path(answer) %>
</td>
</tr>
<% end %>
</table>