diff --git a/app/controllers/admin/university/people_controller.rb b/app/controllers/admin/university/people_controller.rb index ec74ea1a624473d68651a748d402be27aae2c740..6e807196a160ca15eda547f5cd46a43e38ea216b 100644 --- a/app/controllers/admin/university/people_controller.rb +++ b/app/controllers/admin/university/people_controller.rb @@ -58,7 +58,8 @@ class Admin::University::PeopleController < Admin::University::ApplicationContro params.require(:university_person).permit( :slug, :first_name, :last_name, :email, :phone, :description, :biography, :picture, :picture_delete, :picture_infos, - :is_researcher, :is_teacher, :is_administration, :user_id + :habilitation, :tenure, :is_researcher, :is_teacher, + :is_administration, :user_id ).merge(university_id: current_university.id) end end diff --git a/app/models/university/person.rb b/app/models/university/person.rb index d7e884d546a23c5e3165972ce2c2b2460e26c92e..c23ba6098c2fd5f751b094e316035e8ea0acf018 100644 --- a/app/models/university/person.rb +++ b/app/models/university/person.rb @@ -6,12 +6,14 @@ # description :text # email :string # first_name :string +# habilitation :boolean default(FALSE) # is_administration :boolean # is_researcher :boolean # is_teacher :boolean # last_name :string # phone :string # slug :string +# tenure :boolean default(FALSE) # created_at :datetime not null # updated_at :datetime not null # university_id :uuid not null diff --git a/app/models/university/person/administrator.rb b/app/models/university/person/administrator.rb index 0f55f1ace71fafcbdaf50b4021d1a41a97cf2862..fc58865e3cace8c5bedd097b13181c71e4346e33 100644 --- a/app/models/university/person/administrator.rb +++ b/app/models/university/person/administrator.rb @@ -6,12 +6,14 @@ # description :text # email :string # first_name :string +# habilitation :boolean default(FALSE) # is_administration :boolean # is_researcher :boolean # is_teacher :boolean # last_name :string # phone :string # slug :string +# tenure :boolean default(FALSE) # created_at :datetime not null # updated_at :datetime not null # university_id :uuid not null diff --git a/app/models/university/person/author.rb b/app/models/university/person/author.rb index 084023056b2b5b261c05bcd7ed4a99d966994b30..7ffdf1912d7427d4f6f77e23bdfb4ecbb18abc51 100644 --- a/app/models/university/person/author.rb +++ b/app/models/university/person/author.rb @@ -6,12 +6,14 @@ # description :text # email :string # first_name :string +# habilitation :boolean default(FALSE) # is_administration :boolean # is_researcher :boolean # is_teacher :boolean # last_name :string # phone :string # slug :string +# tenure :boolean default(FALSE) # created_at :datetime not null # updated_at :datetime not null # university_id :uuid not null diff --git a/app/models/university/person/researcher.rb b/app/models/university/person/researcher.rb index 45e450b4cce3034e65ba5363676967ebc6c648e8..2fddf823b3bb6d41c9d9fd09fba9cb1907879cac 100644 --- a/app/models/university/person/researcher.rb +++ b/app/models/university/person/researcher.rb @@ -6,12 +6,14 @@ # description :text # email :string # first_name :string +# habilitation :boolean default(FALSE) # is_administration :boolean # is_researcher :boolean # is_teacher :boolean # last_name :string # phone :string # slug :string +# tenure :boolean default(FALSE) # created_at :datetime not null # updated_at :datetime not null # university_id :uuid not null diff --git a/app/models/university/person/teacher.rb b/app/models/university/person/teacher.rb index fd62b7ef4fa0a1a274301bd433bb9fea17baa848..8f354959b118a2d4486826f5be6117b6ab8c9ee6 100644 --- a/app/models/university/person/teacher.rb +++ b/app/models/university/person/teacher.rb @@ -6,12 +6,14 @@ # description :text # email :string # first_name :string +# habilitation :boolean default(FALSE) # is_administration :boolean # is_researcher :boolean # is_teacher :boolean # last_name :string # phone :string # slug :string +# tenure :boolean default(FALSE) # created_at :datetime not null # updated_at :datetime not null # university_id :uuid not null diff --git a/app/views/admin/university/people/_form.html.erb b/app/views/admin/university/people/_form.html.erb index 9c0ae01d0ed5dfe3143d2baa7f05eb20e637dfcd..e5781875d4a45d3464ac0ed617a9cde8c15647b2 100644 --- a/app/views/admin/university/people/_form.html.erb +++ b/app/views/admin/university/people/_form.html.erb @@ -43,6 +43,16 @@ </div> </div> </div> + <div class="card-body"> + <div class="row"> + <div class="col-md-6"> + <%= f.input :habilitation %> + </div> + <div class="col-md-6"> + <%= f.input :tenure %> + </div> + </div> + </div> </div> </div> <div class="col-md-4"> diff --git a/config/locales/university/en.yml b/config/locales/university/en.yml index 37ccdd3e3e9b5feb07f4dc2da280ee90561a973d..8d690dbb687aa5dd1691327ed3ba5c9e9de97061 100644 --- a/config/locales/university/en.yml +++ b/config/locales/university/en.yml @@ -22,6 +22,7 @@ en: education_programs: Programs email: Email first_name: First name + habilitation: Can direct research? is_administration: Administrative staff is_author: Author is_researcher: Researcher @@ -32,6 +33,7 @@ en: picture: Profile picture research_journal_articles: Articles slug: Slug + tenure: Have tenure? user: User models: university: @@ -45,7 +47,9 @@ en: university: sms_sender_name: "11 characters max." university_person: + habilitation: "Possesses an accreditation to supervise research." is_administration: "Is part of administrative staff for a school." is_author: "Writes posts for websites." is_researcher: "Writes articles for journals." is_teacher: "Teaches in Schools." + tenure: "To differ from temporary lecturer." diff --git a/config/locales/university/fr.yml b/config/locales/university/fr.yml index fbc1d8faf31f834f6cd2d3bcdd49731fe62dcb5c..d40b74e837c1e021fdc7e0d26fce0c6da9046248 100644 --- a/config/locales/university/fr.yml +++ b/config/locales/university/fr.yml @@ -22,6 +22,7 @@ fr: education_programs: Formations email: Email first_name: Prénom + habilitation: Peut diriger des recherches ? is_administration: Personnel administratif is_author: Auteur·rice is_researcher: Chercheur·se @@ -32,6 +33,7 @@ fr: picture: Photo de profil research_journal_articles: Articles slug: Slug + tenure: Titulaire ? user: Utilisateur models: university: @@ -45,7 +47,9 @@ fr: university: sms_sender_name: "11 caractères maximum." university_person: + habilitation: "Possède une Habilitation à Diriger des Recherches." is_administration: "Fait partie du personnel administratif d'une école." is_author: "Écrit des articles pour les sites." is_researcher: "Écrit des articles dans des revues scientifiques." is_teacher: "Enseigne dans des formations." + tenure: "A différencier d'une personne vacataire." diff --git a/db/migrate/20220119162026_add_lab_attributes_to_university_people.rb b/db/migrate/20220119162026_add_lab_attributes_to_university_people.rb new file mode 100644 index 0000000000000000000000000000000000000000..bb7702feda9cf44ffed849cdc3049bdbf1e70c2a --- /dev/null +++ b/db/migrate/20220119162026_add_lab_attributes_to_university_people.rb @@ -0,0 +1,6 @@ +class AddLabAttributesToUniversityPeople < ActiveRecord::Migration[6.1] + def change + add_column :university_people, :habilitation, :boolean, default: false + add_column :university_people, :tenure, :boolean, default: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 159b3f490c8953aee1966af09f4b5a47beecb2c0..875b0fe61d4e5e4da5605878e8e46bc551e22319 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_01_17_134401) do +ActiveRecord::Schema.define(version: 2022_01_19_162026) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -528,6 +528,8 @@ ActiveRecord::Schema.define(version: 2022_01_17_134401) do t.string "phone" t.string "email" t.text "description" + t.boolean "habilitation", default: false + t.boolean "tenure", default: false t.index ["university_id"], name: "index_university_people_on_university_id" t.index ["user_id"], name: "index_university_people_on_user_id" end