adds admin poll question's show
This commit is contained in:
@@ -17,19 +17,21 @@ class Admin::Poll::QuestionsController < Admin::BaseController
|
|||||||
@question.author = @question.proposal.try(:author) || current_user
|
@question.author = @question.proposal.try(:author) || current_user
|
||||||
|
|
||||||
if @question.save
|
if @question.save
|
||||||
redirect_to question_path(@question)
|
redirect_to admin_question_path(@question)
|
||||||
else
|
else
|
||||||
render :new
|
render :new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if @question.update(question_params)
|
if @question.update(question_params)
|
||||||
redirect_to question_path(@question), notice: t("flash.actions.save_changes.notice")
|
redirect_to admin_question_path(@question), notice: t("flash.actions.save_changes.notice")
|
||||||
else
|
else
|
||||||
render :edit
|
render :edit
|
||||||
end
|
end
|
||||||
|
|||||||
37
app/views/admin/poll/questions/show.html.erb
Normal file
37
app/views/admin/poll/questions/show.html.erb
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<% if @question.proposal.present? %>
|
||||||
|
<div>
|
||||||
|
<%= I18n.t("admin.questions.show.proposal") %>:
|
||||||
|
<%= @question.proposal.title %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<div class="small-12 column">
|
||||||
|
<div>
|
||||||
|
<%= I18n.t("admin.questions.show.title") %>:
|
||||||
|
<%= @question.title %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<%= I18n.t("admin.questions.show.valid_answers") %>:
|
||||||
|
<%= @question.valid_answers.join(", ") %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<%= I18n.t("admin.questions.show.summary") %>:
|
||||||
|
<%= @question.summary %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<%= I18n.t("admin.questions.show.description") %>:
|
||||||
|
<%= @question.description %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<%= I18n.t("admin.questions.show.geozones") %>:
|
||||||
|
<% @question.geozones.each do |geozone| %>
|
||||||
|
<div>
|
||||||
|
<% geozone.name %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -185,6 +185,13 @@ en:
|
|||||||
title: "Edit Question"
|
title: "Edit Question"
|
||||||
new:
|
new:
|
||||||
title: "Create Question"
|
title: "Create Question"
|
||||||
|
show:
|
||||||
|
proposal: Proposal
|
||||||
|
title: Title
|
||||||
|
valid_answers: Valid answers
|
||||||
|
summary: Summary
|
||||||
|
description: Description
|
||||||
|
geozones: Geozones
|
||||||
booths:
|
booths:
|
||||||
index:
|
index:
|
||||||
title: "List of booths"
|
title: "List of booths"
|
||||||
|
|||||||
@@ -185,6 +185,13 @@ es:
|
|||||||
title: "Editar pregunta ciudadana"
|
title: "Editar pregunta ciudadana"
|
||||||
new:
|
new:
|
||||||
title: "Crear pregunta ciudadana"
|
title: "Crear pregunta ciudadana"
|
||||||
|
show:
|
||||||
|
proposal: Propuesta Ciudadana
|
||||||
|
title: Título
|
||||||
|
valid_answers: Respuestas válidas
|
||||||
|
summary: Resumen
|
||||||
|
description: Descripción
|
||||||
|
geozones: Distritos
|
||||||
booths:
|
booths:
|
||||||
index:
|
index:
|
||||||
title: "Lista de urnas"
|
title: "Lista de urnas"
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ Rails.application.routes.draw do
|
|||||||
resources :polls do
|
resources :polls do
|
||||||
resources :booths
|
resources :booths
|
||||||
end
|
end
|
||||||
resources :questions, except: :show
|
resources :questions
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :verifications, controller: :verifications, only: :index do
|
resources :verifications, controller: :verifications, only: :index do
|
||||||
|
|||||||
Reference in New Issue
Block a user