diff --git a/app/controllers/admin/education/program/application_controller.rb b/app/controllers/admin/education/programs/application_controller.rb similarity index 82% rename from app/controllers/admin/education/program/application_controller.rb rename to app/controllers/admin/education/programs/application_controller.rb index 554e00c4b4c480005785d9c99a6aaf690f380231..33259891bfe0503059dd3bfc207a514f63c8ce75 100644 --- a/app/controllers/admin/education/program/application_controller.rb +++ b/app/controllers/admin/education/programs/application_controller.rb @@ -1,4 +1,4 @@ -class Admin::Education::Program::ApplicationController < Admin::Education::ApplicationController +class Admin::Education::Programs::ApplicationController < Admin::Education::ApplicationController load_and_authorize_resource :program, class: Education::Program, through: :current_university, diff --git a/app/controllers/admin/education/program/role/people_controller.rb b/app/controllers/admin/education/programs/role/people_controller.rb similarity index 84% rename from app/controllers/admin/education/program/role/people_controller.rb rename to app/controllers/admin/education/programs/role/people_controller.rb index 722f2ab8169da868615c2779afa61acc50fa104f..5cce73ce05f5333dfe361333d276930bad41b64e 100644 --- a/app/controllers/admin/education/program/role/people_controller.rb +++ b/app/controllers/admin/education/programs/role/people_controller.rb @@ -1,4 +1,4 @@ -class Admin::Education::Program::Role::PeopleController < Admin::Education::Program::ApplicationController +class Admin::Education::Programs::Roles::PeopleController < Admin::Education::Programs::ApplicationController load_and_authorize_resource :role, class: University::Role, through: :program, param: :role_id, through_association: :university_roles load_and_authorize_resource :involvement, class: University::Person::Involvement, through: :role, parent: false diff --git a/app/controllers/admin/education/program/roles_controller.rb b/app/controllers/admin/education/programs/roles_controller.rb similarity index 94% rename from app/controllers/admin/education/program/roles_controller.rb rename to app/controllers/admin/education/programs/roles_controller.rb index dfa7e8fa64f16c3267809221a5e30a1135220949..d934a5c64c7e4a40896052da431beff06e8f0a51 100644 --- a/app/controllers/admin/education/program/roles_controller.rb +++ b/app/controllers/admin/education/programs/roles_controller.rb @@ -1,4 +1,4 @@ -class Admin::Education::Program::RolesController < Admin::Education::Program::ApplicationController +class Admin::Education::Programs::RolesController < Admin::Education::Programs::ApplicationController load_and_authorize_resource class: University::Role, through: :program, through_association: :university_roles include Admin::Reorderable diff --git a/app/controllers/admin/education/program/teachers_controller.rb b/app/controllers/admin/education/programs/teachers_controller.rb similarity index 95% rename from app/controllers/admin/education/program/teachers_controller.rb rename to app/controllers/admin/education/programs/teachers_controller.rb index f469eecb8801d2ad5a09e442b854b615d26220f8..00261353a60815b84ad4dc2766f830924fcb5233 100644 --- a/app/controllers/admin/education/program/teachers_controller.rb +++ b/app/controllers/admin/education/programs/teachers_controller.rb @@ -1,4 +1,4 @@ -class Admin::Education::Program::TeachersController < Admin::Education::Program::ApplicationController +class Admin::Education::Programs::TeachersController < Admin::Education::Programs::ApplicationController load_and_authorize_resource :involvement, class: University::Person::Involvement, through: :program, diff --git a/app/controllers/admin/education/school/application_controller.rb b/app/controllers/admin/education/schools/application_controller.rb similarity index 82% rename from app/controllers/admin/education/school/application_controller.rb rename to app/controllers/admin/education/schools/application_controller.rb index 56a79f71492195875c2a9aaa3cd17481e8cf5ed8..25f5493e8e219bcb51351bcf2384808c0c7e6f7c 100644 --- a/app/controllers/admin/education/school/application_controller.rb +++ b/app/controllers/admin/education/schools/application_controller.rb @@ -1,4 +1,4 @@ -class Admin::Education::School::ApplicationController < Admin::Education::ApplicationController +class Admin::Education::Schools::ApplicationController < Admin::Education::ApplicationController load_and_authorize_resource :school, class: Education::School, through: :current_university, diff --git a/app/controllers/admin/education/school/role/people_controller.rb b/app/controllers/admin/education/schools/roles/people_controller.rb similarity index 84% rename from app/controllers/admin/education/school/role/people_controller.rb rename to app/controllers/admin/education/schools/roles/people_controller.rb index 2a9c8fa74f2cfe3308f5b5b8606ee0fe52e23964..1a0961a46576fb615058a8bc6602f8439bd86d2b 100644 --- a/app/controllers/admin/education/school/role/people_controller.rb +++ b/app/controllers/admin/education/schools/roles/people_controller.rb @@ -1,4 +1,4 @@ -class Admin::Education::School::Role::PeopleController < Admin::Education::School::ApplicationController +class Admin::Education::Schools::Roles::PeopleController < Admin::Education::Schools::ApplicationController load_and_authorize_resource :role, class: University::Role, through: :school, param: :role_id, through_association: :university_roles load_and_authorize_resource :involvement, class: University::Person::Involvement, through: :role, parent: false diff --git a/app/controllers/admin/education/school/roles_controller.rb b/app/controllers/admin/education/schools/roles_controller.rb similarity index 95% rename from app/controllers/admin/education/school/roles_controller.rb rename to app/controllers/admin/education/schools/roles_controller.rb index 7ab46b743b6a18ddeb7ae3c95e381842896a8173..8c1e62e8b8dbbe548f600e08304baa95fcf65a7d 100644 --- a/app/controllers/admin/education/school/roles_controller.rb +++ b/app/controllers/admin/education/schools/roles_controller.rb @@ -1,4 +1,4 @@ -class Admin::Education::School::RolesController < Admin::Education::School::ApplicationController +class Admin::Education::Schools::RolesController < Admin::Education::Schools::ApplicationController load_and_authorize_resource class: University::Role, through: :school, through_association: :university_roles include Admin::Reorderable diff --git a/app/views/admin/education/program/roles/_form.html.erb b/app/views/admin/education/programs/roles/_form.html.erb similarity index 93% rename from app/views/admin/education/program/roles/_form.html.erb rename to app/views/admin/education/programs/roles/_form.html.erb index 433ceb7b4f6318ea85ad2f25d2d22643daa42597..08cfb054eff66f7b189b4593cfb47bf2c86200a9 100644 --- a/app/views/admin/education/program/roles/_form.html.erb +++ b/app/views/admin/education/programs/roles/_form.html.erb @@ -28,7 +28,7 @@ <div class="mb-3" id="involvements" data-sortable="inputs"> <%= f.simple_fields_for :involvements, role.involvements.sort_by(&:position), include_id: false do |involvement_f| %> - <%= render 'admin/education/program/roles/involvement_fields', f: involvement_f, include_id: true %> + <%= render 'admin/education/programs/roles/involvement_fields', f: involvement_f, include_id: true %> <% end %> </div> </div> diff --git a/app/views/admin/education/program/roles/_involvement_fields.html.erb b/app/views/admin/education/programs/roles/_involvement_fields.html.erb similarity index 100% rename from app/views/admin/education/program/roles/_involvement_fields.html.erb rename to app/views/admin/education/programs/roles/_involvement_fields.html.erb diff --git a/app/views/admin/education/program/roles/_list.html.erb b/app/views/admin/education/programs/roles/_list.html.erb similarity index 100% rename from app/views/admin/education/program/roles/_list.html.erb rename to app/views/admin/education/programs/roles/_list.html.erb diff --git a/app/views/admin/education/program/roles/edit.html.erb b/app/views/admin/education/programs/roles/edit.html.erb similarity index 100% rename from app/views/admin/education/program/roles/edit.html.erb rename to app/views/admin/education/programs/roles/edit.html.erb diff --git a/app/views/admin/education/program/roles/index.html.erb b/app/views/admin/education/programs/roles/index.html.erb similarity index 81% rename from app/views/admin/education/program/roles/index.html.erb rename to app/views/admin/education/programs/roles/index.html.erb index 9efa6d56e14ba8f10e242c7b5c1f5a30f897031b..f4f8923098359357d5ddb3fc01fccfeeceae8798 100644 --- a/app/views/admin/education/program/roles/index.html.erb +++ b/app/views/admin/education/programs/roles/index.html.erb @@ -1,5 +1,5 @@ <% content_for :title, University::Role.model_name.human(count: 2) %> -<%= render 'admin/education/program/roles/list', roles: @roles %> +<%= render 'admin/education/programs/roles/list', roles: @roles %> <% content_for :action_bar_right do %> <%= link_to t('create'), diff --git a/app/views/admin/education/program/roles/new.html.erb b/app/views/admin/education/programs/roles/new.html.erb similarity index 100% rename from app/views/admin/education/program/roles/new.html.erb rename to app/views/admin/education/programs/roles/new.html.erb diff --git a/app/views/admin/education/program/roles/show.html.erb b/app/views/admin/education/programs/roles/show.html.erb similarity index 100% rename from app/views/admin/education/program/roles/show.html.erb rename to app/views/admin/education/programs/roles/show.html.erb diff --git a/app/views/admin/education/program/teachers/_form.html.erb b/app/views/admin/education/programs/teachers/_form.html.erb similarity index 100% rename from app/views/admin/education/program/teachers/_form.html.erb rename to app/views/admin/education/programs/teachers/_form.html.erb diff --git a/app/views/admin/education/program/teachers/_list.html.erb b/app/views/admin/education/programs/teachers/_list.html.erb similarity index 100% rename from app/views/admin/education/program/teachers/_list.html.erb rename to app/views/admin/education/programs/teachers/_list.html.erb diff --git a/app/views/admin/education/program/teachers/edit.html.erb b/app/views/admin/education/programs/teachers/edit.html.erb similarity index 100% rename from app/views/admin/education/program/teachers/edit.html.erb rename to app/views/admin/education/programs/teachers/edit.html.erb diff --git a/app/views/admin/education/program/teachers/index.html.erb b/app/views/admin/education/programs/teachers/index.html.erb similarity index 76% rename from app/views/admin/education/program/teachers/index.html.erb rename to app/views/admin/education/programs/teachers/index.html.erb index 2c4ebc71137a21df10684b9591117206134b2da1..9d76fa58e806d5f4be528c48872bdc516e3d7b23 100644 --- a/app/views/admin/education/program/teachers/index.html.erb +++ b/app/views/admin/education/programs/teachers/index.html.erb @@ -1,5 +1,5 @@ <% content_for :title, Education::Program.human_attribute_name("teachers") %> -<%= render 'admin/education/program/teachers/list', involvements: @involvements %> +<%= render 'admin/education/programs/teachers/list', involvements: @involvements %> <% content_for :action_bar_right do %> <%= link_to t('create'), diff --git a/app/views/admin/education/program/teachers/new.html.erb b/app/views/admin/education/programs/teachers/new.html.erb similarity index 100% rename from app/views/admin/education/program/teachers/new.html.erb rename to app/views/admin/education/programs/teachers/new.html.erb diff --git a/app/views/admin/education/school/roles/_form.html.erb b/app/views/admin/education/schools/roles/_form.html.erb similarity index 93% rename from app/views/admin/education/school/roles/_form.html.erb rename to app/views/admin/education/schools/roles/_form.html.erb index 5fe08980a344e6e703e9e43518ad5f7ecb4c4177..b03b38d179a400b6a670a59d6121987a284f8447 100644 --- a/app/views/admin/education/school/roles/_form.html.erb +++ b/app/views/admin/education/schools/roles/_form.html.erb @@ -28,7 +28,7 @@ <div class="mb-3" id="involvements" data-sortable="inputs"> <%= f.simple_fields_for :involvements, role.involvements.sort_by(&:position), include_id: false do |involvement_f| %> - <%= render 'admin/education/school/roles/involvement_fields', f: involvement_f, include_id: true %> + <%= render 'admin/education/schools/roles/involvement_fields', f: involvement_f, include_id: true %> <% end %> </div> </div> diff --git a/app/views/admin/education/school/roles/_involvement_fields.html.erb b/app/views/admin/education/schools/roles/_involvement_fields.html.erb similarity index 100% rename from app/views/admin/education/school/roles/_involvement_fields.html.erb rename to app/views/admin/education/schools/roles/_involvement_fields.html.erb diff --git a/app/views/admin/education/school/roles/_list.html.erb b/app/views/admin/education/schools/roles/_list.html.erb similarity index 100% rename from app/views/admin/education/school/roles/_list.html.erb rename to app/views/admin/education/schools/roles/_list.html.erb diff --git a/app/views/admin/education/school/roles/edit.html.erb b/app/views/admin/education/schools/roles/edit.html.erb similarity index 100% rename from app/views/admin/education/school/roles/edit.html.erb rename to app/views/admin/education/schools/roles/edit.html.erb diff --git a/app/views/admin/education/school/roles/index.html.erb b/app/views/admin/education/schools/roles/index.html.erb similarity index 80% rename from app/views/admin/education/school/roles/index.html.erb rename to app/views/admin/education/schools/roles/index.html.erb index 169795ed215ab55d5484cbc72e0affb3662fd532..95f31e6242eee66f8c3e36f1978785dafb6ec23c 100644 --- a/app/views/admin/education/school/roles/index.html.erb +++ b/app/views/admin/education/schools/roles/index.html.erb @@ -1,5 +1,5 @@ <% content_for :title, Education::School.human_attribute_name('roles') %> -<%= render 'admin/education/school/roles/list', roles: @roles %> +<%= render 'admin/education/schools/roles/list', roles: @roles %> <% content_for :action_bar_right do %> <%= link_to t('add'), new_admin_education_school_role_path(school_id: @school.id), class: button_classes if can? :create, University::Role %> diff --git a/app/views/admin/education/school/roles/new.html.erb b/app/views/admin/education/schools/roles/new.html.erb similarity index 100% rename from app/views/admin/education/school/roles/new.html.erb rename to app/views/admin/education/schools/roles/new.html.erb diff --git a/app/views/admin/education/school/roles/show.html.erb b/app/views/admin/education/schools/roles/show.html.erb similarity index 100% rename from app/views/admin/education/school/roles/show.html.erb rename to app/views/admin/education/schools/roles/show.html.erb diff --git a/config/routes/admin/education.rb b/config/routes/admin/education.rb index f4ae939d306a4de9b3b1eb6a8d3577fc10e9ec41..fc7b0aa6ed2349cbef48db7925fb857af819d9c4 100644 --- a/config/routes/admin/education.rb +++ b/config/routes/admin/education.rb @@ -1,8 +1,8 @@ namespace :education do resources :teachers, only: [:index, :show, :edit, :update] resources :schools do - resources :roles, controller: 'school/roles' do - resources :people, controller: 'school/role/people', only: [:destroy] do + resources :roles, controller: 'schools/roles' do + resources :people, controller: 'schools/roles/people', only: [:destroy] do post :reorder, on: :collection end collection do @@ -11,15 +11,15 @@ namespace :education do end end resources :programs do - resources :roles, controller: 'program/roles' do - resources :people, controller: 'program/role/people', only: [:destroy] do + resources :roles, controller: 'programs/roles' do + resources :people, controller: 'programs/role/people', only: [:destroy] do post :reorder, on: :collection end collection do post :reorder end end - resources :teachers, controller: 'program/teachers', except: :show do + resources :teachers, controller: 'programs/teachers', except: :show do collection do post :reorder end