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) %> <%= link_to @question.author.name, user_path(@question.author) %>
</p> </p>
<table> <table cellspacing="0" cellpadding="0">
<tr> <thead>
<th colspan="1" scope="colgroup"> <tr>
<%= t('admin.questions.show.valid_answers') %> <th colspan="1" scope="col">
</th> <%= t('admin.questions.show.valid_answers') %>
<th colspan="1" scope="colgroup"> </th>
<%= link_to t("admin.questions.show.add_answer"), <th colspan="2" scope="col">
new_admin_question_answer_path(@question), <%= link_to t("admin.questions.show.add_answer"),
class: "button hollow float-right" %> new_admin_question_answer_path(@question),
</th> class: "button hollow float-right" %>
</tr> </th>
<tr>
<th scope="col"><%= t("admin.questions.show.answers.title") %></th>
<th scope="col"><%= t("admin.questions.show.answers.description") %></th>
</tr>
<% @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> </tr>
<% end %>
<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>
<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> </table>
<% if @question.video_url.present? %> <% if @question.video_url.present? %>

View File

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

View File

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

View File

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