diff --git a/app/controllers/admin/proposal_dashboard_actions_controller.rb b/app/controllers/admin/proposal_dashboard/actions_controller.rb similarity index 94% rename from app/controllers/admin/proposal_dashboard_actions_controller.rb rename to app/controllers/admin/proposal_dashboard/actions_controller.rb index a40ea2e0a..66f508efa 100644 --- a/app/controllers/admin/proposal_dashboard_actions_controller.rb +++ b/app/controllers/admin/proposal_dashboard/actions_controller.rb @@ -1,4 +1,4 @@ -class Admin::ProposalDashboardActionsController < Admin::BaseController +class Admin::ProposalDashboard::ActionsController < Admin::ProposalDashboard::BaseController helper_method :proposal_dashboard_action, :resource def index diff --git a/app/controllers/admin/administrator_tasks_controller.rb b/app/controllers/admin/proposal_dashboard/administrator_tasks_controller.rb similarity index 68% rename from app/controllers/admin/administrator_tasks_controller.rb rename to app/controllers/admin/proposal_dashboard/administrator_tasks_controller.rb index dd4239a0e..f6ff2e6cc 100644 --- a/app/controllers/admin/administrator_tasks_controller.rb +++ b/app/controllers/admin/proposal_dashboard/administrator_tasks_controller.rb @@ -1,4 +1,4 @@ -class Admin::AdministratorTasksController < Admin::BaseController +class Admin::ProposalDashboard::AdministratorTasksController < Admin::ProposalDashboard::BaseController helper_method :administrator_task def index @@ -14,7 +14,7 @@ class Admin::AdministratorTasksController < Admin::BaseController authorize! :update, administrator_task administrator_task.update(user: current_user, executed_at: Time.now) - redirect_to admin_administrator_tasks_path, { flash: { notice: t('.success') } } + redirect_to admin_proposal_dashboard_administrator_tasks_path, { flash: { notice: t('.success') } } end private diff --git a/app/controllers/admin/proposal_dashboard/base_controller.rb b/app/controllers/admin/proposal_dashboard/base_controller.rb new file mode 100644 index 000000000..959ad20e7 --- /dev/null +++ b/app/controllers/admin/proposal_dashboard/base_controller.rb @@ -0,0 +1,9 @@ +class Admin::ProposalDashboard::BaseController < Admin::BaseController + helper_method :namespace + + private + + def namespace + 'admin' + end +end diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index 3c8a3637d..f21d63735 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -245,7 +245,7 @@
  • > - <%= link_to admin_administrator_tasks_path do %> + <%= link_to admin_proposal_dashboard_administrator_tasks_path do %> <%= t("admin.menu.administrator_tasks") %> <% end %>
  • diff --git a/app/views/admin/proposal_dashboard_actions/_form.html.erb b/app/views/admin/proposal_dashboard/actions/_form.html.erb similarity index 100% rename from app/views/admin/proposal_dashboard_actions/_form.html.erb rename to app/views/admin/proposal_dashboard/actions/_form.html.erb diff --git a/app/views/admin/proposal_dashboard_actions/edit.html.erb b/app/views/admin/proposal_dashboard/actions/edit.html.erb similarity index 100% rename from app/views/admin/proposal_dashboard_actions/edit.html.erb rename to app/views/admin/proposal_dashboard/actions/edit.html.erb diff --git a/app/views/admin/proposal_dashboard_actions/index.html.erb b/app/views/admin/proposal_dashboard/actions/index.html.erb similarity index 100% rename from app/views/admin/proposal_dashboard_actions/index.html.erb rename to app/views/admin/proposal_dashboard/actions/index.html.erb diff --git a/app/views/admin/proposal_dashboard_actions/new.html.erb b/app/views/admin/proposal_dashboard/actions/new.html.erb similarity index 100% rename from app/views/admin/proposal_dashboard_actions/new.html.erb rename to app/views/admin/proposal_dashboard/actions/new.html.erb diff --git a/app/views/admin/administrator_tasks/_form.html.erb b/app/views/admin/proposal_dashboard/administrator_tasks/_form.html.erb similarity index 89% rename from app/views/admin/administrator_tasks/_form.html.erb rename to app/views/admin/proposal_dashboard/administrator_tasks/_form.html.erb index 91704ec47..20985eda3 100644 --- a/app/views/admin/administrator_tasks/_form.html.erb +++ b/app/views/admin/proposal_dashboard/administrator_tasks/_form.html.erb @@ -1,4 +1,4 @@ -<%= form_for [:admin, administrator_task] do |f| %> +<%= form_for [:admin_proposal_dashboard, administrator_task] do |f| %>
    <%=t '.proposal', title: administrator_task.source.proposal.title %>
    diff --git a/app/views/admin/administrator_tasks/edit.html.erb b/app/views/admin/proposal_dashboard/administrator_tasks/edit.html.erb similarity index 59% rename from app/views/admin/administrator_tasks/edit.html.erb rename to app/views/admin/proposal_dashboard/administrator_tasks/edit.html.erb index 022d5aa13..6d85c6d04 100644 --- a/app/views/admin/administrator_tasks/edit.html.erb +++ b/app/views/admin/proposal_dashboard/administrator_tasks/edit.html.erb @@ -1,6 +1,6 @@
    - <%= back_link_to admin_administrator_tasks_path, t('.back') %> + <%= back_link_to admin_proposal_dashboard_administrator_tasks_path, t('.back') %>

    <%= t('.solving') %>

    diff --git a/app/views/admin/administrator_tasks/index.html.erb b/app/views/admin/proposal_dashboard/administrator_tasks/index.html.erb similarity index 90% rename from app/views/admin/administrator_tasks/index.html.erb rename to app/views/admin/proposal_dashboard/administrator_tasks/index.html.erb index 66d076787..38614904f 100644 --- a/app/views/admin/administrator_tasks/index.html.erb +++ b/app/views/admin/proposal_dashboard/administrator_tasks/index.html.erb @@ -25,7 +25,7 @@ <%= link_to t('.solve'), - edit_admin_administrator_task_path(task), + edit_admin_proposal_dashboard_administrator_task_path(task), class: 'edit-banner button hollow' %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 46f9023af..2bb545454 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -1315,17 +1315,18 @@ en: submit_header: Save header card_title: Edit card submit_card: Save card - administrator_tasks: - index: - solve: Solve - no_records: There are no pending tasks - edit: - back: Back to pending tasks list - solving: Solve pending task - form: - solve: Mark as solved - proposal: "The proposal: %{title}" - request: "Has requested: %{title}" - check_details: Check the proposal details - update: - success: The task has been marked as solved. + proposal_dashboard: + administrator_tasks: + index: + solve: Solve + no_records: There are no pending tasks + edit: + back: Back to pending tasks list + solving: Solve pending task + form: + solve: Mark as solved + proposal: "The proposal: %{title}" + request: "Has requested: %{title}" + check_details: Check the proposal details + update: + success: The task has been marked as solved. diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index 207ca3620..15d89cec4 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -486,7 +486,6 @@ en: title_external_url: "Additional documentation" title_video_url: "External video" author: Author - preview: draft: Draft update: form: diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 2aaf1450f..58759b74d 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -1315,17 +1315,18 @@ es: submit_header: Guardar encabezado card_title: Editar tarjeta submit_card: Guardar tarjeta - administrator_tasks: - index: - solve: Resolver - no_records: No hay tareas pendientes - edit: - back: Volver a la lista de tareas pendientes - solving: Resolver tarea pendiente - form: - solve: Marcar como resuelta - proposal: "La propuesta: %{title}" - request: "Ha solicitado: %{title}" - check_details: Ver los detalles de la propuesta - update: - success: La tarea ha sido marcada como resuelta + proposal_dashboard: + administrator_tasks: + index: + solve: Resolver + no_records: No hay tareas pendientes + edit: + back: Volver a la lista de tareas pendientes + solving: Resolver tarea pendiente + form: + solve: Marcar como resuelta + proposal: "La propuesta: %{title}" + request: "Ha solicitado: %{title}" + check_details: Ver los detalles de la propuesta + update: + success: La tarea ha sido marcada como resuelta diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index a211365cf..8938e0eaa 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -486,7 +486,6 @@ es: title_external_url: "Documentación adicional" title_video_url: "Vídeo externo" author: Autor - preview: draft: En borrador update: form: diff --git a/config/routes/admin.rb b/config/routes/admin.rb index b01cb3be7..80d7cdb6b 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -196,6 +196,8 @@ namespace :admin do resources :feeds, only: [:update] end - resources :proposal_dashboard_actions, only: [:index, :new, :create, :edit, :update, :destroy] - resources :administrator_tasks, only: [:index, :edit, :update] + namespace :proposal_dashboard do + resources :actions, only: [:index, :new, :create, :edit, :update, :destroy] + resources :administrator_tasks, only: [:index, :edit, :update] + end end diff --git a/spec/features/admin/administrator_tasks_spec.rb b/spec/features/admin/administrator_tasks_spec.rb index 6e960c26b..08a1bac3b 100644 --- a/spec/features/admin/administrator_tasks_spec.rb +++ b/spec/features/admin/administrator_tasks_spec.rb @@ -10,7 +10,7 @@ describe 'Administrator tasks' do context 'when accessing the pending task list' do context 'and no pending task' do before do - visit admin_administrator_tasks_path + visit admin_proposal_dashboard_administrator_tasks_path end scenario 'informs that there are no pending tasks' do @@ -22,7 +22,7 @@ describe 'Administrator tasks' do let!(:task) { create :administrator_task, :pending } before do - visit admin_administrator_tasks_path + visit admin_proposal_dashboard_administrator_tasks_path end scenario 'shows the related proposal title' do @@ -43,7 +43,7 @@ describe 'Administrator tasks' do let!(:task) { create :administrator_task, :pending } before do - visit admin_administrator_tasks_path + visit admin_proposal_dashboard_administrator_tasks_path click_link 'Solve' end