diff --git a/app/views/admin/communication/websites/_form.html.erb b/app/views/admin/communication/websites/_form.html.erb index 1aa16367379d31bb63e673f428a7dfa4aef92873..ac221bc9d2d6a959c19940b995f5ca3db665a2ff 100644 --- a/app/views/admin/communication/websites/_form.html.erb +++ b/app/views/admin/communication/websites/_form.html.erb @@ -1,33 +1,46 @@ <%= simple_form_for [:admin, website] do |f| %> <div class="row"> <div class="col-md-4"> - <%= f.input :name %> - <%= f.input :about_type, - collection: Communication::Website.about_types, - label_method: lambda { |object| - I18n.t("activerecord.attributes.communication/website.about_#{object}") - }, - include_blank: false %> - <div class="type-school"> - <%= f.input :about_id, - collection: current_university.education_schools, - label: Education::School.model_name.human, - required: true %> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h5 class="card-title mb-0"><%= t('content') %></h5> + </div> + <div class="card-body"> + <%= f.input :name %> + <%= f.input :about_type, + collection: Communication::Website.about_types, + label_method: lambda { |object| + I18n.t("activerecord.attributes.communication/website.about_#{object}") + }, + include_blank: false %> + <div class="type-school"> + <%= f.input :about_id, + collection: current_university.education_schools, + label: Education::School.model_name.human, + required: true %> + </div> + <div class="type-journal"> + <%= f.input :about_id, + collection: current_university.research_journals, + label: Research::Journal.model_name.human, + required: true %> + </div> + </div> </div> - <div class="type-journal"> - <%= f.input :about_id, - collection: current_university.research_journals, - label: Research::Journal.model_name.human, - required: true %> - </div> - </div> - <div class="col-md-4"> - <%= f.input :domain %> - <%= f.input :repository %> - <%= f.input :access_token %> </div> <div class="col-md-4"> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h5 class="card-title mb-0"><%= t('metadata') %></h5> + </div> + <div class="card-body"> + <%= f.input :domain %> + <%= f.input :repository %> + <%= f.input :access_token %> + </div> + </div> </div> + </div> <% content_for :action_bar_right do %> <%= submit f %> diff --git a/app/views/admin/education/programs/_form.html.erb b/app/views/admin/education/programs/_form.html.erb index 5094af7e14af7a1fb4456b2e70b9f5ce5cd469fe..3abf686197ad084a6fde13fc281e707880091e0f 100644 --- a/app/views/admin/education/programs/_form.html.erb +++ b/app/views/admin/education/programs/_form.html.erb @@ -1,40 +1,58 @@ <%= simple_form_for [:admin, program] do |f| %> <div class="row"> <div class="col-md-4"> - <h2 class="h4"><%= t('education.program.main_informations') %></h2> - <%= f.input :name %> - <%= f.input :level, include_blank: false, label_method: -> (p) { I18n.t(p[1], scope: 'enums.education/program.level') } %> - <%= f.input :capacity %> - <%= f.input :ects %> - <%= f.input :continuing %> - <%= f.association :schools, - as: :check_boxes, - collection: current_university.education_schools.ordered %> - <%= f.association :parent, collection: program.persisted? ? program.list_of_other_programs : current_university.list_of_programs, label_method: ->(p) { sanitize p[:label] }, value_method: ->(p) { p[:id] } %> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h5 class="card-title mb-0"><%= t('education.program.main_informations') %></h5> + </div> + <div class="card-body"> + <%= f.input :name %> + <%= f.input :level, include_blank: false, label_method: -> (p) { I18n.t(p[1], scope: 'enums.education/program.level') } %> + <%= f.input :capacity %> + <%= f.input :ects %> + <%= f.input :continuing %> + <%= f.association :schools, + as: :check_boxes, + collection: current_university.education_schools.ordered %> + <%= f.association :parent, collection: program.persisted? ? program.list_of_other_programs : current_university.list_of_programs, label_method: ->(p) { sanitize p[:label] }, value_method: ->(p) { p[:id] } %> + </div> + </div> </div> <div class="col-md-8"> - <h2 class="h4"><%= t('education.program.useful_informations') %></h2> - <%= f.input :registration, as: :rich_text_area %> - <%= f.input :pricing, as: :rich_text_area %> - <%= f.input :duration, as: :rich_text_area %> - <%= f.input :contacts, as: :rich_text_area %> - <%= f.input :accessibility, as: :rich_text_area %> - <%= f.input :other, as: :rich_text_area %> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h5 class="card-title mb-0"><%= t('education.program.useful_informations') %></h5> + </div> + <div class="card-body"> + <%= f.input :registration, as: :rich_text_area %> + <%= f.input :pricing, as: :rich_text_area %> + <%= f.input :duration, as: :rich_text_area %> + <%= f.input :contacts, as: :rich_text_area %> + <%= f.input :accessibility, as: :rich_text_area %> + <%= f.input :other, as: :rich_text_area %> + </div> + </div> </div> - <div class="col-md-12"> - <h2 class="mt-5 h4"><%= t('education.program.educational_informations') %></h2> - </div> - <div class="col-md-6"> - <%= f.input :prerequisites, as: :rich_text_area %> - <%= f.input :objectives, as: :rich_text_area %> - <%= f.input :opportunities, as: :rich_text_area %> + </div> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h5 class="card-title mb-0"><%= t('education.program.educational_informations') %></h5> </div> - <div class="col-md-6"> - <%= f.input :pedagogy, as: :rich_text_area %> - <%= f.input :evaluation, as: :rich_text_area %> - <%= f.association :teachers, - as: :check_boxes, - collection: current_university.teachers.ordered %> + <div class="card-body"> + <div class="row"> + <div class="col-md-6"> + <%= f.input :prerequisites, as: :rich_text_area %> + <%= f.input :objectives, as: :rich_text_area %> + <%= f.input :opportunities, as: :rich_text_area %> + </div> + <div class="col-md-6"> + <%= f.input :pedagogy, as: :rich_text_area %> + <%= f.input :evaluation, as: :rich_text_area %> + <%= f.association :teachers, + as: :check_boxes, + collection: current_university.teachers.ordered %> + </div> + </div> </div> </div> <% content_for :action_bar_right do %> diff --git a/app/views/admin/education/schools/_form.html.erb b/app/views/admin/education/schools/_form.html.erb index e4866ce86e01459802c78faaf297bad154c96b5a..93a0809b8bc6d612c1de8fabd144090f766bd36b 100644 --- a/app/views/admin/education/schools/_form.html.erb +++ b/app/views/admin/education/schools/_form.html.erb @@ -1,25 +1,39 @@ <%= simple_form_for [:admin, school] do |f| %> <div class="row"> - <div class="col-md-4"> - <%= f.input :name %> - <%= f.input :phone %> - </div> - <div class="col-md-4"> - <%= f.input :address %> - <div class="row"> - <div class="col-md-4"> - <%= f.input :zipcode %> + <div class="col-md-6"> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h5 class="card-title mb-0"><%= t('metadata') %></h5> </div> - <div class="col-md-8"> - <%= f.input :city %> + <div class="card-body"> + <%= f.input :name %> + <%= f.input :phone %> + <%= f.input :address %> + <div class="row"> + <div class="col-md-4"> + <%= f.input :zipcode %> + </div> + <div class="col-md-8"> + <%= f.input :city %> + </div> + </div> + <%= f.input :country %> </div> </div> - <%= f.input :country %> </div> - <div class="col-md-4"> - <%= f.association :programs, - as: :check_boxes, - collection: current_university.education_programs.ordered %> + <div class="col-md-6"> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h5 class="card-title mb-0"><%= Education::Program.model_name.human(count: 2) %></h5> + </div> + <div class="card-body"> + <%= f.association :programs, + as: :check_boxes, + collection: current_university.list_of_programs, + label_method: ->(p) { sanitize p[:label] }, + value_method: ->(p) { p[:id] } %> + </div> + </div> </div> </div> <% content_for :action_bar_right do %> diff --git a/app/views/admin/education/teachers/_form.html.erb b/app/views/admin/education/teachers/_form.html.erb index a84f051ff3922be78f74c441e07c8ae0ca3a4332..36c664ab15fa822a78f3f96d4af1933cf57484e0 100644 --- a/app/views/admin/education/teachers/_form.html.erb +++ b/app/views/admin/education/teachers/_form.html.erb @@ -1,30 +1,48 @@ <%= simple_form_for [:admin, teacher] do |f| %> <div class="row"> - <div class="col-md-8"> + <div class="col-md-6"> <div class="card flex-fill w-100"> <div class="card-header"> - <h5 class="card-title mb-0"><%= t('content') %></h5> + <h5 class="card-title mb-0"><%= t('metadata') %></h5> </div> <div class="card-body"> - <%= f.input :first_name %> - <%= f.input :last_name %> + <div class="row"> + <div class="col-md-6"> + <%= f.input :first_name %> + </div> + <div class="col-md-6"> + <%= f.input :last_name %> + </div> + </div> + <div class="row"> + <div class="col-md-6"> + <%= f.input :slug, + as: :string, + input_html: teacher.persisted? ? {} : { + class: 'js-slug-input', + data: { source: '#education_teacher_first_name, #education_teacher_last_name' } + } %> + </div> + <div class="col-md-6"> + <%= f.association :user, collection: current_university.users.ordered %> + </div> + </div> <%= f.input :biography, as: :rich_text_area %> </div> </div> </div> - <div class="col-md-4"> + <div class="col-md-6"> <div class="card flex-fill w-100"> <div class="card-header"> - <h5 class="card-title mb-0"><%= t('metadata') %></h5> + <h5 class="card-title mb-0"><%= Education::Program.model_name.human(count: 2) %></h5> </div> <div class="card-body"> - <%= f.input :slug, - as: :string, - input_html: teacher.persisted? ? {} : { - class: 'js-slug-input', - data: { source: '#education_teacher_first_name, #education_teacher_last_name' } - } %> - <%= f.association :user, collection: current_university.users.ordered %> + <%= f.association :programs, + as: :check_boxes, + collection: current_university.list_of_programs, + label_method: ->(p) { sanitize p[:label] }, + value_method: ->(p) { p[:id] } %> + <ul> </ul> </div> diff --git a/app/views/admin/research/journals/_form.html.erb b/app/views/admin/research/journals/_form.html.erb index 4bb0e3c9740c626f67a4b773638dd3f271e9e9b7..c5b2761b3a7ce9b2196ff55afb27c42f5cb87653 100644 --- a/app/views/admin/research/journals/_form.html.erb +++ b/app/views/admin/research/journals/_form.html.erb @@ -1,8 +1,12 @@ <%= simple_form_for [:admin, journal] do |f| %> <div class="row"> <div class="col-md-6"> - <%= f.input :title %> - <%= f.input :issn %> + <div class="card flex-fill w-100"> + <div class="card-body"> + <%= f.input :title %> + <%= f.input :issn %> + </div> + </div> </div> </div> <% content_for :action_bar_right do %> diff --git a/app/views/admin/research/researchers/_form.html.erb b/app/views/admin/research/researchers/_form.html.erb index 7fdfc380e98c28f23ab86a4977437203d1f20472..5cc8e6c65fabd907be3eea7b9ef693e4652e8967 100644 --- a/app/views/admin/research/researchers/_form.html.erb +++ b/app/views/admin/research/researchers/_form.html.erb @@ -1,12 +1,20 @@ <%= simple_form_for [:admin, researcher] do |f| %> <div class="row"> <div class="col-md-4"> - <%= f.input :first_name %> - <%= f.input :last_name %> - <%= f.association :user, collection: current_university.users.ordered %> + <div class="card flex-fill w-100"> + <div class="card-body"> + <%= f.input :first_name %> + <%= f.input :last_name %> + <%= f.association :user, collection: current_university.users.ordered %> + </div> + </div> </div> <div class="col-md-8"> - <%= f.input :biography, as: :rich_text_area %> + <div class="card flex-fill w-100"> + <div class="card-body"> + <%= f.input :biography, as: :rich_text_area %> + </div> + </div> </div> </div> <% content_for :action_bar_right do %> diff --git a/app/views/admin/users/_form.html.erb b/app/views/admin/users/_form.html.erb index 58fc1fb69fd3988a89c8b552cadbcb24aa810734..317c715232946f7596a3ff9e27cb21d60377dfb6 100644 --- a/app/views/admin/users/_form.html.erb +++ b/app/views/admin/users/_form.html.erb @@ -1,37 +1,49 @@ <%= simple_form_for [:admin, user] do |f| %> <div class="row"> <div class="col-md-4"> - <%= f.input :email %> - <%= f.input :first_name %> - <%= f.input :last_name %> - <%= f.association :language, - include_blank: false, - label_method: lambda { |l| t("languages.#{l.iso_code.to_s}") } %> + <div class="card flex-fill w-100"> + <div class="card-body"> + <%= f.input :email %> + <%= f.input :first_name %> + <%= f.input :last_name %> + <%= f.association :language, + include_blank: false, + label_method: lambda { |l| t("languages.#{l.iso_code.to_s}") } %> + </div> + </div> </div> <div class="col-md-4"> - <%= f.input :password, - as: :password_with_hints, - required: user.new_record?, - hint: user.new_record? ? nil : t('admin.password_hint'), - allow_password_uncloaking: true, - validators: { - length: Devise.password_length.first, - uppercase_char: true, - lowercase_char: true, - numeric_char: true, - special_char: Rails.application.config.allowed_special_chars - }, - input_html: { autocomplete: "new-password" } %> - <%= f.input :mobile_phone %> - <%= f.input :role, include_blank: false, collection: current_user.managed_roles %> + <div class="card flex-fill w-100"> + <div class="card-body"> + <%= f.input :password, + as: :password_with_hints, + required: user.new_record?, + hint: user.new_record? ? nil : t('admin.password_hint'), + allow_password_uncloaking: true, + validators: { + length: Devise.password_length.first, + uppercase_char: true, + lowercase_char: true, + numeric_char: true, + special_char: Rails.application.config.allowed_special_chars + }, + input_html: { autocomplete: "new-password" } %> + <%= f.input :mobile_phone %> + <%= f.input :role, include_blank: false, collection: current_user.managed_roles %> + </div> + </div> </div> <div class="col-md-4"> - <%= f.input :picture, + <div class="card flex-fill w-100"> + <div class="card-body"> + <%= f.input :picture, as: :single_deletable_file, input_html: { accept: '.jpg,.jpeg,.png' }, preview: 200, resize: 1, direct_upload: true %> + </div> + </div> </div> </div> diff --git a/config/locales/education/en.yml b/config/locales/education/en.yml index a21482ee0d958268e440d65f36394ff7695054a7..1787c9dc92fb1de2ddd3da1499a0290cecf8809a 100644 --- a/config/locales/education/en.yml +++ b/config/locales/education/en.yml @@ -39,12 +39,14 @@ en: country: Country name: Name phone: Phone + programs: Programs provided zipcode: Zipcode education/teacher: biography: Biography first_name: First name last_name: Last name name: Name + programs: Programs done slug: Slug user: User education: diff --git a/config/locales/education/fr.yml b/config/locales/education/fr.yml index 14ec7d63a5121ef698fe3335f4be5174fbd866ab..8cd5685daa4fbaa2c0a7bde1c2f73a079856f046 100644 --- a/config/locales/education/fr.yml +++ b/config/locales/education/fr.yml @@ -39,12 +39,14 @@ fr: country: Pays name: Nom phone: Téléphone + programs: Formations dispensées zipcode: Code postal education/teacher: biography: Biographie first_name: Prénom last_name: Nom de famille name: Nom + programs: Formations assurées slug: Slug user: Utilisateur education: