diff --git a/app/controllers/admin/poll/questions_controller.rb b/app/controllers/admin/poll/questions_controller.rb index 25b14251c..970d91b55 100644 --- a/app/controllers/admin/poll/questions_controller.rb +++ b/app/controllers/admin/poll/questions_controller.rb @@ -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 diff --git a/app/views/admin/poll/questions/show.html.erb b/app/views/admin/poll/questions/show.html.erb new file mode 100644 index 000000000..942658f28 --- /dev/null +++ b/app/views/admin/poll/questions/show.html.erb @@ -0,0 +1,37 @@ +<% if @question.proposal.present? %> +
+ <%= I18n.t("admin.questions.show.proposal") %>: + <%= @question.proposal.title %> +
+<% end %> + +
+
+ <%= I18n.t("admin.questions.show.title") %>: + <%= @question.title %> +
+ +
+ <%= I18n.t("admin.questions.show.valid_answers") %>: + <%= @question.valid_answers.join(", ") %> +
+ +
+ <%= I18n.t("admin.questions.show.summary") %>: + <%= @question.summary %> +
+ +
+ <%= I18n.t("admin.questions.show.description") %>: + <%= @question.description %> +
+ +
+ <%= I18n.t("admin.questions.show.geozones") %>: + <% @question.geozones.each do |geozone| %> +
+ <% geozone.name %> +
+ <% end %> +
+
\ No newline at end of file diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index c86f57266..e7e30e140 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -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" diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index b579bfec5..22086889e 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -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" diff --git a/config/routes.rb b/config/routes.rb index 2b0965314..ceecf3d88 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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