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
|
||||
|
||||
if @question.save
|
||||
redirect_to question_path(@question)
|
||||
redirect_to admin_question_path(@question)
|
||||
else
|
||||
render :new
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
def show
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def update
|
||||
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
|
||||
render :edit
|
||||
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"
|
||||
new:
|
||||
title: "Create Question"
|
||||
show:
|
||||
proposal: Proposal
|
||||
title: Title
|
||||
valid_answers: Valid answers
|
||||
summary: Summary
|
||||
description: Description
|
||||
geozones: Geozones
|
||||
booths:
|
||||
index:
|
||||
title: "List of booths"
|
||||
|
||||
@@ -185,6 +185,13 @@ es:
|
||||
title: "Editar pregunta ciudadana"
|
||||
new:
|
||||
title: "Crear pregunta ciudadana"
|
||||
show:
|
||||
proposal: Propuesta Ciudadana
|
||||
title: Título
|
||||
valid_answers: Respuestas válidas
|
||||
summary: Resumen
|
||||
description: Descripción
|
||||
geozones: Distritos
|
||||
booths:
|
||||
index:
|
||||
title: "Lista de urnas"
|
||||
|
||||
@@ -190,7 +190,7 @@ Rails.application.routes.draw do
|
||||
resources :polls do
|
||||
resources :booths
|
||||
end
|
||||
resources :questions, except: :show
|
||||
resources :questions
|
||||
end
|
||||
|
||||
resources :verifications, controller: :verifications, only: :index do
|
||||
|
||||
Reference in New Issue
Block a user