diff --git a/app/controllers/admin/education/schools_controller.rb b/app/controllers/admin/education/schools_controller.rb index 37ea835aad3d3c19d2ea1e3a39f5d08872899d1e..f3322b1f881bfc90dcf402ce18d9627d6a311f6e 100644 --- a/app/controllers/admin/education/schools_controller.rb +++ b/app/controllers/admin/education/schools_controller.rb @@ -60,6 +60,6 @@ class Admin::Education::SchoolsController < Admin::Education::ApplicationControl def school_params params.require(:education_school) - .permit(:university_id, :name, :address, :zipcode, :city, :country, :phone, program_ids: []) + .permit(:university_id, :name, :address, :zipcode, :city, :country, :phone, :logo, :logo_delete, program_ids: []) end end diff --git a/app/models/education/school.rb b/app/models/education/school.rb index 02b110ca1abc20efac5367e5a7a3c374fe7c9be0..0497ecea97f11554307925879ca20ca884c0d261 100644 --- a/app/models/education/school.rb +++ b/app/models/education/school.rb @@ -37,6 +37,7 @@ class Education::School < ApplicationRecord as: :about, dependent: :nullify + has_one_attached_deletable :logo validates :name, :address, :city, :zipcode, :country, presence: true diff --git a/app/views/admin/education/schools/_form.html.erb b/app/views/admin/education/schools/_form.html.erb index 57f400b31a5381c76475e91d003f36ef65a4600d..605b29b3c10b94a7e855587d4577e11907dcef25 100644 --- a/app/views/admin/education/schools/_form.html.erb +++ b/app/views/admin/education/schools/_form.html.erb @@ -21,6 +21,11 @@ </div> </div> <%= f.input :country, input_html: { class: 'form-select' } %> + <%= f.input :logo, + as: :single_deletable_file, + input_html: { accept: '.jpg,.jpeg,.png,.svg' }, + preview: 200, + direct_upload: true %> </div> </div> </div> diff --git a/app/views/extranet/experiences/_list.html.erb b/app/views/extranet/experiences/_list.html.erb index ae422741e753820cedfee5d7b1e20ea6ae681e6e..9b5ef4cd8d8daee16a11dc4032bfbfd65cf1839f 100644 --- a/app/views/extranet/experiences/_list.html.erb +++ b/app/views/extranet/experiences/_list.html.erb @@ -1,12 +1,32 @@ <% edit ||= false %> -<% if person&.experiences.any? %> - <div class="experiences mt-4"> - <ul class="list-unstyled"> +<div class="experiences mt-4"> + <ul class="list-unstyled"> + <% if person&.experiences.any? %> <% @person.experiences.ordered.each do |experience| %> <%= render 'extranet/experiences/experience', experience: experience, edit: edit %> <% end %> - </ul> - </div> -<% end %> \ No newline at end of file + <% end %> + <% person&.cohorts.each do |cohort| %> + <li class="experiences__experience py-4 border-top"> + <div class="row"> + <div class="col-md-6"> + <p class="mb-0"> + <b><%= cohort.program %></b><br> + <%= cohort.program.diploma %><br> + <%= cohort.year %> + </p> + </div> + <div class="col-md-6 text-end"> + <% if cohort.school.logo.attached? %> + <%= kamifusen_tag cohort.school.logo, width: 100, class: 'img-fluid experience__organization__logo' %> + <% else %> + <p class="text-end"><%= cohort.school %></p> + <% end %> + </div> + </div> + </li> + <% end %> + </ul> +</div> \ No newline at end of file diff --git a/app/views/extranet/persons/_details.html.erb b/app/views/extranet/persons/_details.html.erb index 525ff0506ccea6a6d4b1e42a1826e705eabd1836..3347918fa54e1df45d9156bde66a7e6b92079bed 100644 --- a/app/views/extranet/persons/_details.html.erb +++ b/app/views/extranet/persons/_details.html.erb @@ -1,8 +1,4 @@ <dl> - <% person.cohorts.each do |cohort| %> - <dt><%= cohort.program %></dt> - <dd><%= link_to cohort.academic_year, cohort %></dd> - <% end %> <% [:phone_mobile, :phone_personal, :phone_professional].each do |attribute_name| %> <% next if person.public_send(attribute_name).blank? %> <dt><%= University::Person.human_attribute_name(attribute_name) %> :</dt> diff --git a/app/views/extranet/persons/show.html.erb b/app/views/extranet/persons/show.html.erb index 538746476aa8ef8eb16ca1afe78d6d4d2a719ad6..a296fd5025985e9aed519655e90d8e99b9bd49ab 100644 --- a/app/views/extranet/persons/show.html.erb +++ b/app/views/extranet/persons/show.html.erb @@ -9,10 +9,8 @@ </div> </div> </div> - <% if @person.experiences.any? %> - <p class="mb-4"><%= t('extranet.experiences.title') %></p> - <%= render 'extranet/experiences/list', person: @person %> - <% end %> + <p class="mb-4"><%= t('extranet.experiences.title') %></p> + <%= render 'extranet/experiences/list', person: @person %> </div> <div class="offset-md-1 col-md-3 order-1 order-md-2"> <%= kamifusen_tag @person.best_picture, width: 400, class: 'img-fluid person__portrait' if @person.best_picture.attached? %> diff --git a/config/locales/extranet/en.yml b/config/locales/extranet/en.yml index bd6694da208429f36d0aef4fd8d9c218e0a9eaae..c56a2abc9b31c5e82bd65cf2ff1b10247656b099 100644 --- a/config/locales/extranet/en.yml +++ b/config/locales/extranet/en.yml @@ -12,7 +12,7 @@ en: email_not_allowed_with_contact: is not authorized to access this extranet. Contact %{contact} for more information. experiences: new: Add experience - title: Professional path + title: Path home: recent_cohorts: Recent cohorts recent_experiences: Recent experiences diff --git a/config/locales/extranet/fr.yml b/config/locales/extranet/fr.yml index 8b94b1539ab9ff20a6159d597825474a17d8d3c2..453c69e96d8938a4a37d8906cb280d07b356d3f9 100644 --- a/config/locales/extranet/fr.yml +++ b/config/locales/extranet/fr.yml @@ -13,7 +13,7 @@ fr: experiences: new: Ajouter une expérience search_organization: Rechercher par nom ou SIREN - title: Parcours professionnel + title: Parcours home: recent_cohorts: Promotions récentes recent_experiences: Mouvements récents