diff --git a/app/controllers/admin/communication/extranets_controller.rb b/app/controllers/admin/communication/extranets_controller.rb index d39395957ab78f8eb85dae64b2512c51e5a2af29..d39eec4d35a5566e1812755435602e2dcaae1d17 100644 --- a/app/controllers/admin/communication/extranets_controller.rb +++ b/app/controllers/admin/communication/extranets_controller.rb @@ -60,16 +60,16 @@ class Admin::Communication::ExtranetsController < Admin::Communication::Applicat def extranet_params params.require(:communication_extranet) .permit( - :about_id, :about_type, - :color, :cookies_policy, - :favicon, :favicon_delete, :feature_alumni, :feature_assets, :feature_contacts, :feature_jobs, :feature_posts, + :about_id, :about_type, + :color, :cookies_policy, + :favicon, :favicon_delete, :feature_alumni, :feature_library, :feature_contacts, :feature_jobs, :feature_posts, :has_sso, :host, :home_sentence, - :logo, :logo_delete, - :name, - :privacy_policy, + :logo, :logo_delete, + :name, + :privacy_policy, :registration_contact, :sass, :sso_target_url, :sso_cert, :sso_name_identifier_format, :sso_mapping, :sso_button_label, - :terms, + :terms, ) end end diff --git a/app/controllers/admin/university/alumni/experiences/imports_controller.rb b/app/controllers/admin/university/people/experiences/imports_controller.rb similarity index 64% rename from app/controllers/admin/university/alumni/experiences/imports_controller.rb rename to app/controllers/admin/university/people/experiences/imports_controller.rb index 538e9dd0de9af981c5b275d54e1bb2599c55d48d..663b26c9bccd8ef393611faeb32117c56580501d 100644 --- a/app/controllers/admin/university/alumni/experiences/imports_controller.rb +++ b/app/controllers/admin/university/people/experiences/imports_controller.rb @@ -1,4 +1,4 @@ -class Admin::University::Alumni::Experiences::ImportsController < Admin::University::ApplicationController +class Admin::University::People::Experiences::ImportsController < Admin::University::ApplicationController load_and_authorize_resource class: Import, through: :current_university, through_association: :imports @@ -6,7 +6,7 @@ class Admin::University::Alumni::Experiences::ImportsController < Admin::Univers has_scope :for_status def index - @imports = apply_scopes(@imports.kind_alumni_experiences).ordered.page(params[:page]) + @imports = apply_scopes(@imports.kind_people_experiences).ordered.page(params[:page]) breadcrumb end @@ -20,11 +20,11 @@ class Admin::University::Alumni::Experiences::ImportsController < Admin::Univers end def create - @import.kind = :alumni_experiences + @import.kind = :people_experiences @import.university = current_university @import.user = current_user if @import.save - redirect_to admin_university_alumni_experiences_import_path(@import), + redirect_to admin_university_people_experiences_import_path(@import), notice: t('admin.successfully_created_html', model: @import.to_s) else breadcrumb @@ -36,12 +36,12 @@ class Admin::University::Alumni::Experiences::ImportsController < Admin::Univers def breadcrumb super - add_breadcrumb University::Person::Alumnus.model_name.human(count: 2), - admin_university_alumni_path - add_breadcrumb t('university.alumni.experiences.title'), - admin_university_alumni_experiences_imports_path + add_breadcrumb University::Person.model_name.human(count: 2), + admin_university_people_path + add_breadcrumb t('university.person.experiences.title'), + admin_university_people_experiences_imports_path return unless @import - @import.persisted? ? add_breadcrumb(@import, admin_university_alumni_experiences_import_path(@import)) + @import.persisted? ? add_breadcrumb(@import, admin_university_people_experiences_import_path(@import)) : add_breadcrumb(t('create')) end diff --git a/app/controllers/admin/university/alumni/experiences_controller.rb b/app/controllers/admin/university/people/experiences_controller.rb similarity index 70% rename from app/controllers/admin/university/alumni/experiences_controller.rb rename to app/controllers/admin/university/people/experiences_controller.rb index 527edb6e9c72d3bc2d7d391db4b4993d70710246..2fbdec31a3503c52bb25dada807cd3c88ce9241e 100644 --- a/app/controllers/admin/university/alumni/experiences_controller.rb +++ b/app/controllers/admin/university/people/experiences_controller.rb @@ -1,5 +1,5 @@ -class Admin::University::Alumni::ExperiencesController < Admin::University::ApplicationController - load_and_authorize_resource :alumnus, +class Admin::University::People::ExperiencesController < Admin::University::ApplicationController + load_and_authorize_resource :person, class: University::Person, through: :current_university, through_association: :people, @@ -9,9 +9,9 @@ class Admin::University::Alumni::ExperiencesController < Admin::University::Appl end def update - if @alumnus.update(experiences_params) - redirect_to admin_university_alumnus_path(@alumnus), - notice: t('admin.successfully_updated_html', model: @alumnus.to_s) + if @person.update(experiences_params) + redirect_to admin_university_person_path(@person), + notice: t('admin.successfully_updated_html', model: @person.to_s) else render :edit breadcrumb @@ -22,9 +22,9 @@ class Admin::University::Alumni::ExperiencesController < Admin::University::Appl def breadcrumb super - add_breadcrumb University::Person::Alumnus.model_name.human(count: 2), - admin_university_alumni_path - add_breadcrumb @alumnus, admin_university_alumnus_path(@alumnus) + add_breadcrumb University::Person.model_name.human(count: 2), + admin_university_people_path + add_breadcrumb @person, admin_university_person_path(@person) add_breadcrumb University::Person::Experience.model_name.human(count: 2) end diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index de26463477670a34d6a36fbaa83c14c23bf7e164..21384cb34a4cb9c4e03ca2b2585c9ab0057313fd 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -88,7 +88,7 @@ class Admin::UsersController < Admin::ApplicationController # Password not provided when user from sso params[:user][:password] ||= '' - if params[:user][:password].empty? + if params[:user][:password].blank? params[:user].delete(:password) else @user.reset_password(params[:user][:password], params[:user][:password]) diff --git a/app/controllers/extranet/account_controller.rb b/app/controllers/extranet/account_controller.rb index 47ded2d779c9b8130fc550c697a9ea505cef683a..ace02aa0c1e5fadb66a76367bb8c6d0ba7fe53b4 100644 --- a/app/controllers/extranet/account_controller.rb +++ b/app/controllers/extranet/account_controller.rb @@ -23,7 +23,7 @@ class Extranet::AccountController < Extranet::ApplicationController # Password not provided when user from sso params[:user][:password] ||= '' - if params[:user][:password].empty? + if params[:user][:password].blank? params[:user].delete(:password) else current_user.reset_password(params[:user][:password], params[:user][:password]) diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 14602622f75515cda898e4677d9a16d52ff1d32c..8cfedc5222a5fa063da0ae499c351d894ee5964e 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -21,7 +21,7 @@ class Users::RegistrationsController < Devise::RegistrationsController # Password not provided when user from sso params[:user][:password] ||= '' - if params[:user][:password].empty? + if params[:user][:password].blank? params[:user].delete(:password) else resource.reset_password(params[:user][:password], params[:user][:password]) diff --git a/app/models/communication/block/template/video.rb b/app/models/communication/block/template/video.rb index de9b378752ee780e5c7aad4f68e52b2d927b1bfc..0e0612d61b86f51883bdc0ff1bf4433d9d8ac71b 100644 --- a/app/models/communication/block/template/video.rb +++ b/app/models/communication/block/template/video.rb @@ -4,6 +4,10 @@ class Communication::Block::Template::Video < Communication::Block::Template::Ba has_component :video_title, :string has_component :transcription, :text + def video_iframe + Video::Provider.find(url).iframe_tag(title: video_title) + end + protected def check_accessibility diff --git a/app/models/communication/extranet/with_sso.rb b/app/models/communication/extranet/with_sso.rb index 223eae3bd898d779d7efa81d081dd0be4f90d274..99504282f19fa76477184e2409786a9fb51b61b4 100644 --- a/app/models/communication/extranet/with_sso.rb +++ b/app/models/communication/extranet/with_sso.rb @@ -10,7 +10,7 @@ module Communication::Extranet::WithSso # Setter to serialize data as JSON def sso_mapping=(value) - if value.empty? + if value.blank? value = nil else value = JSON.parse value if value.is_a? String diff --git a/app/models/import.rb b/app/models/import.rb index 0e7512b8c55885472d778935111c21a007a9be90..d3ebfb313898a94e3b54ae7f60567fb31e867287 100644 --- a/app/models/import.rb +++ b/app/models/import.rb @@ -29,7 +29,7 @@ class Import < ApplicationRecord has_one_attached_deletable :file - enum kind: { organizations: 0, alumni_cohorts: 1, alumni_experiences: 2 }, _prefix: :kind + enum kind: { organizations: 0, alumni_cohorts: 1, people_experiences: 2 }, _prefix: :kind enum status: { pending: 0, finished: 1, finished_with_errors: 2 } validate :file_validation diff --git a/app/models/university/with_sso.rb b/app/models/university/with_sso.rb index 1bf5febd1c1d0a7cb548f084399cdc78d61801e9..d54338223d29efe45d074a9beebd3e00f685a9de 100644 --- a/app/models/university/with_sso.rb +++ b/app/models/university/with_sso.rb @@ -10,7 +10,7 @@ module University::WithSso # Setter to serialize data as JSON def sso_mapping=(value) - if value.empty? + if value.blank? value = nil else value = JSON.parse value if value.is_a? String diff --git a/app/services/importers/alumni_cohorts.rb b/app/services/importers/alumni_cohorts.rb index 2242b8d4ea2bed5e2618b15854aedc54d9e238fe..a225ff76903492b6bdb002b3b5d8fda440721179 100644 --- a/app/services/importers/alumni_cohorts.rb +++ b/app/services/importers/alumni_cohorts.rb @@ -1,5 +1,5 @@ module Importers - class AlumniCohorts < Importers::Alumni + class AlumniCohorts < Base protected @@ -16,58 +16,4 @@ module Importers end - class HashToCohort - def initialize(person, hash) - @university = person.university - @hash = hash - @error = nil - extract_variables - person.add_to_cohort cohort if valid? - end - - def valid? - if school.nil? - @error = "School #{@school_id} not found" - elsif program.nil? - @error = "Program #{@program_id} not found" - elsif academic_year.nil? - @error = "The year #{@year} seems incorrect" - elsif cohort.nil? - @error = "Unable to create the cohort" - end - @error.nil? - end - - def error - @error - end - - protected - - def extract_variables - @school_id = @hash[17].to_s.strip - @program_id = @hash[18].to_s.strip - @year = @hash[19].to_s.strip.to_i - end - - def school - @university.education_schools.find_by(id: @school_id) - end - - def program - @university.education_programs.find_by(id: @program_id) - end - - def academic_year - @academic_year ||= @university.academic_years.where(year: @year).first_or_create - end - - def cohort - @cohort ||= @university.education_cohorts - .where(school: school, program: program, academic_year: academic_year) - .first_or_create - end - - end - end diff --git a/app/services/importers/hash_to_alumnus.rb b/app/services/importers/hash_to_alumnus.rb new file mode 100644 index 0000000000000000000000000000000000000000..bb032cfef39d6c1127187c551108757c13fe5dbf --- /dev/null +++ b/app/services/importers/hash_to_alumnus.rb @@ -0,0 +1,13 @@ +module Importers + class HashToAlumnus < HashToPerson + + def person + @person ||= begin + person = build_person + person.is_alumnus = true + person + end + end + + end +end diff --git a/app/services/importers/hash_to_cohort.rb b/app/services/importers/hash_to_cohort.rb new file mode 100644 index 0000000000000000000000000000000000000000..8cd20a98f5685aeaa276c93673c268d888f60290 --- /dev/null +++ b/app/services/importers/hash_to_cohort.rb @@ -0,0 +1,55 @@ +module Importers + class HashToCohort + def initialize(person, hash) + @university = person.university + @hash = hash + @error = nil + extract_variables + person.add_to_cohort cohort if valid? + end + + def valid? + if school.nil? + @error = "School #{@school_id} not found" + elsif program.nil? + @error = "Program #{@program_id} not found" + elsif academic_year.nil? + @error = "The year #{@year} seems incorrect" + elsif cohort.nil? + @error = "Unable to create the cohort" + end + @error.nil? + end + + def error + @error + end + + protected + + def extract_variables + @school_id = @hash[17].to_s.strip + @program_id = @hash[18].to_s.strip + @year = @hash[19].to_s.strip.to_i + end + + def school + @university.education_schools.find_by(id: @school_id) + end + + def program + @university.education_programs.find_by(id: @program_id) + end + + def academic_year + @academic_year ||= @university.academic_years.where(year: @year).first_or_create + end + + def cohort + @cohort ||= @university.education_cohorts + .where(school: school, program: program, academic_year: academic_year) + .first_or_create + end + + end +end diff --git a/app/services/importers/alumni_experiences.rb b/app/services/importers/hash_to_experience.rb similarity index 82% rename from app/services/importers/alumni_experiences.rb rename to app/services/importers/hash_to_experience.rb index 99b66bb630aedb964051a6bb67d5176c477ca360..8f6e88ffb21358bf44118b21b202df29b990deea 100644 --- a/app/services/importers/alumni_experiences.rb +++ b/app/services/importers/hash_to_experience.rb @@ -1,21 +1,4 @@ module Importers - class AlumniExperiences < Importers::Alumni - - protected - - def analyze_hash(hash, index) - hash_to_alumnus = HashToAlumnus.new(@university, hash) - if hash_to_alumnus.valid? - person = hash_to_alumnus.person - hash_to_experience = HashToExperience.new(person, hash) - add_error(hash_to_experience.error, index + 1) unless hash_to_experience.valid? - else - add_error(hash_to_alumnus.error, index + 1) - end - end - - end - class HashToExperience def initialize(person, hash) @person = person @@ -84,8 +67,5 @@ module Importers obj end end - - end - end diff --git a/app/services/importers/alumni.rb b/app/services/importers/hash_to_person.rb similarity index 58% rename from app/services/importers/alumni.rb rename to app/services/importers/hash_to_person.rb index a539621827601de35f3f42b34f4435e89e57a3c1..72003342e2271cbac7fe9126886f27644f2a7e06 100644 --- a/app/services/importers/alumni.rb +++ b/app/services/importers/hash_to_person.rb @@ -1,16 +1,5 @@ module Importers - class Alumni < Base - - protected - - def analyze_hash(hash, index) - hash_to_alumnus = HashToAlumnus.new(@university, hash) - add_error(hash_to_alumnus.error, index + 1) unless hash_to_alumnus.valid? - end - - end - - class HashToAlumnus + class HashToPerson def initialize(university, hash) @university = university @hash = hash @@ -36,36 +25,7 @@ module Importers end def person - @person ||= begin - if @email.present? - person = @university.people - .where(email: @email) - .first_or_initialize - elsif @first_name.present? && @last_name.present? - person = @university.people - .where(first_name: @first_name, last_name: @last_name) - .first_or_initialize - end - person.first_name = @first_name - person.last_name = @last_name - person.gender = gender - person.birthdate = @birth - person.email = @email - person.url = @url - person.phone_professional = @phone_professional - person.phone_personal = @phone_personal - person.phone_mobile = @mobile - person.address = @address - person.zipcode = @zipcode - person.city = @city - person.country = @country - person.biography = @biography - person.twitter = @social_twitter - person.linkedin = @social_linkedin - person.is_alumnus = true - person.slug = person.to_s.parameterize.dasherize - person - end + @person ||= build_person end protected @@ -90,6 +50,37 @@ module Importers @social_linkedin = @hash[16].to_s.strip end + def build_person + if @email.present? + person = @university.people + .where(email: @email) + .first_or_initialize + elsif @first_name.present? && @last_name.present? + person = @university.people + .where(first_name: @first_name, last_name: @last_name) + .first_or_initialize + end + person.first_name = @first_name + person.last_name = @last_name + person.gender = gender + person.birthdate = @birth + person.email = @email + person.url = @url + person.phone_professional = @phone_professional + person.phone_personal = @phone_personal + person.phone_mobile = @mobile + person.address = @address + person.zipcode = @zipcode + person.city = @city + person.country = @country + person.biography = @biography + person.twitter = @social_twitter + person.linkedin = @social_linkedin + person.slug = person.to_s.parameterize.dasherize + person.language_id = @university.default_language_id + person + end + def country_not_found? ISO3166::Country[@country].nil? end diff --git a/app/services/importers/people_experiences.rb b/app/services/importers/people_experiences.rb new file mode 100644 index 0000000000000000000000000000000000000000..9e54d1473459ced84b8e93dfd28cc2dedd6ec016 --- /dev/null +++ b/app/services/importers/people_experiences.rb @@ -0,0 +1,18 @@ +module Importers + class PeopleExperiences < Base + + protected + + def analyze_hash(hash, index) + hash_to_person = HashToPerson.new(@university, hash) + if hash_to_person.valid? + person = hash_to_person.person + hash_to_experience = HashToExperience.new(person, hash) + add_error(hash_to_experience.error, index + 1) unless hash_to_experience.valid? + else + add_error(hash_to_person.error, index + 1) + end + end + + end +end diff --git a/app/services/importers/person.rb b/app/services/importers/person.rb new file mode 100644 index 0000000000000000000000000000000000000000..90c3827b4748f7c285bde819c8b1d4a848842f69 --- /dev/null +++ b/app/services/importers/person.rb @@ -0,0 +1,13 @@ +module Importers + class Person < Base + + protected + + def analyze_hash(hash, index) + hash_to_person = HashToPerson.new(@university, hash) + add_error(hash_to_person.error, index + 1) unless hash_to_person.valid? + end + + end + +end diff --git a/app/services/video/provider.rb b/app/services/video/provider.rb new file mode 100644 index 0000000000000000000000000000000000000000..5b6f3fd68892b3651781a45f47d6e700b448b53a --- /dev/null +++ b/app/services/video/provider.rb @@ -0,0 +1,20 @@ +class Video::Provider + PROVIDERS = [ + Vimeo, + Youtube, + Dailymotion + ] + + def self.find(video_url) + PROVIDERS.each do |provider| + return provider.new(video_url) if url_in_domains?(video_url, provider::DOMAINS) + end + Default.new(video_url) + end + + protected + + def self.url_in_domains?(url, domains) + domains.any? { |domain| url.include? domain } + end +end diff --git a/app/services/video/provider/dailymotion.rb b/app/services/video/provider/dailymotion.rb new file mode 100644 index 0000000000000000000000000000000000000000..3a66f5fa5797fd35e2b617b3e45fac6237d77bec --- /dev/null +++ b/app/services/video/provider/dailymotion.rb @@ -0,0 +1,15 @@ +class Video::Provider::Dailymotion < Video::Provider::Default + DOMAINS = ['dailymotion.com', 'dai.ly'] + + # "https://www.dailymotion.com/video/x35l6b8" + # "https://dai.ly/x35l6b8" + def identifier + video_url.include?('dai.ly') ? video_url.split('dai.ly/').last + : video_url.split('video/').last + end + + # https://developer.dailymotion.com/player#player-parameters + def iframe_url + "https://www.dailymotion.com/embed/video/#{identifier}" + end +end diff --git a/app/services/video/provider/default.rb b/app/services/video/provider/default.rb new file mode 100644 index 0000000000000000000000000000000000000000..336e8e7aaa27216a09f189c9fc7afee93b43e7cb --- /dev/null +++ b/app/services/video/provider/default.rb @@ -0,0 +1,29 @@ +class Video::Provider::Default + attr_reader :video_url + + include ActionView::Helpers::TagHelper + + def initialize(video_url) + @video_url = video_url + end + + def platform + self.class.name.demodulize.downcase.to_sym + end + + def iframe_url + video_url + end + + def iframe_tag(**iframe_options) + content_tag(:iframe, nil, default_iframe_options.merge(iframe_options)) + end + + def default_iframe_options + { + class: (platform == :default ? nil : platform), + loading: 'lazy', + src: iframe_url + } + end +end diff --git a/app/services/video/provider/vimeo.rb b/app/services/video/provider/vimeo.rb new file mode 100644 index 0000000000000000000000000000000000000000..3d10b85440226a7be369e69398803dba4cd20d8b --- /dev/null +++ b/app/services/video/provider/vimeo.rb @@ -0,0 +1,13 @@ +class Video::Provider::Vimeo < Video::Provider::Default + DOMAINS = ['vimeo.com'] + + # "https://vimeo.com/248482251" + def identifier + video_url.chomp('/').split('/').last + end + + # https://help.vimeo.com/hc/en-us/articles/360001494447-Using-Player-Parameters + def iframe_url + "https://player.vimeo.com/video/#{identifier}" + end +end diff --git a/app/services/video/provider/youtube.rb b/app/services/video/provider/youtube.rb new file mode 100644 index 0000000000000000000000000000000000000000..e9fa299e10619d5ff763a0275c65f1a87718d92e --- /dev/null +++ b/app/services/video/provider/youtube.rb @@ -0,0 +1,15 @@ +class Video::Provider::Youtube < Video::Provider::Default + DOMAINS = ['youtube.com', 'youtu.be'] + + # "https://www.youtube.com/watch?v=sN8Cq5HEBug" + # "https://youtu.be/sN8Cq5HEBug" + def identifier + video_url.include?('youtu.be') ? video_url.split('youtu.be/').last + : video_url.split('v=').last + end + + # https://developers.google.com/youtube/player_parameters + def iframe_url + "https://www.youtube.com/embed/#{identifier}" + end +end diff --git a/app/views/admin/application/meta_description/_form.html.erb b/app/views/admin/application/meta_description/_form.html.erb index cc698e0303658fe8bf52f5d0e9f13423d9d7a4fd..0deb74c7d2cb85c05148f67e4e8f7a97ccbe344a 100644 --- a/app/views/admin/application/meta_description/_form.html.erb +++ b/app/views/admin/application/meta_description/_form.html.erb @@ -1,8 +1,8 @@ -<%= osuny_panel t('admin.summary') do %> +<%= osuny_panel t('admin.seo') do %> <%= f.input :meta_description, label: t('admin.meta_description.label'), hint: t('admin.meta_description.hint'), input_html: { value: about.meta_description&.gsub('&', '&') } %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/admin/communication/blocks/templates/call_to_action/_preview.html.erb b/app/views/admin/communication/blocks/templates/call_to_action/_preview.html.erb index 6a03d093e686c5cb7e1b48d9f15ae8a4b2be2960..ae6f329affaf5a9a0e7150f7f70d05f4c046dfc3 100644 --- a/app/views/admin/communication/blocks/templates/call_to_action/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/call_to_action/_preview.html.erb @@ -1,6 +1,6 @@ <% -$class = "block block-call_to_action" -unless @block.title.empty? +$class = "block block-call_to_action" +unless @block.title.blank? $class += " block-with-title" end @@ -13,7 +13,7 @@ $image_class = "call_to_action--with" + (@block.template.image.empty? ? "out" : <div class="block-content"> <div class="call_to_action <%= $image_class %>"> <div> - <% unless @block.title.empty? %> + <% unless @block.title.blank? %> <h2><%= @block.title %></h2> <% end %> <% if @block.template.text %> diff --git a/app/views/admin/communication/blocks/templates/chapter/_preview.html.erb b/app/views/admin/communication/blocks/templates/chapter/_preview.html.erb index f36ccec40db610e045ce3c58cde75630969ced50..1be71e833ea3c6e71f390bff03dba5d6877661ed 100644 --- a/app/views/admin/communication/blocks/templates/chapter/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/chapter/_preview.html.erb @@ -1,7 +1,7 @@ <% -$class = "block block-chapter" +$class = "block block-chapter" -unless @block.title.empty? +unless @block.title.blank? $class += " block-with-title" end @@ -18,17 +18,17 @@ $class += " block-chapter--" + @block.template.layout <div class="block-content"> <div class="chapter"> <div class="text"> - <% unless @block.title.empty? %> + <% unless @block.title.blank? %> <div class="top"> <h2><%= @block.title %></h2> </div> <% end %> - <% unless @block.template.text.empty? %> + <% unless @block.template.text.blank? %> <div class="rich-text"> <%= block_component_preview :text %> </div> <% end %> - <% unless @block.template.notes.empty? %> + <% unless @block.template.notes.blank? %> <div class="notes"> <%= block_component_preview :notes %> </div> diff --git a/app/views/admin/communication/blocks/templates/contact/_preview.html.erb b/app/views/admin/communication/blocks/templates/contact/_preview.html.erb index 3ffb5a299fdd15e417451447d297829e6ac3f65e..9a617582b13cab08266f6fa1c5ab33d85cae7e28 100644 --- a/app/views/admin/communication/blocks/templates/contact/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/contact/_preview.html.erb @@ -1,6 +1,6 @@ <% -$class = "block block-contact" -unless @block.title.empty? +$class = "block block-contact" +unless @block.title.blank? $class += " block-with-title" end %> @@ -8,12 +8,12 @@ end <section class="<%= $class %>"> <div class="container"> <div class="block-content"> - <% unless @block.title.empty? && @block.template.description.empty? %> + <% unless @block.title.blank? && @block.template.description.blank? %> <div class="top"> - <% unless @block.title.empty? %> + <% unless @block.title.blank? %> <h2><%= @block.title %></h2> <% end %> - <% unless @block.template.description.empty? %> + <% unless @block.template.description.blank? %> <div class="description"> <p><%= block_component_preview :description %></p> </div> @@ -23,7 +23,7 @@ end <div class="informations"> <address itemscope itemtype="https://schema.org/Organization"> - <% unless @block.template.name.empty? %> + <% unless @block.template.name.blank? %> <p><%= block_component_preview :name %></p> <% end %> <div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress"> diff --git a/app/views/admin/communication/blocks/templates/datatable/_preview.html.erb b/app/views/admin/communication/blocks/templates/datatable/_preview.html.erb index 4f28c5ab2a22c59949a857416b8188b71a36e63e..fdd161bde54b44ad473f41e1ef64b24d634e20d6 100644 --- a/app/views/admin/communication/blocks/templates/datatable/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/datatable/_preview.html.erb @@ -1,18 +1,18 @@ <% -$class = "block block-datatable" -unless @block.title.empty? +$class = "block block-datatable" +unless @block.title.blank? $class += " block-with-title" end %> <section class="<%= $class %>"> <div class="container"> <div class="block-content"> - <% unless @block.title.empty? && @block.template.description.empty? %> + <% unless @block.title.blank? && @block.template.description.blank? %> <div class="top"> - <% unless @block.title.empty? %> + <% unless @block.title.blank? %> <h2><%= @block.title %></h2> <% end %> - <% unless @block.template.description.empty? %> + <% unless @block.template.description.blank? %> <div class="description"> <p><%= block_component_preview :description %></p> </div> @@ -21,7 +21,7 @@ end <% end %> <div class="table-responsive"> <table> - <% unless @block.template.caption.empty? %> + <% unless @block.template.caption.blank? %> <caption><%= block_component_preview :caption %></caption> <% end %> <thead> diff --git a/app/views/admin/communication/blocks/templates/definitions/_preview.html.erb b/app/views/admin/communication/blocks/templates/definitions/_preview.html.erb index 62af80feb66c094adcb5a493413aac9935b8b4e0..6770c718db2441be651771243356072bc485a695 100644 --- a/app/views/admin/communication/blocks/templates/definitions/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/definitions/_preview.html.erb @@ -1,6 +1,6 @@ <% - $class = "block block-definitions" - unless @block.title.empty? + $class = "block block-definitions" + unless @block.title.blank? $class += " block-with-title" end %> @@ -8,12 +8,12 @@ <section class="<%= $class %>"> <div class="container"> <div class="block-content"> - <% unless @block.title.empty? && @block.template.description.empty? %> + <% unless @block.title.blank? && @block.template.description.blank? %> <div class="top"> - <% unless @block.title.empty? %> + <% unless @block.title.blank? %> <h2><%= @block.title %></h2> <% end %> - <% unless @block.template.description.empty? %> + <% unless @block.template.description.blank? %> <div class="description"> <p><%= block_component_preview :description %></p> </div> diff --git a/app/views/admin/communication/blocks/templates/files/_preview.html.erb b/app/views/admin/communication/blocks/templates/files/_preview.html.erb index d216be4a0be9c25f95ec5f8ca10b73b89fb0b318..54f32745652572c91bccae0cb1f3a9c0493b7812 100644 --- a/app/views/admin/communication/blocks/templates/files/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/files/_preview.html.erb @@ -1,6 +1,6 @@ <% -$class = "block block-files" -unless @block.title.empty? +$class = "block block-files" +unless @block.title.blank? $class += " block-with-title" end %> @@ -8,19 +8,19 @@ end <section class="<%= $class %>"> <div class="container"> <div class="block-content"> - <% unless @block.title.empty? && @block.template.description.empty? %> + <% unless @block.title.blank? && @block.template.description.blank? %> <div class="top"> - <% unless @block.title.empty? %> + <% unless @block.title.blank? %> <h2><%= @block.title %></h2> <% end %> - <% unless @block.template.description.empty? %> + <% unless @block.template.description.blank? %> <div class="description"> <p><%= block_component_preview :description %></p> </div> <% end %> </div> <% end %> - + <ul class="files"> <% @block.template.elements.each do |element| %> <% next unless element.blob %> diff --git a/app/views/admin/communication/blocks/templates/gallery/_preview.html.erb b/app/views/admin/communication/blocks/templates/gallery/_preview.html.erb index 9b2901cf2f8b23ba5938d548365a98dbc23edd6b..fadc3f4aa401aa1426ebf55e62b5c492fb4873eb 100644 --- a/app/views/admin/communication/blocks/templates/gallery/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/gallery/_preview.html.erb @@ -1,6 +1,6 @@ <% -$class = "block block-gallery" -unless @block.title.empty? +$class = "block block-gallery" +unless @block.title.blank? $class += " block-with-title" end @@ -11,12 +11,12 @@ $class += " block-gallery--" + @block.template.layout <div class="container"> <div class="block-content"> <div class="top"> - <% unless @block.title.empty? && @block.template.description.empty? %> + <% unless @block.title.blank? && @block.template.description.blank? %> <div class="top"> - <% unless @block.title.empty? %> + <% unless @block.title.blank? %> <h2><%= @block.title %></h2> <% end %> - <% unless @block.template.description.empty? %> + <% unless @block.template.description.blank? %> <div class="description"> <p><%= block_component_preview :description %></p> </div> @@ -30,7 +30,7 @@ $class += " block-gallery--" + @block.template.layout <div class="splide__track"> <div class="splide__list"> <% end %> - <% @block.template.elements.each do |element| %> + <% @block.template.elements.each do |element| %> <%= block_component_preview :image, template: element %> <% end %> <% if !@block.template.elements.one? %> @@ -40,7 +40,7 @@ $class += " block-gallery--" + @block.template.layout <% end %> <% else %> <div class="gallery" role="group"> - <% @block.template.elements.each do |element| %> + <% @block.template.elements.each do |element| %> <%= block_component_preview :image, template: element %> <% end %> </div> diff --git a/app/views/admin/communication/blocks/templates/image/_preview.html.erb b/app/views/admin/communication/blocks/templates/image/_preview.html.erb index 7974851a3ce20c28fc0e4f552f61b220052bfd44..cdb2997ed03d37cf8861f6581f40d0430957d78f 100644 --- a/app/views/admin/communication/blocks/templates/image/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/image/_preview.html.erb @@ -1,14 +1,14 @@ <% -$class = "block block-image" +$class = "block block-image" -unless @block.title.empty? +unless @block.title.blank? $class += " block-with-title" end %> <section class="<%= $class %>"> <div class="container"> <div class="block-content"> - <% unless @block.title.empty? %> + <% unless @block.title.blank? %> <div class="top"> <h2><%= @block.title %></h2> </div> diff --git a/app/views/admin/communication/blocks/templates/key_figures/_preview.html.erb b/app/views/admin/communication/blocks/templates/key_figures/_preview.html.erb index 6dab913578249b03576ca3dbe438c444d700d5c5..4ca7f51f60737fd74aff8d0b24c857cfe1225354 100644 --- a/app/views/admin/communication/blocks/templates/key_figures/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/key_figures/_preview.html.erb @@ -1,18 +1,18 @@ <% -$class = "block block-key_figures" -unless @block.title.empty? +$class = "block block-key_figures" +unless @block.title.blank? $class += " block-with-title" end %> <section class="<%= $class %>"> <div class="container"> <div class="block-content"> - <% unless @block.title.empty? && @block.template.description.empty? %> + <% unless @block.title.blank? && @block.template.description.blank? %> <div class="top"> - <% unless @block.title.empty? %> + <% unless @block.title.blank? %> <h2><%= @block.title %></h2> <% end %> - <% unless @block.template.description.empty? %> + <% unless @block.template.description.blank? %> <div class="description"> <p><%= block_component_preview :description %></p> </div> diff --git a/app/views/admin/communication/blocks/templates/testimonials/_preview.html.erb b/app/views/admin/communication/blocks/templates/testimonials/_preview.html.erb index f9704ebdb3151ff10f143f861ebfb215a83ca1ea..b8c2e89d9a2ccffd7558b8ee55403cd528deb6bd 100644 --- a/app/views/admin/communication/blocks/templates/testimonials/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/testimonials/_preview.html.erb @@ -1,6 +1,6 @@ <% - $class = "block block-testimonials" - unless @block.title.empty? + $class = "block block-testimonials" + unless @block.title.blank? $class += " block-with-title" end if !@block.template.elements.one? @@ -13,7 +13,7 @@ <div class="block-content"> <div class="testimonials"> <% if !@block.template.elements.one? %> - <div class="splide" + <div class="splide" data-splide='{ "arrows":false, "autoplay":true, diff --git a/app/views/admin/communication/blocks/templates/timeline/_preview.html.erb b/app/views/admin/communication/blocks/templates/timeline/_preview.html.erb index 81a435c18ab10f934ce1072ec88938664a85b96a..d52b51e2b9e76058476b0742e94d2239aa8d34ee 100644 --- a/app/views/admin/communication/blocks/templates/timeline/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/timeline/_preview.html.erb @@ -1,6 +1,6 @@ <% - $class = "block block-timeline" - unless @block.title.empty? + $class = "block block-timeline" + unless @block.title.blank? $class += " block-with-title" end $class += " block-timeline--" + @block.template.layout @@ -10,7 +10,7 @@ <div class="container"> <% if @block.template.layout == "vertical" %> <div class="block-content"> - <% unless @block.title.empty? %> + <% unless @block.title.blank? %> <div class="top"> <h2><%= @block.title %></h2> </div> @@ -28,7 +28,7 @@ </div> <% else %> <div class="timeline"> - <% unless @block.title.empty? %> + <% unless @block.title.blank? %> <h2><%= @block.title %></h2> <% end %> <div class="events"> diff --git a/app/views/admin/communication/blocks/templates/video/_preview.html.erb b/app/views/admin/communication/blocks/templates/video/_preview.html.erb index 97321d70e108f4fa94386bbaed94bda33eb14702..1dc6895c1543ca1fdabff59fcb57d0c5db5cdcd3 100644 --- a/app/views/admin/communication/blocks/templates/video/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/video/_preview.html.erb @@ -1,25 +1,20 @@ <% -$class = "block block-video" -unless @block.title.empty? +$class = "block block-video" +unless @block.title.blank? $class += " block-with-title" end %> <section class="<%= $class %>"> <div class="container"> <div class="block-content"> - <% unless @block.title.empty? %> + <% unless @block.title.blank? %> <div class="top"> <h2><%= @block.title %></h2> </div> <% end %> - <% if @block.template.url %> + <% if @block.template.url.present? %> <div class="video"> - <%# TODO: identification du provider de la vidéo %> - <iframe - src="<%= block_component_preview :url %>" - title="<%= block_component_preview :video_title %>" - loading="lazy" - ></iframe> + <%= @block.template.video_iframe %> </div> <% end %> <% if @block.template.video_title %> diff --git a/app/views/admin/communication/blocks/templates/video/_static.html.erb b/app/views/admin/communication/blocks/templates/video/_static.html.erb index ca779a451ec5b3d8212f816dc1df3ec7933a4ea8..ad5aae3546b5a64753c64decc27f1b8154a841f5 100644 --- a/app/views/admin/communication/blocks/templates/video/_static.html.erb +++ b/app/views/admin/communication/blocks/templates/video/_static.html.erb @@ -1,3 +1,7 @@ <%= block_component_static :url %> <%= block_component_static :video_title %> +<% if block.template.url.present? %> + video_iframe: >- + <%= block.template.video_iframe %> +<% end %> <%= block_component_static :transcription %> diff --git a/app/views/admin/communication/extranets/_form.html.erb b/app/views/admin/communication/extranets/_form.html.erb index 62246a4bc018bc966a6e44890cdecf4083468d69..eef002e8e81176d5512e22bc0b363c067fc711ec 100644 --- a/app/views/admin/communication/extranets/_form.html.erb +++ b/app/views/admin/communication/extranets/_form.html.erb @@ -30,7 +30,7 @@ <%= osuny_panel t('extranet.features') do %> <%= f.input :feature_alumni %> <%= f.input :feature_contacts %> - <%= f.input :feature_assets %> + <%= f.input :feature_library %> <%= f.input :feature_posts %> <%= f.input :feature_jobs %> <% end %> diff --git a/app/views/admin/research/laboratories/axes/show.html.erb b/app/views/admin/research/laboratories/axes/show.html.erb index e0691afb6c498430efe9c1515bd44e99d6841459..307fee70fe72b075195f9d58d0bb3fa18f3cb6f4 100644 --- a/app/views/admin/research/laboratories/axes/show.html.erb +++ b/app/views/admin/research/laboratories/axes/show.html.erb @@ -3,7 +3,7 @@ <div class="row"> <div class="col-md-8"> <%= osuny_panel t('content') do %> - <% unless @axis.short_name.empty? %> + <% unless @axis.short_name.blank? %> <%= osuny_label Research::Laboratory::Axis.human_attribute_name('short_name') %> <p><%= @axis.short_name %></p> <% end %> diff --git a/app/views/admin/university/alumni/_list.html.erb b/app/views/admin/university/alumni/_list.html.erb index 9d171e73e1f653f1502d1ad7a356fbaee6567db4..f0e1db78bacc2b6e57eb8a810ef3399ba3572d2b 100644 --- a/app/views/admin/university/alumni/_list.html.erb +++ b/app/views/admin/university/alumni/_list.html.erb @@ -5,7 +5,6 @@ <th><%= University::Person.human_attribute_name('last_name') %></th> <th><%= University::Person.human_attribute_name('first_name') %></th> <th><%= Education::Cohort.model_name.human(count: 2) %></th> - <th><%= University::Person::Experience.model_name.human(count: 2) %></th> <th></th> </tr> </thead> @@ -16,7 +15,6 @@ <td><%= link_to_if can?(:read, alumnus), alumnus.last_name, path %></td> <td><%= link_to_if can?(:read, alumnus), alumnus.first_name, path %></td> <td><%= link_to_if can?(:update, alumnus), alumnus.cohorts.size, cohorts_admin_university_alumnus_path(alumnus) %></td> - <td><%= link_to_if can?(:update, alumnus), alumnus.experiences.size, experiences_admin_university_alumnus_path(alumnus) %></td> <td><%= kamifusen_tag alumnus.best_picture, width: 80 if alumnus.best_picture.attached? %></td> </tr> <% end %> diff --git a/app/views/admin/university/alumni/experiences/imports/index.html.erb b/app/views/admin/university/alumni/experiences/imports/index.html.erb deleted file mode 100644 index 58402622cb6c33df962a90859662f25ce6c34df0..0000000000000000000000000000000000000000 --- a/app/views/admin/university/alumni/experiences/imports/index.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<% content_for :title, t('university.alumni.experiences.title') %> - -<%= render 'filters', current_path: admin_university_alumni_experiences_imports_path, filters: @filters if @filters.any? %> - -<%= render 'admin/imports/list', imports: @imports, path_pattern: 'admin_university_alumni_experiences_import_path' %> - -<% content_for :action_bar_right do %> - <%= link_to_if can?(:create, University::Person::Alumnus), - t('create'), - new_admin_university_alumni_experiences_import_path, - class: button_classes %> -<% end %> diff --git a/app/views/admin/university/alumni/index.html.erb b/app/views/admin/university/alumni/index.html.erb index c6a436b4cbbd66fe9a86e1d6041024508bc43d40..ca8c4e7a7822b32001a7ac72ef828cc6bf309fd6 100644 --- a/app/views/admin/university/alumni/index.html.erb +++ b/app/views/admin/university/alumni/index.html.erb @@ -10,9 +10,6 @@ <%= link_to t('university.alumni.cohorts.import_btn'), new_admin_university_alumni_cohorts_import_path, class: button_classes if can? :create, University::Person::Alumnus %> - <%= link_to t('university.alumni.experiences.import_btn'), - new_admin_university_alumni_experiences_import_path, - class: button_classes if can? :create, University::Person::Alumnus %> <% end %> <% content_for :action_bar_right do %> diff --git a/app/views/admin/university/alumni/show.html.erb b/app/views/admin/university/alumni/show.html.erb index d5723d063c9c20535a5121bcdfd3ac11a4178c3b..c3bc9573280e41fface0ad6ede4bf350f934dc2a 100644 --- a/app/views/admin/university/alumni/show.html.erb +++ b/app/views/admin/university/alumni/show.html.erb @@ -12,16 +12,6 @@ action += link_to t('university.manage_cohorts'), <%= render 'admin/education/cohorts/list', cohorts: @alumnus.cohorts.ordered %> <% end %> -<% -action = '' -action += link_to t('university.manage_experiences'), - experiences_admin_university_alumnus_path(@alumnus), - class: button_classes if can?(:update, @alumnus) -%> -<%= osuny_panel University::Person::Experience.model_name.human(count: 2), action: action do %> - <%= render 'admin/university/people/experiences/list', experiences: @alumnus.experiences.ordered %> -<% end %> - <% content_for :action_bar_right do %> <%= edit_link @alumnus %> <% end %> diff --git a/app/views/admin/university/people/_list.html.erb b/app/views/admin/university/people/_list.html.erb index f2bd77eecbf84558deecf302b1cbfe0605629d50..9b9fe26e704772d04186e68bc20c361d00c78a6a 100644 --- a/app/views/admin/university/people/_list.html.erb +++ b/app/views/admin/university/people/_list.html.erb @@ -5,6 +5,7 @@ <th><%= University::Person.human_attribute_name('last_name') %></th> <th><%= University::Person.human_attribute_name('first_name') %></th> <th><%= University::Person.human_attribute_name('roles') %></th> + <th><%= University::Person::Experience.model_name.human(count: 2) %></th> <th></th> <th></th> </tr> @@ -21,6 +22,7 @@ </span> <% end %> </td> + <td><%= link_to_if can?(:update, person), person.experiences.size, experiences_admin_university_person_path(person) %></td> <td> <%= kamifusen_tag person.best_picture, width: 80 if person.best_picture.attached? %> diff --git a/app/views/admin/university/alumni/experiences/_experience_fields.html.erb b/app/views/admin/university/people/experiences/_experience_fields.html.erb similarity index 100% rename from app/views/admin/university/alumni/experiences/_experience_fields.html.erb rename to app/views/admin/university/people/experiences/_experience_fields.html.erb diff --git a/app/views/admin/university/alumni/experiences/edit.html.erb b/app/views/admin/university/people/experiences/edit.html.erb similarity index 66% rename from app/views/admin/university/alumni/experiences/edit.html.erb rename to app/views/admin/university/people/experiences/edit.html.erb index 6e203626ca4e8a15ae479094e6f05bd3ea6fc4dc..8d3671123a7bb18b6c23981fd4ac09079726c282 100644 --- a/app/views/admin/university/alumni/experiences/edit.html.erb +++ b/app/views/admin/university/people/experiences/edit.html.erb @@ -1,14 +1,14 @@ -<% content_for :title, @alumnus %> +<% content_for :title, @person %> <h2 class="h3"><%= University::Person::Experience.model_name.human(count: 2) %></h2> -<%= simple_form_for [:admin, @alumnus], url: experiences_admin_university_alumnus_path(@alumnus) do |f| %> +<%= simple_form_for [:admin, @person], url: experiences_admin_university_person_path(@person) do |f| %> <%= f.error_notification %> <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> <div class="mb-3"> - <%= link_to_add_association t('add'), - f, + <%= link_to_add_association t('add'), + f, :experiences, class: button_classes, data: { @@ -18,8 +18,8 @@ </div> <div id="experiences"> - <%= f.simple_fields_for :experiences, @alumnus.experiences.ordered, include_id: false do |experience_f| %> - <%= render 'admin/university/alumni/experiences/experience_fields', f: experience_f, include_id: true %> + <%= f.simple_fields_for :experiences, @person.experiences.ordered, include_id: false do |experience_f| %> + <%= render 'admin/university/people/experiences/experience_fields', f: experience_f, include_id: true %> <% end %> </div> diff --git a/app/views/admin/university/people/experiences/imports/index.html.erb b/app/views/admin/university/people/experiences/imports/index.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..c4b1abb8175721ea1323db70ad494d56f5466460 --- /dev/null +++ b/app/views/admin/university/people/experiences/imports/index.html.erb @@ -0,0 +1,12 @@ +<% content_for :title, t('university.person.experiences.title') %> + +<%= render 'filters', current_path: admin_university_people_experiences_imports_path, filters: @filters if @filters.any? %> + +<%= render 'admin/imports/list', imports: @imports, path_pattern: 'admin_university_people_experiences_import_path' %> + +<% content_for :action_bar_right do %> + <%= link_to_if can?(:create, University::Person::Experience), + t('create'), + new_admin_university_people_experiences_import_path, + class: button_classes %> +<% end %> diff --git a/app/views/admin/university/alumni/experiences/imports/new.html.erb b/app/views/admin/university/people/experiences/imports/new.html.erb similarity index 96% rename from app/views/admin/university/alumni/experiences/imports/new.html.erb rename to app/views/admin/university/people/experiences/imports/new.html.erb index 88246e722177c3023cd9b609cbef6fd117c942b4..38a41bb9660fe2f4a09058c28ff04236749fce36 100644 --- a/app/views/admin/university/alumni/experiences/imports/new.html.erb +++ b/app/views/admin/university/people/experiences/imports/new.html.erb @@ -5,10 +5,10 @@ <p> <%= t('imports.hint_html') %> <br> - <%= t('university.alumni.experiences.import_hint_html') %> + <%= t('university.person.experiences.import_hint_html') %> </p> <%= simple_form_for @import, - url: admin_university_alumni_experiences_imports_path do |f| %> + url: admin_university_people_experiences_imports_path do |f| %> <%= f.error_notification %> <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> diff --git a/app/views/admin/university/people/index.html.erb b/app/views/admin/university/people/index.html.erb index df601c13f7ed7424fe37ef9a2f4e46cd067630ee..abb5ce6a2b3a1088433192174c6ce279e2cdc0e1 100644 --- a/app/views/admin/university/people/index.html.erb +++ b/app/views/admin/university/people/index.html.erb @@ -5,6 +5,12 @@ <%= render 'admin/university/people/list', people: @people %> <%= paginate @people, theme: 'bootstrap-5' %> +<% content_for :action_bar_left do %> + <%= link_to t('university.person.experiences.import_btn'), + new_admin_university_people_experiences_import_path, + class: button_classes if can? :create, University::Person::Experience %> +<% end %> + <% content_for :action_bar_right do %> <%= create_link University::Person %> <% end %> diff --git a/app/views/admin/university/people/show.html.erb b/app/views/admin/university/people/show.html.erb index 04860079369f4da22da092075addb163c770f325..485f258b582b51e840b49709353e2089e7ca5581 100644 --- a/app/views/admin/university/people/show.html.erb +++ b/app/views/admin/university/people/show.html.erb @@ -21,6 +21,16 @@ </div> <% end %> +<% +action = '' +action += link_to t('university.manage_experiences'), + experiences_admin_university_person_path(@person), + class: button_classes if can?(:update, @person) +%> +<%= osuny_panel University::Person::Experience.model_name.human(count: 2), action: action do %> + <%= render 'admin/university/people/experiences/list', experiences: @person.experiences.ordered %> +<% end %> + <% content_for :action_bar_left do %> <%= destroy_link @person %> <%= static_link static_admin_university_person_path(@person) %> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 6d452571ac0ac8418b395fd8e43f9b6bbea89663..66cb912bd3ecb57c4db5b03fd4a6882e6852d0f0 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -65,10 +65,10 @@ en: description: Espaces d'échanges sécurisés dédiés aux personnes authentifiées favicon: Favicon (.png) feature_alumni: Alumni - feature_files: Documents feature_contacts: Directory - feature_posts: News feature_jobs: Job board + feature_library: Documents + feature_posts: News has_sso: Has SSO? home_sentence: Sentence displayed on homepage host: Domain diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 2322491e709931f8d09738479b70d972d35ead3e..d5129e4f8932bd7902f731506cea13d9effd5ba1 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -65,10 +65,10 @@ fr: description: Espaces d'échanges sécurisés dédiés aux personnes authentifiées favicon: Favicon (.png) feature_alumni: Alumni - feature_library: Documents feature_contacts: Annuaire - feature_posts: Actualités feature_jobs: Offres d'emploi + feature_library: Documents + feature_posts: Actualités has_sso: A un SSO ? home_sentence: Phrase affichée sur la home host: Domaine diff --git a/config/locales/en.yml b/config/locales/en.yml index 532844c10cdc8e5f195020193a84ec7ca872bc66..56de4b0f1de4e3d1c3fffac4742cb6e1bf294c56 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -105,6 +105,7 @@ en: label: Background tasks pending hint: Those tasks precompute your data in order to minimize its carbon footprint. It creates a delay before your changes are online. password_hint: Leave blank if you do not wish to change the password. + seo: SEO successfully_created_html: "<i>%{model}</i> was successfully created." successfully_destroyed_html: "<i>%{model}</i> was successfully destroyed." successfully_duplicated_html: "<i>%{model}</i> was successfully duplicated." diff --git a/config/locales/fr.yml b/config/locales/fr.yml index ba028427c365e4174f854e6f32431cb116fc07e8..711fa805dbedff947b0f666147be92f0b97f1ddb 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -105,6 +105,7 @@ fr: label: Tâches en cours de traitement hint: L'exécution de ces tâches contribue à diminuer l'empreinte carbone du numérique, en précalculant ce qui peut l'être. Cela peut générer un délai avant que vos modifications ne soient visibles. password_hint: Laissez vide si vous ne souhaitez pas modifier le mot de passe. + seo: SEO successfully_created_html: "<i>%{model}</i> a bien été créé(e)." successfully_destroyed_html: "<i>%{model}</i> a bien été détruit(e)." successfully_duplicated_html: "<i>%{model}</i> a bien été dupliqué(e)." @@ -202,7 +203,7 @@ fr: imports: error_msg: "Ligne %{line} : %{error}" errors: Erreurs - hint_html: "Les données doivent être au format xlsx.<br>La première ligne doit être dédiée aux entêtes.<br>Les noms des entêtes sont obligatoires et doivent être respectés strictement.<br>Les caractères doivent être encodés en UTF-8.<br>Les champs marqués d'une astérisque sont obligatoires." + hint_html: "Les données doivent être au format xlsx.<br>La première ligne doit être dédiée aux en-têtes.<br>Les noms des entêtes sont obligatoires et doivent être respectés strictement.<br>Les caractères doivent être encodés en UTF-8.<br>Les champs marqués d'une astérisque sont obligatoires." initiated_by: "Initié par :" number_of_lines: "Nombre de lignes dans le fichier :" status: "Status :" diff --git a/config/locales/university/en.yml b/config/locales/university/en.yml index b71021709b80578c36b747a0c278993028422419..1958db7928d4368fc45c70cc5542c3b85ceb0ee4 100644 --- a/config/locales/university/en.yml +++ b/config/locales/university/en.yml @@ -188,10 +188,6 @@ en: import_btn: Import cohorts import_hint_html: "Possible values for <i>gender</i> are: m (male), f (female) and n (non binary).<br><i>Phone_professional</i>, <i>phone_personal</i>, <i>mobile</i> and <i>zipcode</i> fields must have a text format, not numbers.<br><i>Country</i> field must contain the ISO 3166 code of the country, so 2 upcase characters (<a href=\"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\" target=\_blank\">list</a>).<br><i>Social_twitter</i> field should have no @.<br><i>School</i> field should contain the internal school id.<br><i>Program</i> field should contain the internal program id." title: Cohorts imports - experiences: - import_btn: Import experiences - import_hint_html: "Possible values for <i>gender</i> are: m (male), f (female) and n (non binary).<br><i>Phone_professional</i>, <i>phone_personal</i>, <i>mobile</i> and <i>zipcode</i> fields must have a text format, not numbers.<br><i>Country</i> field must contain the ISO 3166 code of the country, so 2 upcase characters (<a href=\"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\" target=\_blank\">list</a>).<br><i>Social_twitter</i> field should have no @." - title: Experiences imports description: text: Une université est une institution d'enseignement supérieur, d'étude et de recherche, constituée par la réunion de divers établissements nommés suivant les traditions “collègesâ€, “facultésâ€, “institutsâ€, “départementsâ€, “centresâ€, “sectionsâ€, “unités†ou écoles spécifiques, mais aussi bibliothèque ou atelier, médiathèque ou musée, etc. formant un ensemble administratif cohérent avec un statut de droit défini, public, privé ou éventuellement mixte. source: Wikipedia @@ -210,6 +206,10 @@ en: no_organization_hint_html: "If the organization is not in the list, you can <a href=\"%{url}\">create it</a>" no_organization_hint_no_access_html: "If the organization is not in the list, you should ask to create it" period: Period + experiences: + import_btn: Import experiences + import_hint_html: "Possible values for <i>gender</i> are: m (male), f (female) and n (non binary).<br><i>Phone_professional</i>, <i>phone_personal</i>, <i>mobile</i> and <i>zipcode</i> fields must have a text format, not numbers.<br><i>Country</i> field must contain the ISO 3166 code of the country, so 2 upcase characters (<a href=\"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\" target=\_blank\">list</a>).<br><i>Social_twitter</i> field should have no @." + title: Experiences imports personal_data_warning: Warning! The information provided below can be publicly visible on the websites and the extranets about you. taught_programs: Taught programs sso: SSO diff --git a/config/locales/university/fr.yml b/config/locales/university/fr.yml index 8214f25cd9d402d78a1fbc9b3e43e5651ab27f36..bec6dcddafad2f5715b4fcb1e02d19bce32c0f9d 100644 --- a/config/locales/university/fr.yml +++ b/config/locales/university/fr.yml @@ -188,10 +188,6 @@ fr: import_btn: Importer des promotions import_hint_html: "Les valeurs pour <i>gender</i> peuvent être m (masculin), f (féminin) et n (non binaire).<br>Les champs <i>phone_professional</i>, <i>phone_personal</i>, <i>mobile</i> et <i>zipcode</i> doivent être au format texte, pas nombre.<br>Le champ <i>country</i> doit contenir le code ISO 3166 du pays, sur 2 caratères en majuscule (<a href=\"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\" target=\_blank\">liste</a>)<br>Le champ <i>social_twitter</i> ne doit pas contenir d'@.<br>Le champ <i>school</i> doit contenir l'id interne de l'école.<br>Le champ <i>program</i> doit contenir l'id interne de la formation." title: Imports de promotions - experiences: - import_btn: Importer des expériences - import_hint_html: "Les valeurs pour <i>gender</i> peuvent être m (masculin), f (féminin) et n (non binaire).<br>Les champs <i>phone_professional</i>, <i>phone_personal</i>, <i>mobile</i> et <i>zipcode</i> doivent être au format texte, pas nombre.<br>Le champ <i>country</i> doit contenir le code ISO 3166 du pays, sur 2 caratères en majuscule (<a href=\"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\" target=\_blank\">liste</a>)<br>Le champ <i>social_twitter</i> ne doit pas contenir d'@." - title: Imports d'expériences description: text: Une université est une institution d'enseignement supérieur, d'étude et de recherche, constituée par la réunion de divers établissements nommés suivant les traditions “collègesâ€, “facultésâ€, “institutsâ€, “départementsâ€, “centresâ€, “sectionsâ€, “unités†ou écoles spécifiques, mais aussi bibliothèque ou atelier, médiathèque ou musée, etc. formant un ensemble administratif cohérent avec un statut de droit défini, public, privé ou éventuellement mixte. source: Wikipedia @@ -210,6 +206,10 @@ fr: no_organization_hint_html: "Si l'entreprise n'apparait pas dans la liste, vous pouvez la <a href=\"%{url}\">créer</a>" no_organization_hint_no_access_html: "Si l'entreprise n'apparait pas dans la liste, il faut demander à la créer" period: Période + experiences: + import_btn: Importer des expériences + import_hint_html: "Les valeurs pour <i>gender</i> peuvent être m (masculin), f (féminin) et n (non binaire).<br>Les champs <i>phone_professional</i>, <i>phone_personal</i>, <i>mobile</i> et <i>zipcode</i> doivent être au format texte, pas nombre.<br>Le champ <i>country</i> doit contenir le code ISO 3166 du pays, sur 2 caratères en majuscule (<a href=\"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes\" target=\_blank\">liste</a>)<br>Le champ <i>social_twitter</i> ne doit pas contenir d'@." + title: Imports d'expériences personal_data_warning: Attention ! Les informations renseignées ici sont susceptibles d'être visibles publiquement sur les sites web et les extranets vous concernant. taught_programs: Formations enseignées sso: SSO diff --git a/config/routes/admin/university.rb b/config/routes/admin/university.rb index e7db269e913d25c0cb96d4403594b88023e81f4b..8a573a0a173b23a2f24c546b7bd5582f2a936e1e 100644 --- a/config/routes/admin/university.rb +++ b/config/routes/admin/university.rb @@ -7,22 +7,24 @@ namespace :university do namespace :cohorts do resources :imports, only: [:index, :show, :new, :create] end - namespace :experiences do - resources :imports, only: [:index, :show, :new, :create] - end end resources :alumni, only: [:index, :show] do member do get 'cohorts' => 'alumni/cohorts#edit' patch 'cohorts' => 'alumni/cohorts#update' - get 'experiences' => 'alumni/experiences#edit' - patch 'experiences' => 'alumni/experiences#update' end end resources :people do member do get :static get "/translations/:lang" => "people#in_language", as: :show_in_language + get 'experiences' => 'people/experiences#edit' + patch 'experiences' => 'people/experiences#update' + end + end + namespace :people do + namespace :experiences do + resources :imports, only: [:index, :show, :new, :create] end end resources :organizations do