diff --git a/app/controllers/admin/education/diplomas_controller.rb b/app/controllers/admin/education/diplomas_controller.rb index b05767a1435f8b80ff4b510c1927ff5fbd16fd61..7daecf16927767ffb13d5f869249c3af378feaa5 100644 --- a/app/controllers/admin/education/diplomas_controller.rb +++ b/app/controllers/admin/education/diplomas_controller.rb @@ -64,6 +64,6 @@ class Admin::Education::DiplomasController < Admin::Education::ApplicationContro def diploma_params params.require(:education_diploma) - .permit(:name, :short_name, :level, :ects, :duration) + .permit(:name, :short_name, :description_short, :level, :ects, :duration) end end diff --git a/app/controllers/admin/education/programs_controller.rb b/app/controllers/admin/education/programs_controller.rb index eac2d1773f066193df7242812dca1aa27769d1f3..8d8638ab5f46bed77909643197eb46457630232d 100644 --- a/app/controllers/admin/education/programs_controller.rb +++ b/app/controllers/admin/education/programs_controller.rb @@ -110,7 +110,7 @@ class Admin::Education::ProgramsController < Admin::Education::ApplicationContro def program_params params.require(:education_program).permit( - :name, :short_name, :slug, :capacity, :continuing, :initial, :apprenticeship, :description, :published, + :name, :short_name, :slug, :capacity, :continuing, :initial, :apprenticeship, :description, :description_short, :published, :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit, :prerequisites, :objectives, :presentation, :registration, :pedagogy, :content, :registration_url, :evaluation, :accessibility, :pricing, :contacts, :opportunities, :results, :other, :main_information, diff --git a/app/models/communication/website/permalink/administrator.rb b/app/models/communication/website/permalink/administrator.rb index bdbae5e4ed84ae222a3023f52a464f022fba9308..a68bdc15eb94c016fb478d7e34a3425461e553e7 100644 --- a/app/models/communication/website/permalink/administrator.rb +++ b/app/models/communication/website/permalink/administrator.rb @@ -1,3 +1,27 @@ +# == Schema Information +# +# Table name: communication_website_permalinks +# +# id :uuid not null, primary key +# about_type :string not null +# is_current :boolean default(TRUE) +# path :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid not null +# university_id :uuid not null, indexed +# website_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_permalinks_on_university_id (university_id) +# index_communication_website_permalinks_on_website_id (website_id) +# +# Foreign Keys +# +# fk_rails_e9646cce64 (university_id => universities.id) +# fk_rails_f389ba7d45 (website_id => communication_websites.id) +# class Communication::Website::Permalink::Administrator < Communication::Website::Permalink def self.required_in_config?(website) website.has_administrators? diff --git a/app/models/communication/website/permalink/author.rb b/app/models/communication/website/permalink/author.rb index b354ff140b13d2b5d9d0f3cac12ba8eb43263ecb..d721a2d341df1af98e5f8061887061801c07137a 100644 --- a/app/models/communication/website/permalink/author.rb +++ b/app/models/communication/website/permalink/author.rb @@ -1,3 +1,27 @@ +# == Schema Information +# +# Table name: communication_website_permalinks +# +# id :uuid not null, primary key +# about_type :string not null +# is_current :boolean default(TRUE) +# path :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid not null +# university_id :uuid not null, indexed +# website_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_permalinks_on_university_id (university_id) +# index_communication_website_permalinks_on_website_id (website_id) +# +# Foreign Keys +# +# fk_rails_e9646cce64 (university_id => universities.id) +# fk_rails_f389ba7d45 (website_id => communication_websites.id) +# class Communication::Website::Permalink::Author < Communication::Website::Permalink def self.required_in_config?(website) # website might have authors but no communication_posts (if a post unpublished exists) diff --git a/app/models/communication/website/permalink/category.rb b/app/models/communication/website/permalink/category.rb index 3eb525c563c7283da3d63944ea92ad0a23d14ea1..4ed09cfc528ca6c02c708e9fc2c7eb2a2f71a026 100644 --- a/app/models/communication/website/permalink/category.rb +++ b/app/models/communication/website/permalink/category.rb @@ -1,3 +1,27 @@ +# == Schema Information +# +# Table name: communication_website_permalinks +# +# id :uuid not null, primary key +# about_type :string not null +# is_current :boolean default(TRUE) +# path :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid not null +# university_id :uuid not null, indexed +# website_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_permalinks_on_university_id (university_id) +# index_communication_website_permalinks_on_website_id (website_id) +# +# Foreign Keys +# +# fk_rails_e9646cce64 (university_id => universities.id) +# fk_rails_f389ba7d45 (website_id => communication_websites.id) +# class Communication::Website::Permalink::Category < Communication::Website::Permalink def self.required_in_config?(website) website.has_communication_posts? && website.has_communication_categories? diff --git a/app/models/communication/website/permalink/diploma.rb b/app/models/communication/website/permalink/diploma.rb index 44a5226fb5f694f8ec3fea429b90bd817903665d..62331308e2906864f7b9774b176638d9c902bed1 100644 --- a/app/models/communication/website/permalink/diploma.rb +++ b/app/models/communication/website/permalink/diploma.rb @@ -1,3 +1,27 @@ +# == Schema Information +# +# Table name: communication_website_permalinks +# +# id :uuid not null, primary key +# about_type :string not null +# is_current :boolean default(TRUE) +# path :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid not null +# university_id :uuid not null, indexed +# website_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_permalinks_on_university_id (university_id) +# index_communication_website_permalinks_on_website_id (website_id) +# +# Foreign Keys +# +# fk_rails_e9646cce64 (university_id => universities.id) +# fk_rails_f389ba7d45 (website_id => communication_websites.id) +# class Communication::Website::Permalink::Diploma < Communication::Website::Permalink def self.required_in_config?(website) website.has_education_diplomas? diff --git a/app/models/communication/website/permalink/organization.rb b/app/models/communication/website/permalink/organization.rb index f0775c7ada2f7949325046cdbd3a53541ebba779..abfab5cbfa2e82f5526938de9d229df440633a74 100644 --- a/app/models/communication/website/permalink/organization.rb +++ b/app/models/communication/website/permalink/organization.rb @@ -1,3 +1,27 @@ +# == Schema Information +# +# Table name: communication_website_permalinks +# +# id :uuid not null, primary key +# about_type :string not null +# is_current :boolean default(TRUE) +# path :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid not null +# university_id :uuid not null, indexed +# website_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_permalinks_on_university_id (university_id) +# index_communication_website_permalinks_on_website_id (website_id) +# +# Foreign Keys +# +# fk_rails_e9646cce64 (university_id => universities.id) +# fk_rails_f389ba7d45 (website_id => communication_websites.id) +# class Communication::Website::Permalink::Organization < Communication::Website::Permalink def self.required_in_config?(website) website.has_organizations? diff --git a/app/models/communication/website/permalink/page.rb b/app/models/communication/website/permalink/page.rb index d65145fb0153acf9a2d29e53ef5758503b4a7c42..e615a2b5f6d46629f3b851211616406f1f08ad23 100644 --- a/app/models/communication/website/permalink/page.rb +++ b/app/models/communication/website/permalink/page.rb @@ -1,3 +1,27 @@ +# == Schema Information +# +# Table name: communication_website_permalinks +# +# id :uuid not null, primary key +# about_type :string not null +# is_current :boolean default(TRUE) +# path :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid not null +# university_id :uuid not null, indexed +# website_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_permalinks_on_university_id (university_id) +# index_communication_website_permalinks_on_website_id (website_id) +# +# Foreign Keys +# +# fk_rails_e9646cce64 (university_id => universities.id) +# fk_rails_f389ba7d45 (website_id => communication_websites.id) +# class Communication::Website::Permalink::Page < Communication::Website::Permalink protected diff --git a/app/models/communication/website/permalink/person.rb b/app/models/communication/website/permalink/person.rb index d84621fbe92ea83f520cf605d57b35d801b7762c..5c800191417bdd23111a608e0e52226a1adeab2c 100644 --- a/app/models/communication/website/permalink/person.rb +++ b/app/models/communication/website/permalink/person.rb @@ -1,3 +1,27 @@ +# == Schema Information +# +# Table name: communication_website_permalinks +# +# id :uuid not null, primary key +# about_type :string not null +# is_current :boolean default(TRUE) +# path :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid not null +# university_id :uuid not null, indexed +# website_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_permalinks_on_university_id (university_id) +# index_communication_website_permalinks_on_website_id (website_id) +# +# Foreign Keys +# +# fk_rails_e9646cce64 (university_id => universities.id) +# fk_rails_f389ba7d45 (website_id => communication_websites.id) +# class Communication::Website::Permalink::Person < Communication::Website::Permalink def self.required_in_config?(website) website.has_persons? diff --git a/app/models/communication/website/permalink/post.rb b/app/models/communication/website/permalink/post.rb index a25c8d1d5532c856f1c3a843203b50a8c1e9a721..8983505391aa2fec676fb41038e0afba559f8f8a 100644 --- a/app/models/communication/website/permalink/post.rb +++ b/app/models/communication/website/permalink/post.rb @@ -1,3 +1,27 @@ +# == Schema Information +# +# Table name: communication_website_permalinks +# +# id :uuid not null, primary key +# about_type :string not null +# is_current :boolean default(TRUE) +# path :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid not null +# university_id :uuid not null, indexed +# website_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_permalinks_on_university_id (university_id) +# index_communication_website_permalinks_on_website_id (website_id) +# +# Foreign Keys +# +# fk_rails_e9646cce64 (university_id => universities.id) +# fk_rails_f389ba7d45 (website_id => communication_websites.id) +# class Communication::Website::Permalink::Post < Communication::Website::Permalink def self.required_in_config?(website) website.has_communication_posts? diff --git a/app/models/communication/website/permalink/program.rb b/app/models/communication/website/permalink/program.rb index f18b2591aff96bdb53eb429ff8aa5091cc6804ed..2fb1ee2effde195a3eb61d205255343a5a7174e8 100644 --- a/app/models/communication/website/permalink/program.rb +++ b/app/models/communication/website/permalink/program.rb @@ -1,3 +1,27 @@ +# == Schema Information +# +# Table name: communication_website_permalinks +# +# id :uuid not null, primary key +# about_type :string not null +# is_current :boolean default(TRUE) +# path :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid not null +# university_id :uuid not null, indexed +# website_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_permalinks_on_university_id (university_id) +# index_communication_website_permalinks_on_website_id (website_id) +# +# Foreign Keys +# +# fk_rails_e9646cce64 (university_id => universities.id) +# fk_rails_f389ba7d45 (website_id => communication_websites.id) +# class Communication::Website::Permalink::Program < Communication::Website::Permalink def self.required_in_config?(website) website.has_education_programs? diff --git a/app/models/communication/website/permalink/researcher.rb b/app/models/communication/website/permalink/researcher.rb index abec7308fa7df4ad5a934e8733e02248863dd97a..fb03e96b730d7fb92bbfdfe66457eff9ae8c2ca5 100644 --- a/app/models/communication/website/permalink/researcher.rb +++ b/app/models/communication/website/permalink/researcher.rb @@ -1,3 +1,27 @@ +# == Schema Information +# +# Table name: communication_website_permalinks +# +# id :uuid not null, primary key +# about_type :string not null +# is_current :boolean default(TRUE) +# path :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid not null +# university_id :uuid not null, indexed +# website_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_permalinks_on_university_id (university_id) +# index_communication_website_permalinks_on_website_id (website_id) +# +# Foreign Keys +# +# fk_rails_e9646cce64 (university_id => universities.id) +# fk_rails_f389ba7d45 (website_id => communication_websites.id) +# class Communication::Website::Permalink::Researcher < Communication::Website::Permalink def self.required_in_config?(website) website.has_researchers? diff --git a/app/models/communication/website/permalink/teacher.rb b/app/models/communication/website/permalink/teacher.rb index d8dc2c439aea195ad153b9ab21c493ff8decc060..8d49d2cd7760d860fb4dfd723f3bb86f395f378e 100644 --- a/app/models/communication/website/permalink/teacher.rb +++ b/app/models/communication/website/permalink/teacher.rb @@ -1,3 +1,27 @@ +# == Schema Information +# +# Table name: communication_website_permalinks +# +# id :uuid not null, primary key +# about_type :string not null +# is_current :boolean default(TRUE) +# path :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid not null +# university_id :uuid not null, indexed +# website_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_permalinks_on_university_id (university_id) +# index_communication_website_permalinks_on_website_id (website_id) +# +# Foreign Keys +# +# fk_rails_e9646cce64 (university_id => universities.id) +# fk_rails_f389ba7d45 (website_id => communication_websites.id) +# class Communication::Website::Permalink::Teacher < Communication::Website::Permalink def self.required_in_config?(website) website.has_teachers? diff --git a/app/models/education/diploma.rb b/app/models/education/diploma.rb index d902cb1db8e348301cdb36d3b0f75d30707f50b6..00cd553a0cdbd586676252089d7dd8ef37647468 100644 --- a/app/models/education/diploma.rb +++ b/app/models/education/diploma.rb @@ -2,16 +2,17 @@ # # Table name: education_diplomas # -# id :uuid not null, primary key -# duration :text -# ects :integer -# level :integer default("not_applicable") -# name :string -# short_name :string -# slug :string -# created_at :datetime not null -# updated_at :datetime not null -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# description_short :text +# duration :text +# ects :integer +# level :integer default("not_applicable") +# name :string +# short_name :string +# slug :string +# created_at :datetime not null +# updated_at :datetime not null +# university_id :uuid not null, indexed # # Indexes # diff --git a/app/models/education/program.rb b/app/models/education/program.rb index e12b4fc5bef78aae5120dc3cfa495fb6215bd56a..9ffd591ce0c441fcef7d454c00db8bc9d96bcbee 100644 --- a/app/models/education/program.rb +++ b/app/models/education/program.rb @@ -10,6 +10,7 @@ # content :text # continuing :boolean # description :text +# description_short :text # duration :text # evaluation :text # featured_image_alt :string diff --git a/app/views/admin/application/chapo/_form.html.erb b/app/views/admin/application/chapo/_form.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..d0c17e7fc5ccf2dcd48e298234201634b89c60e0 --- /dev/null +++ b/app/views/admin/application/chapo/_form.html.erb @@ -0,0 +1,4 @@ +<%= f.input :description_short, + input_html: { + value: about.description_short&.gsub('&', '&') + } %> diff --git a/app/views/admin/application/chapo/_show.html.erb b/app/views/admin/application/chapo/_show.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..9730ef2d4474ac5a107b21d23f040e9b08d8ee4a --- /dev/null +++ b/app/views/admin/application/chapo/_show.html.erb @@ -0,0 +1,12 @@ +<% unless about.description_short.blank? %> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h2 class="card-title mb-0 h5"><%= about.class.human_attribute_name('description_short') %></h2> + </div> + <div class="card-body"> + <p class="lead"> + <%= sanitize about.description_short %> + </p> + </div> + </div> +<% end %> diff --git a/app/views/admin/application/chapo/_static.html.erb b/app/views/admin/application/chapo/_static.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..588ada7e10e204c796428aebfb447f95290128d9 --- /dev/null +++ b/app/views/admin/application/chapo/_static.html.erb @@ -0,0 +1,2 @@ +description_short: > + <%= prepare_text_for_static @about.description_short %> diff --git a/app/views/admin/communication/websites/pages/_form.html.erb b/app/views/admin/communication/websites/pages/_form.html.erb index 129062b21f7ded4da8a2b441914e05fd76247ed6..5d0d812912da674add8f526744520da07b8e3eb1 100644 --- a/app/views/admin/communication/websites/pages/_form.html.erb +++ b/app/views/admin/communication/websites/pages/_form.html.erb @@ -11,7 +11,7 @@ <div class="card-body"> <%= f.input :title %> <%= f.input :breadcrumb_title %> - <%= f.input :description_short, input_html: { value: page.description_short&.gsub('&', '&') } %> + <%= render 'admin/application/chapo/form', f: f, about: page %> <%= f.input :header_text, as: :string %> <%= f.input :text, as: :summernote if page.text&.to_plain_text.present? %> </div> diff --git a/app/views/admin/communication/websites/pages/show.html.erb b/app/views/admin/communication/websites/pages/show.html.erb index f90f57e626db12d9abebb9aed5943ef46dfc44c1..ce1aa34d4f83a0a196065abb0b350aa851fc8386 100644 --- a/app/views/admin/communication/websites/pages/show.html.erb +++ b/app/views/admin/communication/websites/pages/show.html.erb @@ -5,19 +5,7 @@ <div class="row"> <div class="col-md-8"> - <% unless @page.description_short.blank? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h2 class="card-title mb-0 h5"><%= Communication::Website::Page.human_attribute_name('description_short') %></h2> - </div> - <div class="card-body"> - <p class="lead"> - <%= sanitize @page.description_short %> - </p> - </div> - </div> - <% end %> - + <%= render 'admin/application/chapo/show', about: @page %> <%= render 'admin/communication/blocks/list', about: @page %> <% if @page.is_special_page? %> diff --git a/app/views/admin/communication/websites/pages/static.html.erb b/app/views/admin/communication/websites/pages/static.html.erb index 8520268df2576ea4c70dabe351851a4954a8891d..ffa172256f9ba4d3837262ba51d39107da5e1de8 100644 --- a/app/views/admin/communication/websites/pages/static.html.erb +++ b/app/views/admin/communication/websites/pages/static.html.erb @@ -22,8 +22,7 @@ children: <% end %> description: > <%= prepare_text_for_static @about.description %> -description_short: > - <%= prepare_text_for_static @about.description_short %> +<%= render 'admin/application/chapo/static' %> header_text: >- <%= prepare_html_for_static @about.header_text, @website.university %> legacy_text: > diff --git a/app/views/admin/communication/websites/posts/_form.html.erb b/app/views/admin/communication/websites/posts/_form.html.erb index eb8fb4db48e965e0a3ca52ac9b55eeea677e553d..3e0e689a6a0efb57939de546122694714d68e854 100644 --- a/app/views/admin/communication/websites/posts/_form.html.erb +++ b/app/views/admin/communication/websites/posts/_form.html.erb @@ -10,7 +10,7 @@ </div> <div class="card-body"> <%= f.input :title %> - <%= f.input :description_short %> + <%= render 'admin/application/chapo/form', f: f, about: post %> <%= f.input :text, as: :summernote if post.text&.to_plain_text.present? %> </div> </div> diff --git a/app/views/admin/communication/websites/posts/show.html.erb b/app/views/admin/communication/websites/posts/show.html.erb index 54052028271058e2e5fb03cfaca428d96b72665f..37fd3ef303103db72d7f43d1cc4c2c12347c325f 100644 --- a/app/views/admin/communication/websites/posts/show.html.erb +++ b/app/views/admin/communication/websites/posts/show.html.erb @@ -3,18 +3,7 @@ <%= render 'admin/communication/websites/sidebar' do %> <div class="row"> <div class="col-md-8"> - <% unless @post.description_short.blank? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h2 class="card-title mb-0 h5"><%= Communication::Website::Post.human_attribute_name('description_short') %></h2> - </div> - <div class="card-body"> - <p class="lead"> - <%= sanitize @post.description_short %> - </p> - </div> - </div> - <% end %> + <%= render 'admin/application/chapo/show', about: @post %> <%= render 'admin/communication/blocks/list', about: @post %> </div> <div class="col-md-4"> diff --git a/app/views/admin/communication/websites/posts/static.html.erb b/app/views/admin/communication/websites/posts/static.html.erb index 21a4f9d174399ccedb2d9fd5390816bd9887d771..414ff587104d180ffd77af5bfa3426cdb7c8a1bb 100644 --- a/app/views/admin/communication/websites/posts/static.html.erb +++ b/app/views/admin/communication/websites/posts/static.html.erb @@ -18,8 +18,7 @@ categories: <%= render 'admin/communication/unsplash/static' %> description: > <%= prepare_text_for_static @about.description %> -description_short: > - <%= prepare_text_for_static @about.description_short %> +<%= render 'admin/application/chapo/static' %> <%= render 'admin/communication/blocks/static', about: @about %> --- <%= prepare_html_for_static @about.text, @about.university %> diff --git a/app/views/admin/education/diplomas/_form.html.erb b/app/views/admin/education/diplomas/_form.html.erb index 4caa4a7c6ede1d863c6cab9b347521fdf65115f3..92a2231019d026ef707ed4b710f1725a1531f303 100644 --- a/app/views/admin/education/diplomas/_form.html.erb +++ b/app/views/admin/education/diplomas/_form.html.erb @@ -23,7 +23,7 @@ <%= f.input :duration, as: :string %> </div> </div> - + <%= render 'admin/application/chapo/form', f: f, about: diploma %> </div> </div> </div> diff --git a/app/views/admin/education/diplomas/show.html.erb b/app/views/admin/education/diplomas/show.html.erb index 965286b07b2aef54e43e6a29cfee955869848020..94a064589e9e719ea9b8d69cda06fc55289184d0 100644 --- a/app/views/admin/education/diplomas/show.html.erb +++ b/app/views/admin/education/diplomas/show.html.erb @@ -2,6 +2,7 @@ <div class="row"> <div class="col-lg-8"> + <%= render 'admin/application/chapo/show', about: @diploma %> <%= render 'admin/communication/blocks/list', about: @diploma %> <div class="card flex-fill w-100"> <div class="card-header"> diff --git a/app/views/admin/education/diplomas/static.html.erb b/app/views/admin/education/diplomas/static.html.erb index a660cd8db305f16cd631b02413d02dcf6851516e..894edd41403d600e2dd215fe499b13d985d4e5de 100644 --- a/app/views/admin/education/diplomas/static.html.erb +++ b/app/views/admin/education/diplomas/static.html.erb @@ -4,6 +4,7 @@ title: > <%= render 'admin/application/static/permalink' %> short_name: > <%= prepare_text_for_static @about.short_name %> +<%= render 'admin/application/chapo/static' %> level: <%= @about.level_i18n %> ects: <%= @about.ects %> duration: > diff --git a/app/views/admin/education/programs/_form.html.erb b/app/views/admin/education/programs/_form.html.erb index 34ad593902d4397414da59b31ae77798fbec5578..09b2944641cf2356dd62d3934cdb80b6091704bf 100644 --- a/app/views/admin/education/programs/_form.html.erb +++ b/app/views/admin/education/programs/_form.html.erb @@ -13,6 +13,7 @@ <%= f.input :short_name %> </div> </div> + <%= render 'admin/application/chapo/form', f: f, about: program %> <div class="row"> <div class="col-lg-6"> <%= f.association :diploma, diff --git a/app/views/admin/education/programs/show.html.erb b/app/views/admin/education/programs/show.html.erb index 7e5bb279c4daaa373e7128d45fc1d2be2b2ab7c7..bb849cad05966193b59a22fbdc7af6bc704023bb 100644 --- a/app/views/admin/education/programs/show.html.erb +++ b/app/views/admin/education/programs/show.html.erb @@ -15,6 +15,12 @@ <%= Education::Program.human_attribute_name('diploma') %> </h3> <p><%= link_to @program.diploma, [:admin, @program.diploma] if @program.diploma %></p> + <h3 class="h5 mt-4"> + <%= Education::Program.human_attribute_name('description_short') %> + </h3> + <p class="lead"> + <%= sanitize @program.description_short %> + </p> <% if @program.schools.any? %> <h3 class="h5 mt-4"> <%= Education::Program.human_attribute_name('schools') %> diff --git a/app/views/admin/education/programs/static.html.erb b/app/views/admin/education/programs/static.html.erb index 4125f02acbbc486359a2c3b263c7714f7531ab75..4d6adbf4b5553e9f2d3a8f566e791ed9493b0431 100644 --- a/app/views/admin/education/programs/static.html.erb +++ b/app/views/admin/education/programs/static.html.erb @@ -17,6 +17,7 @@ registration_url: > <%= @about.registration_url %> description: > <%= prepare_text_for_static @about.description %> +<%= render 'admin/application/chapo/static' %> presentation: > <%= prepare_text_for_static @about.presentation %> position: <%= @about.position %> diff --git a/app/views/admin/university/people/static.html.erb b/app/views/admin/university/people/static.html.erb index c04f73f891f56cf2c25dd9231f3dfa0cf3d05f34..6bbe8ea29909047330bb95c25fa48ac41c98353b 100644 --- a/app/views/admin/university/people/static.html.erb +++ b/app/views/admin/university/people/static.html.erb @@ -21,8 +21,7 @@ image: "<%= @about.best_picture.blob.id %>" <% end %> description: > <%= prepare_text_for_static @about.description %> -description_short: > - <%= prepare_text_for_static @about.description_short %> +<%= render 'admin/application/chapo/static' %> roles: <% if @about.author.for_website?(@website) %> - author diff --git a/config/locales/education/en.yml b/config/locales/education/en.yml index 6def260bff9b24103eb35c9e22715999c2d876d5..d758b6f565355807b6c456f5b71cc95b82bfbb2c 100644 --- a/config/locales/education/en.yml +++ b/config/locales/education/en.yml @@ -34,6 +34,7 @@ en: programs: Programs duration: Duration ects: ECTS + description_short: Lead text education/program: accessibility: Accessibilité apprenticeship: Apprenticeship @@ -41,6 +42,7 @@ en: contacts: Contacts continuing: Continuing training description: Meta Description + description_short: Lead text diploma: Diploma duration: Duration downloadable_summary: Downloadable summary diff --git a/config/locales/education/fr.yml b/config/locales/education/fr.yml index 78a98bf3d4cb8a41597a4b884ba4dfaa1a2dd7d4..5271cc3aeb1d6a6b939e593d8f05942377140fbd 100644 --- a/config/locales/education/fr.yml +++ b/config/locales/education/fr.yml @@ -34,6 +34,7 @@ fr: programs: Formations duration: Durée ects: Crédits ECTS + description_short: Chapô education/program: accessibility: Accessibilité apprenticeship: Apprentissage @@ -41,6 +42,7 @@ fr: contacts: Contacts continuing: Formation continue description: Meta Description + description_short: Chapô diploma: Diplôme duration: Durée downloadable_summary: Document de synthèse téléchargeable diff --git a/config/locales/university/en.yml b/config/locales/university/en.yml index 942a3fd909942e1263864c5de5fa988ed5741c66..0bd503f0f4a889685fe8a9b6cabf145e1eef3c32 100644 --- a/config/locales/university/en.yml +++ b/config/locales/university/en.yml @@ -35,7 +35,7 @@ en: contacts: Contact information country: Country description: Meta Description - description_short: Short description + description_short: Lead text education_programs: Programs email: Email essentials: Essentials diff --git a/config/locales/university/fr.yml b/config/locales/university/fr.yml index fd2ec4bda77b71c7fddc08ebbba0e368d7686e31..86b1c678b9ad83906711dec9977125e0c9fcd672 100644 --- a/config/locales/university/fr.yml +++ b/config/locales/university/fr.yml @@ -35,7 +35,7 @@ fr: contacts: Coordonnées country: Pays description: Meta Description - description_short: Description courte + description_short: Chapô education_programs: Formations email: Email essentials: Informations essentielles diff --git a/db/migrate/20221212165617_add_description_short_to_diploma_and_program.rb b/db/migrate/20221212165617_add_description_short_to_diploma_and_program.rb new file mode 100644 index 0000000000000000000000000000000000000000..ca4d7aa7b31471f5333c1200d2dbebfaef3c3935 --- /dev/null +++ b/db/migrate/20221212165617_add_description_short_to_diploma_and_program.rb @@ -0,0 +1,6 @@ +class AddDescriptionShortToDiplomaAndProgram < ActiveRecord::Migration[7.0] + def change + add_column :education_programs, :description_short, :text + add_column :education_diplomas, :description_short, :text + end +end diff --git a/db/schema.rb b/db/schema.rb index 325431fae1fca7e695da608920de1947cedf79e2..55067828b4437ff390a6e0a64e9e8b792c271a76 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[7.0].define(version: 2022_12_05_100440) do +ActiveRecord::Schema[7.0].define(version: 2022_12_12_165617) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -460,6 +460,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_05_100440) do t.datetime "updated_at", null: false t.integer "ects" t.text "duration" + t.text "description_short" t.index ["university_id"], name: "index_education_diplomas_on_university_id" end @@ -497,6 +498,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_05_100440) do t.boolean "initial" t.boolean "apprenticeship" t.string "registration_url" + t.text "description_short" t.index ["diploma_id"], name: "index_education_programs_on_diploma_id" t.index ["parent_id"], name: "index_education_programs_on_parent_id" t.index ["university_id"], name: "index_education_programs_on_university_id" diff --git a/test/fixtures/education/diplomas.yml b/test/fixtures/education/diplomas.yml index 51010bb01429dbabc9c8c44b218848ff125e2931..7116f21534a281ab68866531c530e3811ad0801f 100644 --- a/test/fixtures/education/diplomas.yml +++ b/test/fixtures/education/diplomas.yml @@ -2,16 +2,17 @@ # # Table name: education_diplomas # -# id :uuid not null, primary key -# duration :text -# ects :integer -# level :integer default("not_applicable") -# name :string -# short_name :string -# slug :string -# created_at :datetime not null -# updated_at :datetime not null -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# description_short :text +# duration :text +# ects :integer +# level :integer default("not_applicable") +# name :string +# short_name :string +# slug :string +# created_at :datetime not null +# updated_at :datetime not null +# university_id :uuid not null, indexed # # Indexes # diff --git a/test/models/education/diploma_test.rb b/test/models/education/diploma_test.rb index e3dfd30e0f55a7a2421d5be6bcf6dcd723b0120a..3e7e16a4df5ccd72166de69214d284207ee5e35c 100644 --- a/test/models/education/diploma_test.rb +++ b/test/models/education/diploma_test.rb @@ -2,16 +2,17 @@ # # Table name: education_diplomas # -# id :uuid not null, primary key -# duration :text -# ects :integer -# level :integer default("not_applicable") -# name :string -# short_name :string -# slug :string -# created_at :datetime not null -# updated_at :datetime not null -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# description_short :text +# duration :text +# ects :integer +# level :integer default("not_applicable") +# name :string +# short_name :string +# slug :string +# created_at :datetime not null +# updated_at :datetime not null +# university_id :uuid not null, indexed # # Indexes #