Adds poll name on admin poll questions index
This commit is contained in:
@@ -10,14 +10,22 @@
|
|||||||
<table class="fixed">
|
<table class="fixed">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="small-8"><%= t("admin.questions.index.table_question") %></th>
|
<th><%= t("admin.questions.index.table_question") %></th>
|
||||||
<th><%= t("admin.actions.actions") %></th>
|
<th><%= t("admin.questions.index.table_poll") %></th>
|
||||||
|
<th class="small-4"><%= t("admin.actions.actions") %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @questions.each do |question| %>
|
<% @questions.each do |question| %>
|
||||||
<tr id="<%= dom_id(question) %>">
|
<tr id="<%= dom_id(question) %>">
|
||||||
<td><%= link_to question.title, admin_question_path(question) %></td>
|
<td><%= link_to question.title, admin_question_path(question) %></td>
|
||||||
|
<td>
|
||||||
|
<% if question.poll.present? %>
|
||||||
|
<%= question.poll.name %>
|
||||||
|
<% else %>
|
||||||
|
<em><%= t("admin.questions.index.poll_not_assigned") %></em>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="small-6 column">
|
<div class="small-6 column">
|
||||||
<%= link_to t("shared.edit"), edit_admin_question_path(question), class: "button hollow expanded" %>
|
<%= link_to t("shared.edit"), edit_admin_question_path(question), class: "button hollow expanded" %>
|
||||||
|
|||||||
@@ -924,6 +924,8 @@ en:
|
|||||||
create_question: "Create question"
|
create_question: "Create question"
|
||||||
table_proposal: "Proposal"
|
table_proposal: "Proposal"
|
||||||
table_question: "Question"
|
table_question: "Question"
|
||||||
|
table_poll: "Poll"
|
||||||
|
poll_not_assigned: "Poll not assigned"
|
||||||
edit:
|
edit:
|
||||||
title: "Edit Question"
|
title: "Edit Question"
|
||||||
new:
|
new:
|
||||||
|
|||||||
@@ -923,6 +923,8 @@ es:
|
|||||||
create_question: "Crear pregunta para votación"
|
create_question: "Crear pregunta para votación"
|
||||||
table_proposal: "Propuesta"
|
table_proposal: "Propuesta"
|
||||||
table_question: "Pregunta"
|
table_question: "Pregunta"
|
||||||
|
table_poll: "Votación"
|
||||||
|
poll_not_assigned: "Votación no asignada"
|
||||||
edit:
|
edit:
|
||||||
title: "Editar pregunta ciudadana"
|
title: "Editar pregunta ciudadana"
|
||||||
new:
|
new:
|
||||||
|
|||||||
@@ -12,13 +12,22 @@ feature 'Admin poll questions' do
|
|||||||
%w[title]
|
%w[title]
|
||||||
|
|
||||||
scenario 'Index' do
|
scenario 'Index' do
|
||||||
question1 = create(:poll_question)
|
poll1 = create(:poll)
|
||||||
question2 = create(:poll_question)
|
poll2 = create(:poll)
|
||||||
|
question1 = create(:poll_question, poll: poll1)
|
||||||
|
question2 = create(:poll_question, poll: poll2)
|
||||||
|
|
||||||
visit admin_questions_path
|
visit admin_questions_path
|
||||||
|
|
||||||
|
within("#poll_question_#{question1.id}") do
|
||||||
expect(page).to have_content(question1.title)
|
expect(page).to have_content(question1.title)
|
||||||
|
expect(page).to have_content(poll1.name)
|
||||||
|
end
|
||||||
|
|
||||||
|
within("#poll_question_#{question2.id}") do
|
||||||
expect(page).to have_content(question2.title)
|
expect(page).to have_content(question2.title)
|
||||||
|
expect(page).to have_content(poll2.name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Show' do
|
scenario 'Show' do
|
||||||
|
|||||||
Reference in New Issue
Block a user