From 78889314742f9211e2c838a5efca3c09b3d65379 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Tue, 10 May 2022 06:58:44 +0200 Subject: [PATCH] education --- .../{program => programs}/application_controller.rb | 2 +- .../{program => programs}/role/people_controller.rb | 2 +- .../{program => programs}/roles_controller.rb | 2 +- .../{program => programs}/teachers_controller.rb | 2 +- .../{school => schools}/application_controller.rb | 2 +- .../role => schools/roles}/people_controller.rb | 2 +- .../education/{school => schools}/roles_controller.rb | 2 +- .../{program => programs}/roles/_form.html.erb | 2 +- .../roles/_involvement_fields.html.erb | 0 .../{program => programs}/roles/_list.html.erb | 0 .../{program => programs}/roles/edit.html.erb | 0 .../{program => programs}/roles/index.html.erb | 2 +- .../education/{program => programs}/roles/new.html.erb | 0 .../{program => programs}/roles/show.html.erb | 0 .../{program => programs}/teachers/_form.html.erb | 0 .../{program => programs}/teachers/_list.html.erb | 0 .../{program => programs}/teachers/edit.html.erb | 0 .../{program => programs}/teachers/index.html.erb | 2 +- .../{program => programs}/teachers/new.html.erb | 0 .../education/{school => schools}/roles/_form.html.erb | 2 +- .../roles/_involvement_fields.html.erb | 0 .../education/{school => schools}/roles/_list.html.erb | 0 .../education/{school => schools}/roles/edit.html.erb | 0 .../education/{school => schools}/roles/index.html.erb | 2 +- .../education/{school => schools}/roles/new.html.erb | 0 .../education/{school => schools}/roles/show.html.erb | 0 config/routes/admin/education.rb | 10 +++++----- 27 files changed, 17 insertions(+), 17 deletions(-) rename app/controllers/admin/education/{program => programs}/application_controller.rb (82%) rename app/controllers/admin/education/{program => programs}/role/people_controller.rb (84%) rename app/controllers/admin/education/{program => programs}/roles_controller.rb (94%) rename app/controllers/admin/education/{program => programs}/teachers_controller.rb (95%) rename app/controllers/admin/education/{school => schools}/application_controller.rb (82%) rename app/controllers/admin/education/{school/role => schools/roles}/people_controller.rb (84%) rename app/controllers/admin/education/{school => schools}/roles_controller.rb (95%) rename app/views/admin/education/{program => programs}/roles/_form.html.erb (93%) rename app/views/admin/education/{program => programs}/roles/_involvement_fields.html.erb (100%) rename app/views/admin/education/{program => programs}/roles/_list.html.erb (100%) rename app/views/admin/education/{program => programs}/roles/edit.html.erb (100%) rename app/views/admin/education/{program => programs}/roles/index.html.erb (81%) rename app/views/admin/education/{program => programs}/roles/new.html.erb (100%) rename app/views/admin/education/{program => programs}/roles/show.html.erb (100%) rename app/views/admin/education/{program => programs}/teachers/_form.html.erb (100%) rename app/views/admin/education/{program => programs}/teachers/_list.html.erb (100%) rename app/views/admin/education/{program => programs}/teachers/edit.html.erb (100%) rename app/views/admin/education/{program => programs}/teachers/index.html.erb (76%) rename app/views/admin/education/{program => programs}/teachers/new.html.erb (100%) rename app/views/admin/education/{school => schools}/roles/_form.html.erb (93%) rename app/views/admin/education/{school => schools}/roles/_involvement_fields.html.erb (100%) rename app/views/admin/education/{school => schools}/roles/_list.html.erb (100%) rename app/views/admin/education/{school => schools}/roles/edit.html.erb (100%) rename app/views/admin/education/{school => schools}/roles/index.html.erb (80%) rename app/views/admin/education/{school => schools}/roles/new.html.erb (100%) rename app/views/admin/education/{school => schools}/roles/show.html.erb (100%) 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 554e00c4b..33259891b 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 722f2ab81..5cce73ce0 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 dfa7e8fa6..d934a5c64 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 f469eecb8..00261353a 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 56a79f714..25f5493e8 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 2a9c8fa74..1a0961a46 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 7ab46b743..8c1e62e8b 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 433ceb7b4..08cfb054e 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 9efa6d56e..f4f892309 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 2c4ebc711..9d76fa58e 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 5fe08980a..b03b38d17 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 169795ed2..95f31e624 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 f4ae939d3..fc7b0aa6e 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 -- GitLab