Remove obsolete questions index in the admin area

We removed the link to this page in commit 83e8d6035 because poll
questions don't really make sense without a poll.

However, this page also contained information about successful
proposals, which might be interesting so administrators don't have to
navigate to the public area in order to find and create questions based
on successful proposals.

So we're keeping the part about successful proposals and linking it from
the proposals part of the admin area.

Note we're using translation keys like `successful_proposals_tab`, which
don't make sense anymore, for the successful proposals. We're doing so
because we've already got translations for these keys and, if we renamed
them, we'd lose the existing translations and our translators would have
to add them again.

Also note we're changing one poll question test a little bit so we
create the question from a successful proposal using the new page. There
are other tests checking how to create a question from the
admin/proposals#show action and other tests checking what happens when
accessing a successful proposal in the admin section, so we don't lose
any test coverage by changing an existing test instead of adding a new
one.

Finally, note that we've removing the `search` method in poll question
because we no longer use it. This currently makes the
`author_visible_name` database column useless; we aren't removing it
right now because we don't want to risk a possible data loss in a patch
release (we're about to release version 2.3.1), but we might remove it
in the future.
This commit is contained in:
Javi Martín
2025-02-23 14:51:48 +01:00
parent cf5863b29f
commit 2239b8fdca
23 changed files with 81 additions and 180 deletions

View File

@@ -1134,18 +1134,11 @@ en:
multiple_description: "Allows to choose multiple answers. It's possible to set the maximum number of answers."
questions:
index:
title: "Questions"
create: "Create question"
no_questions: "There are no questions."
filter_poll: Filter by Poll
select_poll: Select Poll
questions_tab: "Questions"
successful_proposals_tab: "Successful proposals"
create_question: "Create question"
table_proposal: "Proposal"
table_question: "Question"
table_poll: "Poll"
poll_not_assigned: "Poll not assigned"
edit:
title: "Edit Question"
form:

View File

@@ -569,7 +569,6 @@ en:
support: "You just have to click on the button that you will see below 'Support this proposal' and you can inform yourself about before promoting it. Only the proposals that achieve the maximum support will be carried out by the City Council, and I thought that you, I'm sure you help me achieve it!"
share: "And if you also do me the great favor of sharing my proposal with your friends, family and contacts, it would be perfect!"
polls:
all: "All"
dates: "From %{open_at} to %{closed_at}"
final_date: "Final recounts/Results"
index:

View File

@@ -1134,18 +1134,11 @@ es:
multiple_description: "Permite elegir más de una respuesta. Se puede elegir el número máximo de respuestas."
questions:
index:
title: "Preguntas de votaciones"
create: "Crear pregunta ciudadana"
no_questions: "No hay ninguna pregunta ciudadana."
filter_poll: Filtrar por votación
select_poll: Seleccionar votación
questions_tab: "Preguntas"
successful_proposals_tab: "Propuestas que han superado el umbral"
create_question: "Crear pregunta para votación"
table_proposal: "Propuesta"
table_question: "Pregunta"
table_poll: "Votación"
poll_not_assigned: "Votación no asignada"
edit:
title: "Editar pregunta ciudadana"
form:

View File

@@ -569,7 +569,6 @@ es:
support: "Tan sólo tienes que hacer clic en el botón que verás a continuación 'Apoyar esta propuesta' y directamente podrás informarte acerca de ella antes de impulsarla. Sólo las propuestas que consigan el máximo apoyo se llevarán a cabo por parte del Ayuntamiento, y he pensado que tú ¡seguro que me ayudas a lograrlo!"
share: "Y si además, me haces el gran favor de compartir mi propuesta con tus amigos, familiares y contactos ¡sería perfecto!"
polls:
all: "Todas"
dates: "Desde el %{open_at} hasta el %{closed_at}"
final_date: "Recuento final/Resultados"
index:

View File

@@ -45,6 +45,10 @@ namespace :admin do
resources :debates, only: [:index, :show]
resources :proposals, only: [:index, :show, :update] do
collection do
get :successful
end
member do
patch :select
patch :deselect
@@ -192,7 +196,7 @@ namespace :admin do
end
end
resources :questions, shallow: true do
resources :questions, except: :index, shallow: true do
resources :options, except: [:index, :show], controller: "questions/options", shallow: false
resources :options, only: [], controller: "questions/options" do
resources :images, controller: "questions/options/images"