Dashboard controllers have been refactored
Proposal dashboard related controllers have been refactored inside its own namespace.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
class Admin::ProposalDashboardActionsController < Admin::BaseController
|
class Admin::ProposalDashboard::ActionsController < Admin::ProposalDashboard::BaseController
|
||||||
helper_method :proposal_dashboard_action, :resource
|
helper_method :proposal_dashboard_action, :resource
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
class Admin::AdministratorTasksController < Admin::BaseController
|
class Admin::ProposalDashboard::AdministratorTasksController < Admin::ProposalDashboard::BaseController
|
||||||
helper_method :administrator_task
|
helper_method :administrator_task
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@@ -14,7 +14,7 @@ class Admin::AdministratorTasksController < Admin::BaseController
|
|||||||
authorize! :update, administrator_task
|
authorize! :update, administrator_task
|
||||||
|
|
||||||
administrator_task.update(user: current_user, executed_at: Time.now)
|
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
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
class Admin::ProposalDashboard::BaseController < Admin::BaseController
|
||||||
|
helper_method :namespace
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def namespace
|
||||||
|
'admin'
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -245,7 +245,7 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li <%= "class=is-active" if controller_name == "administrator_tasks" %>>
|
<li <%= "class=is-active" if controller_name == "administrator_tasks" %>>
|
||||||
<%= link_to admin_administrator_tasks_path do %>
|
<%= link_to admin_proposal_dashboard_administrator_tasks_path do %>
|
||||||
<%= t("admin.menu.administrator_tasks") %>
|
<%= t("admin.menu.administrator_tasks") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<%= form_for [:admin, administrator_task] do |f| %>
|
<%= form_for [:admin_proposal_dashboard, administrator_task] do |f| %>
|
||||||
|
|
||||||
<div class="callout">
|
<div class="callout">
|
||||||
<h5><%=t '.proposal', title: administrator_task.source.proposal.title %></h5>
|
<h5><%=t '.proposal', title: administrator_task.source.proposal.title %></h5>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= back_link_to admin_administrator_tasks_path, t('.back') %>
|
<%= back_link_to admin_proposal_dashboard_administrator_tasks_path, t('.back') %>
|
||||||
|
|
||||||
<h1><%= t('.solving') %></h1>
|
<h1><%= t('.solving') %></h1>
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td style="text-align: right">
|
<td style="text-align: right">
|
||||||
<%= link_to t('.solve'),
|
<%= link_to t('.solve'),
|
||||||
edit_admin_administrator_task_path(task),
|
edit_admin_proposal_dashboard_administrator_task_path(task),
|
||||||
class: 'edit-banner button hollow' %>
|
class: 'edit-banner button hollow' %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -1315,6 +1315,7 @@ en:
|
|||||||
submit_header: Save header
|
submit_header: Save header
|
||||||
card_title: Edit card
|
card_title: Edit card
|
||||||
submit_card: Save card
|
submit_card: Save card
|
||||||
|
proposal_dashboard:
|
||||||
administrator_tasks:
|
administrator_tasks:
|
||||||
index:
|
index:
|
||||||
solve: Solve
|
solve: Solve
|
||||||
|
|||||||
@@ -486,7 +486,6 @@ en:
|
|||||||
title_external_url: "Additional documentation"
|
title_external_url: "Additional documentation"
|
||||||
title_video_url: "External video"
|
title_video_url: "External video"
|
||||||
author: Author
|
author: Author
|
||||||
preview:
|
|
||||||
draft: Draft
|
draft: Draft
|
||||||
update:
|
update:
|
||||||
form:
|
form:
|
||||||
|
|||||||
@@ -1315,6 +1315,7 @@ es:
|
|||||||
submit_header: Guardar encabezado
|
submit_header: Guardar encabezado
|
||||||
card_title: Editar tarjeta
|
card_title: Editar tarjeta
|
||||||
submit_card: Guardar tarjeta
|
submit_card: Guardar tarjeta
|
||||||
|
proposal_dashboard:
|
||||||
administrator_tasks:
|
administrator_tasks:
|
||||||
index:
|
index:
|
||||||
solve: Resolver
|
solve: Resolver
|
||||||
|
|||||||
@@ -486,7 +486,6 @@ es:
|
|||||||
title_external_url: "Documentación adicional"
|
title_external_url: "Documentación adicional"
|
||||||
title_video_url: "Vídeo externo"
|
title_video_url: "Vídeo externo"
|
||||||
author: Autor
|
author: Autor
|
||||||
preview:
|
|
||||||
draft: En borrador
|
draft: En borrador
|
||||||
update:
|
update:
|
||||||
form:
|
form:
|
||||||
|
|||||||
@@ -196,6 +196,8 @@ namespace :admin do
|
|||||||
resources :feeds, only: [:update]
|
resources :feeds, only: [:update]
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :proposal_dashboard_actions, only: [:index, :new, :create, :edit, :update, :destroy]
|
namespace :proposal_dashboard do
|
||||||
|
resources :actions, only: [:index, :new, :create, :edit, :update, :destroy]
|
||||||
resources :administrator_tasks, only: [:index, :edit, :update]
|
resources :administrator_tasks, only: [:index, :edit, :update]
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ describe 'Administrator tasks' do
|
|||||||
context 'when accessing the pending task list' do
|
context 'when accessing the pending task list' do
|
||||||
context 'and no pending task' do
|
context 'and no pending task' do
|
||||||
before do
|
before do
|
||||||
visit admin_administrator_tasks_path
|
visit admin_proposal_dashboard_administrator_tasks_path
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'informs that there are no pending tasks' do
|
scenario 'informs that there are no pending tasks' do
|
||||||
@@ -22,7 +22,7 @@ describe 'Administrator tasks' do
|
|||||||
let!(:task) { create :administrator_task, :pending }
|
let!(:task) { create :administrator_task, :pending }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
visit admin_administrator_tasks_path
|
visit admin_proposal_dashboard_administrator_tasks_path
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'shows the related proposal title' do
|
scenario 'shows the related proposal title' do
|
||||||
@@ -43,7 +43,7 @@ describe 'Administrator tasks' do
|
|||||||
let!(:task) { create :administrator_task, :pending }
|
let!(:task) { create :administrator_task, :pending }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
visit admin_administrator_tasks_path
|
visit admin_proposal_dashboard_administrator_tasks_path
|
||||||
click_link 'Solve'
|
click_link 'Solve'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user