Adapt Admin::Poll::Question 'show' action to new design

Changes required as per issues #1855 and #1951

Fixes PR #1977, note n° 2
This commit is contained in:
Angel Perez
2017-10-04 16:59:23 -04:00
parent a83c259a04
commit f4774894e7
4 changed files with 40 additions and 27 deletions

View File

@@ -24,29 +24,35 @@
<%= link_to @question.author.name, user_path(@question.author) %>
</p>
<table>
<tr>
<th colspan="1" scope="colgroup">
<%= t('admin.questions.show.valid_answers') %>
</th>
<th colspan="1" scope="colgroup">
<%= link_to t("admin.questions.show.add_answer"),
new_admin_question_answer_path(@question),
class: "button hollow float-right" %>
</th>
</tr>
<table cellspacing="0" cellpadding="0">
<thead>
<tr>
<th colspan="1" scope="col">
<%= t('admin.questions.show.valid_answers') %>
</th>
<th colspan="2" scope="col">
<%= link_to t("admin.questions.show.add_answer"),
new_admin_question_answer_path(@question),
class: "button hollow float-right" %>
</th>
</tr>
<tr>
<th scope="col"><%= t("admin.questions.show.answers.title") %></th>
<th scope="col"><%= t("admin.questions.show.answers.description") %></th>
</tr>
<tr>
<th scope="col"><%= t("admin.questions.show.answers.title") %></th>
<th scope="col"><%= t("admin.questions.show.answers.description") %></th>
<th scope="col"><%= t("admin.questions.show.answers.videos") %></th>
</tr>
</thead>
<% @question.question_answers.each do |answer| %>
<tr id="<%= dom_id(answer) %>" class="poll_question_answer">
<th scope="col"><%= answer.title %></th>
<th scope="col"><%= answer.description %></th>
</tr>
<% end %>
<tbody>
<% @question.question_answers.each do |answer| %>
<tr id="<%= dom_id(answer) %>" class="poll_question_answer">
<td><%= answer.title %></td>
<td><%= answer.description %></td>
<td><%= link_to t("admin.questions.show.answers.video_list", count: 0), "#" %></td>
</tr>
<% end %>
</tbody>
</table>
<% if @question.video_url.present? %>

View File

@@ -592,12 +592,14 @@ en:
author: Author
title: Title
valid_answers: Valid answers
add_answer: "Add answer"
add_answer: Add answer
video_url: External video
documents: Documents (1)
answers:
title: Answer
description: Description
videos: Videos
video_list: Video list (%{count})
answers:
new:
title: "New answer"

View File

@@ -592,14 +592,15 @@ es:
author: Autor
title: Título
valid_answers: Respuestas válidas
add_answer: "Añadir respuesta"
description: Descripción
add_answer: Añadir respuesta
video_url: Video externo
documents: Documentos (1)
preview: Ver en la web
answers:
title: Respuesta
description: Descripción
videos: Vídeos
video_list: Lista de vídeos (%{count})
answers:
new:
title: "Nueva respuesta"

View File

@@ -382,10 +382,14 @@ fr:
author: Auteur
title: Titre
valid_answers: Réponses valides
add_answer: "Ajouter une réponse"
answer: "Réponse"
description: Description
add_answer: Ajouter une réponse
documents: Documents (1)
preview: Voir l'aperçu
answers:
title: Réponse
description: Description
videos: Vidéos
video_list: Liste des vidéos (%{count})
answers:
new:
title: "Nouvelle réponse"