diff --git a/Gemfile.lock b/Gemfile.lock index 1f847af67e1523cc17c4f9a0d3a8536727381b7b..dde0f353088c9c8e842ac05b66b1831e7fd8e3a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -89,7 +89,7 @@ GEM autoprefixer-rails (10.4.7.0) execjs (~> 2) aws-eventstream (1.2.0) - aws-partitions (1.608.0) + aws-partitions (1.610.0) aws-sdk-core (3.131.3) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) @@ -102,15 +102,15 @@ GEM aws-sdk-core (~> 3, >= 3.127.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.0) + aws-sigv4 (1.5.1) aws-eventstream (~> 1, >= 1.0.2) bcrypt (3.1.18) bindex (0.8.1) bootsnap (1.12.0) msgpack (~> 1.2) - bootstrap (5.1.3) + bootstrap (5.2.0) autoprefixer-rails (>= 9.1.0) - popper_js (>= 2.9.3, < 3) + popper_js (>= 2.11.5, < 3) sassc-rails (>= 2.0.0) bootstrap5-kaminari-views (0.0.1) kaminari (>= 0.13) @@ -211,7 +211,7 @@ GEM ffi (1.15.5) figaro (1.2.0) thor (>= 0.14.0, < 2) - font-awesome-sass (6.1.1) + font-awesome-sass (6.1.2) sassc (~> 2.0) front_matter_parser (1.0.1) gdpr (1.2.3) @@ -294,19 +294,19 @@ GEM mini_magick (4.11.0) mini_mime (1.1.2) minitest (5.16.2) - msgpack (1.5.3) + msgpack (1.5.4) multi_json (1.15.0) multi_xml (0.6.0) multipart-post (2.2.3) - mustermann (1.1.2) + mustermann (2.0.2) ruby2_keywords (~> 0.0.1) nesty (1.0.2) nio4r (2.5.8) - nokogiri (1.13.7-arm64-darwin) + nokogiri (1.13.8-arm64-darwin) racc (~> 1.4) - nokogiri (1.13.7-x86_64-darwin) + nokogiri (1.13.8-x86_64-darwin) racc (~> 1.4) - nokogiri (1.13.7-x86_64-linux) + nokogiri (1.13.8-x86_64-linux) racc (~> 1.4) oauth2 (1.4.10) faraday (>= 0.17.3, < 3.0) @@ -328,8 +328,8 @@ GEM omniauth (~> 2.0) ruby-saml (~> 1.12) orm_adapter (0.5.0) - pg (1.4.1) - popper_js (2.9.3) + pg (1.4.2) + popper_js (2.11.5) public_suffix (4.0.7) puma (5.6.4) nio4r (~> 2.0) @@ -337,7 +337,7 @@ GEM rack (2.2.4) rack-mini-profiler (2.3.4) rack (>= 1.2.0) - rack-protection (2.2.1) + rack-protection (2.2.2) rack rack-test (2.0.2) rack (>= 1.3) @@ -425,10 +425,10 @@ GEM simple_form_password_with_hints (0.0.6) rails simple_form - sinatra (2.2.1) - mustermann (~> 1.0) + sinatra (2.2.2) + mustermann (~> 2.0) rack (~> 2.2) - rack-protection (= 2.2.1) + rack-protection (= 2.2.2) tilt (~> 2.0) sixarm_ruby_unaccent (1.2.0) spring (4.0.0) @@ -442,10 +442,10 @@ GEM terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) thor (1.2.1) - tilt (2.0.10) + tilt (2.0.11) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (2.0.4) + tzinfo (2.0.5) concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext diff --git a/app/assets/images/communication/blocks/templates/contact.jpg b/app/assets/images/communication/blocks/templates/contact.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0839360ade850f72bd3a61c6e9aa5ac059e4b1ed Binary files /dev/null and b/app/assets/images/communication/blocks/templates/contact.jpg differ diff --git a/app/assets/images/communication/blocks/templates/programs.jpg b/app/assets/images/communication/blocks/templates/programs.jpg new file mode 100644 index 0000000000000000000000000000000000000000..df8aa3418df856a0c9074865ad6a7e2ce1cee847 Binary files /dev/null and b/app/assets/images/communication/blocks/templates/programs.jpg differ diff --git a/app/controllers/admin/communication/websites/pages_controller.rb b/app/controllers/admin/communication/websites/pages_controller.rb index b7c8e6a92b9c313266f33ed7f1a74eb749d8fce1..203ff4d27bb0921e38b8e0cdb96f270996323914 100644 --- a/app/controllers/admin/communication/websites/pages_controller.rb +++ b/app/controllers/admin/communication/websites/pages_controller.rb @@ -98,7 +98,7 @@ class Admin::Communication::Websites::PagesController < Admin::Communication::We params.require(:communication_website_page) .permit( :communication_website_id, :title, :breadcrumb_title, :bodyclass, - :description, :description_short, :header_text, :text, :slug, :published, + :description, :description_short, :header_text, :text, :slug, :published, :full_width, :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit, :parent_id, :language_id ) diff --git a/app/controllers/admin/communication/websites/posts/curations_controller.rb b/app/controllers/admin/communication/websites/posts/curations_controller.rb index 04f417d94568e73445600d1a018dcf11f18fb9af..028c45310dfd317acfce08da54362b96dbdb6a8f 100644 --- a/app/controllers/admin/communication/websites/posts/curations_controller.rb +++ b/app/controllers/admin/communication/websites/posts/curations_controller.rb @@ -6,7 +6,7 @@ class Admin::Communication::Websites::Posts::CurationsController < Admin::Commun def create @curator = Curator.new @website, current_user, curation_params[:url] if @curator.valid? - redirect_to [:edit, :admin, @curator.post], + redirect_to [:admin, @curator.post], notice: t('admin.successfully_created_html', model: @curator.post.to_s) else breadcrumb diff --git a/app/controllers/admin/education/diplomas_controller.rb b/app/controllers/admin/education/diplomas_controller.rb index c01478528f3ab6566f2ac222d1bd80e0e3c9359e..b05767a1435f8b80ff4b510c1927ff5fbd16fd61 100644 --- a/app/controllers/admin/education/diplomas_controller.rb +++ b/app/controllers/admin/education/diplomas_controller.rb @@ -11,6 +11,12 @@ class Admin::Education::DiplomasController < Admin::Education::ApplicationContro breadcrumb end + def static + @about = @diploma + @website = @diploma.websites&.first + render layout: false + end + def new breadcrumb end diff --git a/app/controllers/admin/education/programs_controller.rb b/app/controllers/admin/education/programs_controller.rb index edb22802238dd74a988112f6c3626beac2c65d94..0686e43ebd6c86cec45b4cc8468692fba94fb441 100644 --- a/app/controllers/admin/education/programs_controller.rb +++ b/app/controllers/admin/education/programs_controller.rb @@ -54,6 +54,12 @@ class Admin::Education::ProgramsController < Admin::Education::ApplicationContro breadcrumb end + def static + @about = @program + @website = @program.websites&.first + render layout: false + end + def preview @website = @program.websites&.first render layout: 'admin/layouts/preview' @@ -107,8 +113,9 @@ class Admin::Education::ProgramsController < Admin::Education::ApplicationContro params.require(:education_program).permit( :name, :short_name, :slug, :level, :capacity, :continuing, :initial, :apprenticeship, :description, :published, :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit, - :prerequisites, :objectives, :presentation, :registration, :pedagogy, :content, + :prerequisites, :objectives, :presentation, :registration, :pedagogy, :content, :registration_url, :evaluation, :accessibility, :pricing, :contacts, :opportunities, :results, :other, :main_information, + :downloadable_summary, :downloadable_summary_delete, :parent_id, :diploma_id, school_ids: [], university_person_involvements_attributes: [:id, :person_id, :description, :position, :_destroy] ) diff --git a/app/controllers/admin/university/alumni/experiences_controller.rb b/app/controllers/admin/university/alumni/experiences_controller.rb index 29d1689b065c7adb8969290d8c74f4687f62ef78..58c683bac50aa08b49fa474dde2de4f3f7e7a1ac 100644 --- a/app/controllers/admin/university/alumni/experiences_controller.rb +++ b/app/controllers/admin/university/alumni/experiences_controller.rb @@ -30,7 +30,8 @@ class Admin::University::Alumni::ExperiencesController < Admin::University::Appl def experiences_params params.require(:university_person) - .permit(experiences_attributes: [:id, :organization_id, :university_id, :from_year, :to_year, :_destroy]) + .permit(experiences_attributes: [:id, :organization_id, :university_id, :description, :from_year, :to_year, :_destroy]) + .merge(university_id: current_university.id) end end diff --git a/app/controllers/admin/university/people_controller.rb b/app/controllers/admin/university/people_controller.rb index 4eda4fadb2cbdfa117fbf1357eb4d73143354197..63e11047b019a0bb1a9118ef4e70ed782305d441 100644 --- a/app/controllers/admin/university/people_controller.rb +++ b/app/controllers/admin/university/people_controller.rb @@ -18,6 +18,12 @@ class Admin::University::PeopleController < Admin::University::ApplicationContro breadcrumb end + def static + @about = @person + @website = @person.websites&.first + render layout: false + end + def new breadcrumb end diff --git a/app/models/ability.rb b/app/models/ability.rb index 29332288083fcc314db3c286b506f2527e85eb86..2c9f5c0abbd4fd50faa0aeab6969b25cf7c733d9 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -72,6 +72,7 @@ class Ability managed_websites_ids = @user.websites_to_manage.pluck(:communication_website_id) managed_pages_ids = Communication::Website::Page.where(communication_website_id: managed_websites_ids).pluck(:id) can :read, Communication::Website, university_id: @user.university_id, id: managed_websites_ids + can :analytics, Communication::Website, university_id: @user.university_id, id: managed_websites_ids can :manage, Communication::Website::Page, university_id: @user.university_id, communication_website_id: managed_websites_ids can :manage, Communication::Website::Post, university_id: @user.university_id, communication_website_id: managed_websites_ids can :manage, Communication::Website::Category, university_id: @user.university_id, communication_website_id: managed_websites_ids @@ -90,6 +91,7 @@ class Ability can :manage, Communication::Block, university_id: @user.university_id can :create, Communication::Block can :read, Communication::Website, university_id: @user.university_id + can :analytics, Communication::Website, university_id: @user.university_id can :manage, Communication::Website::Page, university_id: @user.university_id can :manage, Communication::Website::Post, university_id: @user.university_id can :manage, Communication::Website::Category, university_id: @user.university_id diff --git a/app/models/communication/block.rb b/app/models/communication/block.rb index ed2a58be0fcdc11991209a21ef9281f3a321b895..2107c8362eac687131eeea0c3bac5c27500b4b03 100644 --- a/app/models/communication/block.rb +++ b/app/models/communication/block.rb @@ -51,13 +51,15 @@ class Communication::Block < ApplicationRecord partners: 200, posts: 500, pages: 600, + contact: 57, + programs: 58 } CATEGORIES = { basic: [:chapter, :image, :video, :datatable], storytelling: [:key_figures, :gallery, :call_to_action, :testimonials, :timeline], - references: [:pages, :posts, :organization_chart, :partners], - utilities: [:files, :definitions, :embed] + references: [:pages, :posts, :organization_chart, :partners, :programs], + utilities: [:files, :definitions, :embed, :contact] } scope :published, -> { where(published: true) } diff --git a/app/models/communication/block/component/program.rb b/app/models/communication/block/component/program.rb new file mode 100644 index 0000000000000000000000000000000000000000..8153ac398cdf80d0a73d24d1dd21237e94d43902 --- /dev/null +++ b/app/models/communication/block/component/program.rb @@ -0,0 +1,10 @@ +class Communication::Block::Component::Program < Communication::Block::Component::Base + + def program + template.block.university.programs.find_by(id: data) + end + + def git_dependencies + [program, program&.best_featured_image&.blob] + end +end diff --git a/app/models/communication/block/component/time_slot.rb b/app/models/communication/block/component/time_slot.rb new file mode 100644 index 0000000000000000000000000000000000000000..77d176c7cbc4c5d32b8d11981b07bbd144f71e59 --- /dev/null +++ b/app/models/communication/block/component/time_slot.rb @@ -0,0 +1,26 @@ +class Communication::Block::Component::TimeSlot < Communication::Block::Component::Base + + def from + data['from'] + end + + def to + data['to'] + end + + def present? + from && from != '0' && to && to != '0' + end + + def blank? + !present? + end + + def default_data + { + 'from' => '', + 'to' => '' + } + end + +end diff --git a/app/models/communication/block/template/contact.rb b/app/models/communication/block/template/contact.rb new file mode 100644 index 0000000000000000000000000000000000000000..b298da6c9c4c4159e26efd0e3dddce754f1e76d9 --- /dev/null +++ b/app/models/communication/block/template/contact.rb @@ -0,0 +1,13 @@ +class Communication::Block::Template::Contact < Communication::Block::Template::Base + + has_component :name, :string + has_component :address, :text + has_component :zipcode, :string + has_component :city, :string + has_component :country, :string + has_component :phone_numbers, :array + has_component :emails, :array + + has_elements + +end diff --git a/app/models/communication/block/template/contact/element.rb b/app/models/communication/block/template/contact/element.rb new file mode 100644 index 0000000000000000000000000000000000000000..5129866e0df3429d0ea7e04ec9ca36a135183a0d --- /dev/null +++ b/app/models/communication/block/template/contact/element.rb @@ -0,0 +1,5 @@ +class Communication::Block::Template::Contact::Element < Communication::Block::Template::Base + has_component :title, :string + has_component :time_slot_morning, :time_slot + has_component :time_slot_afternoon, :time_slot +end diff --git a/app/models/communication/block/template/program.rb b/app/models/communication/block/template/program.rb new file mode 100644 index 0000000000000000000000000000000000000000..c2cac3342bcf60d05da0de9e4ab10392345d49b4 --- /dev/null +++ b/app/models/communication/block/template/program.rb @@ -0,0 +1,9 @@ +class Communication::Block::Template::Program < Communication::Block::Template::Base + + has_elements + + def selected_programs + @selected_programs ||= elements.map { |element| element.program }.compact + end + +end diff --git a/app/models/communication/block/template/program/element.rb b/app/models/communication/block/template/program/element.rb new file mode 100644 index 0000000000000000000000000000000000000000..d2981a2b6d1206d22d4d80885f38ab20dfaee00c --- /dev/null +++ b/app/models/communication/block/template/program/element.rb @@ -0,0 +1,8 @@ +class Communication::Block::Template::Program::Element < Communication::Block::Template::Base + + has_component :id, :program + + def program + id_component.program + end +end diff --git a/app/models/communication/website/page.rb b/app/models/communication/website/page.rb index 85c2006d56dd76368a4f13c530897f78ceea8c49..5e1c7d1deb76eb827b8d56adaf3ac14fca818bbe 100644 --- a/app/models/communication/website/page.rb +++ b/app/models/communication/website/page.rb @@ -9,6 +9,7 @@ # description_short :text # featured_image_alt :string # featured_image_credit :text +# full_width :boolean default(FALSE) # github_path :text # header_text :text # kind :integer @@ -149,7 +150,7 @@ class Communication::Website::Page < ApplicationRecord page = self.dup page.published = false page.save - blocks.each do |block| + blocks.ordered.each do |block| b = block.duplicate b.about = page b.save @@ -157,6 +158,11 @@ class Communication::Website::Page < ApplicationRecord page end + def full_width + kind_home? ? true + : attributes['full_width'] + end + def to_s "#{title}" end diff --git a/app/models/communication/website/with_style.rb b/app/models/communication/website/with_style.rb index 831c7c4c7565df33a653861b750b0416f205882e..3d5172b77321c06f02baf1e992a2e370ebc53a0a 100644 --- a/app/models/communication/website/with_style.rb +++ b/app/models/communication/website/with_style.rb @@ -2,7 +2,6 @@ module Communication::Website::WithStyle extend ActiveSupport::Concern def preview_style - return '' if url.blank? load_style if style_outdated? style end @@ -14,6 +13,7 @@ module Communication::Website::WithStyle load_style_from url load_style_from "#{url}/fr" if @style.blank? load_style_from "#{url}/en" if @style.blank? + load_style_from "https://example.osuny.org" if @style.blank? substitute_fonts_urls_in_style! self.update_columns style: @style, style_updated_at: Date.today @@ -26,6 +26,7 @@ module Communication::Website::WithStyle css_files.each do |css_url| add_css_url_to_style css_url.to_s end + rescue end def add_css_url_to_style(css_url) diff --git a/app/models/education/diploma.rb b/app/models/education/diploma.rb index cdbb4aef7261d6a3b0114f81078c919e171d80e2..c75d71cc1142af8321e99d926614d104a730f0d1 100644 --- a/app/models/education/diploma.rb +++ b/app/models/education/diploma.rb @@ -23,6 +23,7 @@ # class Education::Diploma < ApplicationRecord include WithUniversity + include WithBlocks include WithGit include WithSlug diff --git a/app/models/education/program.rb b/app/models/education/program.rb index 6606cc0a800220c485453fdbf0551abdcb757c4c..2a8a26dc8de1a992b17e513df5f4df945a6d7e59 100644 --- a/app/models/education/program.rb +++ b/app/models/education/program.rb @@ -28,6 +28,7 @@ # pricing :text # published :boolean default(FALSE) # registration :text +# registration_url :string # results :text # short_name :string # slug :string @@ -90,6 +91,8 @@ class Education::Program < ApplicationRecord foreign_key: :parent_id, dependent: :destroy + has_one_attached_deletable :downloadable_summary + # Deprecated, now in diploma enum level: { not_applicable: 0, @@ -142,6 +145,10 @@ class Education::Program < ApplicationRecord "content/programs/#{path}/_index.html" end + def path_in_website(website) + "#{website.special_page(:education_programs).path}#{path}".gsub('//', '/') + end + def git_dependencies(website) [self] + active_storage_blobs + @@ -208,7 +215,7 @@ class Education::Program < ApplicationRecord end def explicit_blob_ids - super.concat [featured_image&.blob_id] + super.concat [featured_image&.blob_id, downloadable_summary&.blob_id] end def inherited_blob_ids diff --git a/app/models/university/person/experience.rb b/app/models/university/person/experience.rb index 3cee8c3347cd85fbc792cc0aac2bfa61b3ac4523..4785cae2f7fb248eadc7a51fd914ffbe5cd7bb09 100644 --- a/app/models/university/person/experience.rb +++ b/app/models/university/person/experience.rb @@ -26,6 +26,7 @@ # class University::Person::Experience < ApplicationRecord include WithUniversity + belongs_to :person belongs_to :organization, class_name: "University::Organization" diff --git a/app/services/curator.rb b/app/services/curator.rb index 4a0a31cde76dba103154b2dcb2bb23b52737385c..003f5e358edecba93ca5cb82bb1d017347cacb46 100644 --- a/app/services/curator.rb +++ b/app/services/curator.rb @@ -16,15 +16,24 @@ class Curator protected def create_post! - text = Wordpress.clean_html("#{page.text}<p><a href=\"#{@url}\" target=\"_blank\">Source</a></p>") @post = website.posts.create( university: website.university, title: page.title, - text: text, slug: page.title.parameterize, author: @user.person, published_at: Time.now ) + @chapter = @post.blocks.create( + university: website.university, + template_kind: :chapter, + published: true, + position: 0 + ) + text = Wordpress.clean_html("#{page.text}<p><a href=\"#{@url}\" target=\"_blank\">Source</a></p>") + data = @chapter.data.deep_dup + data['text'] = text + @chapter.data = data + @chapter.save end def attach_image! diff --git a/app/services/git/providers/github.rb b/app/services/git/providers/github.rb index 0c77e0ac62aab0fe534b23f36dab44d0e73a55f6..51da537ec272440637518d7a461bda80797a8c59 100644 --- a/app/services/git/providers/github.rb +++ b/app/services/git/providers/github.rb @@ -51,7 +51,12 @@ class Git::Providers::Github < Git::Providers::Abstract end def git_sha(path) + return if path.nil? + # Try to find in stored tree to avoid multiple queries + return hash_for_paths[path] if hash_for_paths.has_key? path begin + # The fast way, with no query, does not work. + # Let's query the API content = client.content repository, path: path sha = content[:sha] rescue @@ -74,6 +79,18 @@ class Git::Providers::Github < Git::Providers::Abstract @branch_sha ||= client.branch(repository, default_branch)[:commit][:sha] end + def hash_for_paths + unless @hash_for_paths + @hash_for_paths = {} + tree[:tree].each do |hash| + path = hash[:path] + sha = hash[:sha] + @hash_for_paths[path] = sha + end + end + @hash_for_paths + end + def tree @tree ||= client.tree repository, branch_sha, recursive: true end diff --git a/app/services/wordpress.rb b/app/services/wordpress.rb index c2089b18223441c45a5f136992b3d67665b66264..2b0240d70944d54929ccfa45af597cc0c8cfe246 100644 --- a/app/services/wordpress.rb +++ b/app/services/wordpress.rb @@ -10,6 +10,9 @@ class Wordpress end def self.clean_html(html) + # invalid byte sequence in UTF-8 + # https://stackoverflow.com/questions/32826781/invalid-byte-sequence-in-utf-8-when-sanitizing-wordpress-export-content + html = html.force_encoding('UTF-8').scrub # Relaxed config : https://github.com/rgrove/sanitize/blob/main/lib/sanitize/config/relaxed.rb # iframe attributes from MDN : https://developer.mozilla.org/fr/docs/Web/HTML/Element/iframe fragment = Sanitize.fragment(html, Sanitize::Config.merge(Sanitize::Config::RELAXED, diff --git a/app/views/admin/application/property/_text.html.erb b/app/views/admin/application/property/_text.html.erb index 0fd8acc44e27911923090811aba761d992ce50c5..42e023087a32681dcda45950a6ee4e6825d0d63b 100644 --- a/app/views/admin/application/property/_text.html.erb +++ b/app/views/admin/application/property/_text.html.erb @@ -17,6 +17,7 @@ end <p> <% if value.blank? %> <i class="fa fa-exclamation-circle text-danger"></i> + <%= t 'properties.text.missing' %> <% else %> <%= strip_tags(value).truncate(200).html_safe %> <% end %> diff --git a/app/views/admin/communication/blocks/_list.html.erb b/app/views/admin/communication/blocks/_list.html.erb index 4f407759b07e695e229ca57b0b80b846bf9db95f..41505a23d876e2b21c81a6532459af7f865c381e 100644 --- a/app/views/admin/communication/blocks/_list.html.erb +++ b/app/views/admin/communication/blocks/_list.html.erb @@ -10,36 +10,44 @@ </h2> </div> <% if about.blocks.any? %> - <table class="<%= table_classes %>"> - <thead> - <tr> - <% if can? :reorder, Communication::Block %> - <th width="20" class="ps-0"> </th> - <% end %> - <th><%= Communication::Block.human_attribute_name('title') %></th> - <th><%= Communication::Block.human_attribute_name('template') %></th> - <th><%= t 'accessibility.label' %></th> - <th></th> - </tr> - </thead> - <tbody data-sortable data-sort-url="<%= reorder_admin_communication_blocks_path %>"> - <% about.blocks.ordered.each do |block| %> - <tr data-id="<%= block.id %>" class="<%= 'draft' unless block.published? %>"> + <div class="table-responsive"> + <table class="<%= table_classes %>"> + <thead> + <tr> <% if can? :reorder, Communication::Block %> - <td><i class="fa fa-bars handle"></i></td> + <th width="20" class="ps-0"> </th> <% end %> - <td><%= block.to_s.truncate(50) %></td> - <td><%= block.template_kind_i18n %></td> - <td><%= render 'admin/application/a11y/status', about: block %></td> - <td class="text-end"> - <div class="btn-group"> - <%= duplicate_link block %> - <%= edit_link block %> - </div> - </td> + <th><%= Communication::Block.model_name.human %></th> + <th></th> + <th><%= t 'accessibility.label' %></th> + <th></th> </tr> - <% end %> - </tbody> - </table> + </thead> + <tbody data-sortable data-sort-url="<%= reorder_admin_communication_blocks_path %>"> + <% about.blocks.ordered.each do |block| %> + <tr data-id="<%= block.id %>" class="<%= 'draft' unless block.published? %>"> + <% if can? :reorder, Communication::Block %> + <td><i class="fa fa-bars handle"></i></td> + <% end %> + <td> + <%= block.to_s.truncate(50) %><br> + <span class="small"><%= block.template_kind_i18n %></span> + </td> + <td class="p-0"> + <%= image_tag "communication/blocks/templates/#{block.template_kind}.jpg", + height: "100px", alt: '', style:"max-height: 50px" %> + </td> + <td><%= render 'admin/application/a11y/status', about: block %></td> + <td class="text-end"> + <div class="btn-group"> + <%= duplicate_link block %> + <%= edit_link block %> + </div> + </td> + </tr> + <% end %> + </tbody> + </table> + </div> <% end %> </div> diff --git a/app/views/admin/communication/blocks/components/add_element/_edit.html.erb b/app/views/admin/communication/blocks/components/add_element/_edit.html.erb index 4f2a0da8acf7051ecbc894786f482dce39c3b28f..108e3e124b8ee1565139530257661c7ad36d87dc 100644 --- a/app/views/admin/communication/blocks/components/add_element/_edit.html.erb +++ b/app/views/admin/communication/blocks/components/add_element/_edit.html.erb @@ -1,4 +1,4 @@ <a class="<%= button_classes('mb-4') %>" - v-on:click="data.elements.push(Object.assign({}, defaultElement))"> + v-on:click="data.elements.push(JSON.parse(JSON.stringify(defaultElement)))"> <%= label %> </a> diff --git a/app/views/admin/communication/blocks/components/program/_edit.html.erb b/app/views/admin/communication/blocks/components/program/_edit.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..f3fcbd342401853547249cb3b97dd056318658e5 --- /dev/null +++ b/app/views/admin/communication/blocks/components/program/_edit.html.erb @@ -0,0 +1,21 @@ +<% +program = current_university.programs.ordered +%> +<% if label.present? %> +<label class="form-label" + :for="<%= dom_id.html_safe %>"> + <%= label %> +</label> +<% end %> +<select :id="<%= dom_id.html_safe %>" + class="form-select select mb-3" + v-model="<%= model %>.<%= property %>"> + <% if placeholder %> + <option value="" disabled><%= placeholder %></option> + <% end %> + <% program.each do |program| %> + <option value="<%= program.id %>"> + <%= program %> + </option> + <% end %> +</select> diff --git a/app/views/admin/communication/blocks/components/program/_preview.html.erb b/app/views/admin/communication/blocks/components/program/_preview.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..01e730d526642e906e9ece422946bf3f96963c16 --- /dev/null +++ b/app/views/admin/communication/blocks/components/program/_preview.html.erb @@ -0,0 +1 @@ +<%= component.program.to_s %> diff --git a/app/views/admin/communication/blocks/components/program/_static.html.erb b/app/views/admin/communication/blocks/components/program/_static.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..a871dde97f687b000c6124e9bf75784cdd148d18 --- /dev/null +++ b/app/views/admin/communication/blocks/components/program/_static.html.erb @@ -0,0 +1 @@ +<%= indentation %><%= '- ' if list %><%= property %>: <%= value %> diff --git a/app/views/admin/communication/blocks/components/time_slot/_edit.html.erb b/app/views/admin/communication/blocks/components/time_slot/_edit.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..087cb556b55156da18481520e3461c2ae406be37 --- /dev/null +++ b/app/views/admin/communication/blocks/components/time_slot/_edit.html.erb @@ -0,0 +1,30 @@ +<% +rows ||= 3 +from = t 'admin.communication.blocks.components.time_slot.from' +to = t 'admin.communication.blocks.components.time_slot.to' +%> +<% if label.present? %> + <label class="form-label"> + <%= label %> + </label> +<% end %> +<div class="d-flex align-items-center mb-2"> + <label class="form-label d-flex me-2"> + <span class="me-2 pt-1"> + <%= from %> + </span> + <input :id="'element-' + index + '-<%= property %>%-from'" + class="form-control me-1" + v-model="<%= model %>.<%= property %>.from" + type="time" /> + </label> + <label class="form-label d-flex"> + <span class="me-2 pt-1"> + <%= to %> + </span> + <input :id="'element-' + index + '-<%= property %>%-to'" + class="form-control" + v-model="<%= model %>.<%= property %>.to" + type="time" /> + </label> +</div> \ No newline at end of file diff --git a/app/views/admin/communication/blocks/components/time_slot/_preview.html.erb b/app/views/admin/communication/blocks/components/time_slot/_preview.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..e2e6fce5a0df2df235a7d2ccfcd631a106e70cf5 --- /dev/null +++ b/app/views/admin/communication/blocks/components/time_slot/_preview.html.erb @@ -0,0 +1 @@ +<%= component.from %> → <%= component.to %> diff --git a/app/views/admin/communication/blocks/components/time_slot/_static.html.erb b/app/views/admin/communication/blocks/components/time_slot/_static.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..25464183d23524777978d24f8157a967b7324902 --- /dev/null +++ b/app/views/admin/communication/blocks/components/time_slot/_static.html.erb @@ -0,0 +1,3 @@ +<%= indentation %><%= property %>: +<%= indentation %> from: "<%= component.from %>" +<%= indentation %> to: "<%= component.to %>" diff --git a/app/views/admin/communication/blocks/templates/contact/_edit.html.erb b/app/views/admin/communication/blocks/templates/contact/_edit.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..e9a904fa5343b482ef80051a6341f4cb2fca2e40 --- /dev/null +++ b/app/views/admin/communication/blocks/templates/contact/_edit.html.erb @@ -0,0 +1,106 @@ +<div class="row mb-4"> + <div class="col-md-6 col-xl-4"> + <div class="card"> + <div class="card-header d-flex"> + <h3 class="h4"><%= t '.contacts' %></h3> + </div> + <div class="card-body"> + <%= block_component_edit :name %> + <%= block_component_edit :address, rows: 1 %> + <div class="row"> + <div class="col-md-4"> + <%= block_component_edit :zipcode %> + </div> + <div class="col-md-8"> + <%= block_component_edit :city %> + </div> + </div> + <%= block_component_edit :country %> + </div> + </div> + </div> + <div class="col-md-6 col-xl-8"> + <div class="row"> + <div class="col-xl-6"> + <div class="card"> + <div class="card-header d-flex"> + <h3 class="h4 pt-1 flex-fill"><%= t '.phones.label' %></h3> + <a class="btn bn-sm btn-primary" v-on:click="data.phone_numbers.push('')"> + <%= t('.add') %> + </a> + </div> + <div class="card-body mb-n2"> + <div v-for="(element, index) in data.phone_numbers"> + <div class="d-flex mb-2"> + <input type="tel" + class="form-control" + placeholder="<%= t '.phones.placeholder' %>" + maxlength="12" + v-model="data.phone_numbers[index]"> + <a class="btn text-danger" v-on:click="data.phone_numbers.splice(index, 1)"> + <i class="fas fa-times"></i> + </a> + </div> + </div> + </div> + </div> + </div> + <div class="col-xl-6"> + <div class="card"> + <div class="card-header d-flex"> + <h3 class="h4 flex-fill"><%= t '.mails.label' %></h3> + <a class="btn bn-sm btn-primary" v-on:click="data.emails.push('')"> + <%= t('.add') %> + </a> + </div> + <div class="card-body mb-n2"> + <div v-for="(element, index) in data.emails"> + <div class="d-flex mb-2"> + <input type="email" + class="form-control" + placeholder="<%= t '.mails.placeholder' %>" + v-model="data.emails[index]"> + <a class="btn text-danger" v-on:click="data.emails.splice(index, 1)"> + <i class="fas fa-times"></i> + </a> + </div> + </div> + </div> + </div> + </div> + </div> + </div> +</div> + +<h3 class="h4"><%= t '.slots' %></h3> +<%= block_component_add_element t('.add_slot') %> +<draggable :list="data.elements" handle=".dragHandle" class="list-group"> + <div v-for="(element, index) in data.elements" class="list-group-item"> + <div class="d-flex"> + <div> + <a class="btn ps-0 pt-0 dragHandle"> + <i class="fa fa-bars handle"></i> + </a> + </div> + <div class="flex-fill"> + <div class="row mb-n3"> + <div class="col-xl-4"> + <%= block_component_edit :title, template: @element %> + </div> + <div class="col-xl-4 col-md-6"> + <%= block_component_edit :time_slot_morning, template: @element %> + </div> + <div class="col-xl-4 col-md-6"> + <%= block_component_edit :time_slot_afternoon, template: @element %> + </div> + </div> + </div> + <div> + <a class="btn text-danger position-absolute top-0 end-0" + v-on:click="data.elements.splice(index, 1)"> + <i class="fas fa-times"></i> + </a> + </div> + </div> + </div> +</draggable> diff --git a/app/views/admin/communication/blocks/templates/contact/_preview.html.erb b/app/views/admin/communication/blocks/templates/contact/_preview.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..83caa0c2ce3df20e345e15d82769f4081f084032 --- /dev/null +++ b/app/views/admin/communication/blocks/templates/contact/_preview.html.erb @@ -0,0 +1,16 @@ +<p><%= block_component_preview :name %></p> +<div> + <%= block_component_preview :address %> + <%= block_component_preview :zipcode %> + <%= block_component_preview :city %> + <%= block_component_preview :country %> +</div> +<table class="table"> +<% @block.template.elements.each do |element| %> + <tr> + <td><%= block_component_preview :title, template: element %></td> + <td><%= block_component_preview :time_slot_morning, template: element %></td> + <td><%= block_component_preview :time_slot_afternoon, template: element %></td> + </tr> +<% end %> +</table> \ No newline at end of file diff --git a/app/views/admin/communication/blocks/templates/contact/_static.html.erb b/app/views/admin/communication/blocks/templates/contact/_static.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..68fb64850456a932aeebdec56580854d96929fa5 --- /dev/null +++ b/app/views/admin/communication/blocks/templates/contact/_static.html.erb @@ -0,0 +1,10 @@ +<%= block_component_static :name %> +<%= block_component_static :address %> +<%= block_component_static :phone_numbers %> +<%= block_component_static :emails %> + timetable: +<% block.template.elements.each do |element| %> +<%= block_component_static :title, template: element, list: true, depth: 4 %> +<%= block_component_static :time_slot_morning, template: element, depth: 5 %> +<%= block_component_static :time_slot_afternoon, template: element, depth: 5 %> +<% end %> \ No newline at end of file diff --git a/app/views/admin/communication/blocks/templates/programs/_edit.html.erb b/app/views/admin/communication/blocks/templates/programs/_edit.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..1faeee1fd6faac1e29324e3870abafc60d1807b7 --- /dev/null +++ b/app/views/admin/communication/blocks/templates/programs/_edit.html.erb @@ -0,0 +1,30 @@ +<% pages = collection_tree(@block.university.programs) %> + +<div class="row mb-4"> + <div class="col-lg-6"> + <div class="mb-4"> + <%= block_component_add_element t('.add') %> + <draggable :list="data.elements" handle=".dragHandle" class="list-group"> + <div v-for="(element, index) in data.elements" class="list-group-item"> + <div class="d-flex mb-n3"> + <div> + <a class="btn ps-0 pt-0 dragHandle" title="Drag and drop"> + <i class="fa fa-bars handle"></i> + </a> + </div> + <div class="flex-fill"> + <%= block_component_edit :id, template: @element, label: false %> + </div> + <div> + <a class="btn btn-sm btn-danger ms-3" + v-on:click="data.elements.splice(data.elements.indexOf(page), 1)" + title="Supprimer"> + <i class="fas fa-times"></i> + </a> + </div> + </div> + </div> + </draggable> + </div> + </div> +</div> diff --git a/app/views/admin/communication/blocks/templates/programs/_preview.html.erb b/app/views/admin/communication/blocks/templates/programs/_preview.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..b32f9129ea5306c0e355fe95013179fec1cf1fc3 --- /dev/null +++ b/app/views/admin/communication/blocks/templates/programs/_preview.html.erb @@ -0,0 +1,5 @@ +<hr> +<% @block.template.selected_programs.each do |program| %> + <p><%= program %></p> + <hr> +<% end %> \ No newline at end of file diff --git a/app/views/admin/communication/blocks/templates/programs/_static.html.erb b/app/views/admin/communication/blocks/templates/programs/_static.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..44bcb65d33f4b88f703371c38ae097c3b1fa421b --- /dev/null +++ b/app/views/admin/communication/blocks/templates/programs/_static.html.erb @@ -0,0 +1,5 @@ + programs: +<% block.template.elements.each do |element| %> +<% next unless element.program %> + - slug: "<%= element.program.slug %>" +<% end %> diff --git a/app/views/admin/communication/websites/pages/_form.html.erb b/app/views/admin/communication/websites/pages/_form.html.erb index 51d19dd142fd3f2c735520fc98425d40f37e6767..129062b21f7ded4da8a2b441914e05fd76247ed6 100644 --- a/app/views/admin/communication/websites/pages/_form.html.erb +++ b/app/views/admin/communication/websites/pages/_form.html.erb @@ -51,6 +51,7 @@ label_method: ->(p) { sanitize p[:label] }, value_method: ->(p) { p[:id] } unless page.kind_home? %> <%= f.input :bodyclass if can?(:edit, @website) %> + <%= f.input :full_width %> </div> </div> <% else %> diff --git a/app/views/admin/communication/websites/pages/show.html.erb b/app/views/admin/communication/websites/pages/show.html.erb index 641abd9c4ab89471a2796dbaf00c701bba52a119..52d79983c0ecc325ac88aba50985168e9d9cd7d3 100644 --- a/app/views/admin/communication/websites/pages/show.html.erb +++ b/app/views/admin/communication/websites/pages/show.html.erb @@ -79,6 +79,9 @@ </p> <% end %> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('full_width') %></h3> + <p><%= t @page.full_width %></p> + <% if @page.children.any? %> <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('children') %></h3> <ul class="list-unstyled mb-0"> diff --git a/app/views/admin/communication/websites/pages/static.html.erb b/app/views/admin/communication/websites/pages/static.html.erb index 8812dd9cf9187dad7c1f1988842661a05b0d41ca..bfc2c810316c2a3365b2d924c73e0e83c2494cf4 100644 --- a/app/views/admin/communication/websites/pages/static.html.erb +++ b/app/views/admin/communication/websites/pages/static.html.erb @@ -4,6 +4,7 @@ title: > breadcrumb_title: "<%= @about.breadcrumb_title.blank? ? @about.title : @about.breadcrumb_title %>" url: "<%= @about.path %>" position: <%= @about.position %> +full_width: <%= @about.full_width %> bodyclass: <%= @about.best_bodyclass %> <%= render 'admin/communication/unsplash/static' %> <% if @about.children.published.any? %> diff --git a/app/views/admin/communication/websites/posts/curations/new.html.erb b/app/views/admin/communication/websites/posts/curations/new.html.erb index 12ca16ce09f4f072b577f83104671f74e91ac8c2..4a8e7f5f4e392986432f7e002f1c36dce0125138 100644 --- a/app/views/admin/communication/websites/posts/curations/new.html.erb +++ b/app/views/admin/communication/websites/posts/curations/new.html.erb @@ -2,21 +2,10 @@ <%= simple_form_for :curation, url: admin_communication_website_post_curations_path, html: { id: 'new_communication_website_post_curation' } do |f| %> <%= f.error_notification %> + <%= f.input :url, + label: 'URL', + value: params.dig(:curation, :url) %> - <div class="row"> - <div class="col-md-8"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('content') %></h5> - </div> - <div class="card-body"> - <%= f.input :url, - label: 'URL', - value: params.dig(:curation, :url) %> - </div> - </div> - </div> - </div> <% content_for :action_bar_right do %> <%= submit f %> <% end %> diff --git a/app/views/admin/communication/websites/posts/show.html.erb b/app/views/admin/communication/websites/posts/show.html.erb index 77aee23f876abb60567700e350f4bd07b91be64f..494c467914fed62b972215e97dfc0e7454c6eacf 100644 --- a/app/views/admin/communication/websites/posts/show.html.erb +++ b/app/views/admin/communication/websites/posts/show.html.erb @@ -9,7 +9,6 @@ </div> <div class="card-body"> <%= render 'admin/application/property/text', object: @post, property: :description_short %> - <%= render 'admin/application/property/text', object: @post, property: :text %> <%= render 'admin/application/property/summernote_embeds', object: @post, property: :medias %> </div> </div> diff --git a/app/views/admin/education/diplomas/show.html.erb b/app/views/admin/education/diplomas/show.html.erb index 8955a3fc549b3dc1089e2613c7fe355d4f1da02d..965286b07b2aef54e43e6a29cfee955869848020 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/communication/blocks/list', about: @diploma %> <div class="card flex-fill w-100"> <div class="card-header"> <h2 class="card-title mb-0 h5"> @@ -11,6 +12,7 @@ <%= render 'admin/education/programs/list', programs: @programs, hide_diploma: true %> + </div> </div> <div class="col-lg-4"> @@ -37,6 +39,9 @@ <% content_for :action_bar_left do %> <%= destroy_link @diploma %> + <%= link_to t('static'), + static_admin_education_diploma_path(@diploma), + class: button_classes('btn-light') if current_user.server_admin? %> <% end %> <% content_for :action_bar_right do %> diff --git a/app/views/admin/education/diplomas/static.html.erb b/app/views/admin/education/diplomas/static.html.erb index 57d6284710e6a86f2a4d33d245ce894e29b58e92..66af43f700743814d639f7612f5d653f480ac8b0 100644 --- a/app/views/admin/education/diplomas/static.html.erb +++ b/app/views/admin/education/diplomas/static.html.erb @@ -8,4 +8,5 @@ level: <%= @about.level_i18n %> ects: <%= @about.ects %> duration: > <%= prepare_text_for_static @about.duration %> +<%= render 'admin/communication/blocks/static', about: @about %> --- diff --git a/app/views/admin/education/programs/_form.html.erb b/app/views/admin/education/programs/_form.html.erb index 457d085315c098c51f8c0f96fbd46ddb5b4362c3..34ad593902d4397414da59b31ae77798fbec5578 100644 --- a/app/views/admin/education/programs/_form.html.erb +++ b/app/views/admin/education/programs/_form.html.erb @@ -24,9 +24,10 @@ <div class="col-lg-6"> <%= f.input :capacity %> <legend class="col-form-label pt-0 mb-1"><%= t('education.program.registration_scheme') %></legend> - <%= f.input :initial %> - <%= f.input :continuing %> - <%= f.input :apprenticeship %> + <div class="mb-n3"><%= f.input :initial %></div> + <div class="mb-n3"><%= f.input :continuing %></div> + <div><%= f.input :apprenticeship %></div> + <%= f.input :downloadable_summary %> </div> </div> <% end %> @@ -37,8 +38,7 @@ <%= f.input :presentation %> </div> <div class="col-xxl-6"> - <%= render 'admin/education/programs/forms/input_with_inheritance', - f: f, property: :objectives %> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :objectives %> </div> </div> <% end %> @@ -46,14 +46,11 @@ <%= render 'admin/education/programs/forms/part', part: :pedagogy do %> <div class="row"> <div class="col-xxl-6"> - <%= render 'admin/education/programs/forms/input_with_inheritance', - f: f, property: :content %> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :content %> </div> <div class="col-xxl-6"> - <%= render 'admin/education/programs/forms/input_with_inheritance', - f: f, property: :pedagogy %> - <%= render 'admin/education/programs/forms/input_with_inheritance', - f: f, property: :evaluation %> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :pedagogy %> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :evaluation %> </div> </div> <div class="row mb-2"> @@ -84,9 +81,7 @@ <%= f.simple_fields_for :university_person_involvements, sorted_involvements, include_id: false do |involvement_f| %> - <%= render 'admin/education/programs/involvement_fields', - f: involvement_f, - include_id: true %> + <%= render 'admin/education/programs/involvement_fields', f: involvement_f, include_id: true %> <% end %> </div> <% end %> @@ -94,12 +89,10 @@ <%= render 'admin/education/programs/forms/part', part: :results do %> <div class="row"> <div class="col-xxl-6"> - <%= render 'admin/education/programs/forms/input_with_inheritance', - f: f, property: :opportunities %> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :opportunities %> </div> <div class="col-xxl-6"> - <%= render 'admin/education/programs/forms/input_with_inheritance', - f: f, property: :results %> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :results %> </div> </div> <% end %> @@ -107,20 +100,23 @@ <%= render 'admin/education/programs/forms/part', part: :admission do %> <div class="row"> <div class="col-xxl-6"> - <%= render 'admin/education/programs/forms/input_with_inheritance', - f: f, property: :prerequisites %> - <%= render 'admin/education/programs/forms/input_with_inheritance', - f: f, property: :accessibility %> - <%= render 'admin/education/programs/forms/input_with_inheritance', - f: f, property: :other %> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :prerequisites %> </div> <div class="col-xxl-6"> - <%= render 'admin/education/programs/forms/input_with_inheritance', - f: f, property: :pricing %> - <%= render 'admin/education/programs/forms/input_with_inheritance', - f: f, property: :registration %> - <%= render 'admin/education/programs/forms/input_with_inheritance', - f: f, property: :contacts %> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :pricing %> + </div> + <div class="col-xxl-6"> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :registration %> + <%= f.input :registration_url %> + </div> + <div class="col-xxl-6"> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :accessibility %> + </div> + <div class="col-xxl-6"> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :other %> + </div> + <div class="col-xxl-6"> + <%= render 'admin/education/programs/forms/input_with_inheritance', f: f, property: :contacts %> </div> </div> <% end %> diff --git a/app/views/admin/education/programs/show.html.erb b/app/views/admin/education/programs/show.html.erb index 7c6c2659641c685fd2c61a792013a301489c99bc..7e5bb279c4daaa373e7128d45fc1d2be2b2ab7c7 100644 --- a/app/views/admin/education/programs/show.html.erb +++ b/app/views/admin/education/programs/show.html.erb @@ -15,13 +15,16 @@ <%= 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('level') %> - </h3> - <p><%= @program.level_i18n %></p> - <%= render 'admin/application/property/text', - object: @program, - property: :duration %> + <% if @program.schools.any? %> + <h3 class="h5 mt-4"> + <%= Education::Program.human_attribute_name('schools') %> + </h3> + <ul class="list-unstyled"> + <% @program.schools.ordered.each do |school| %> + <li><%= link_to_if can?(:read, school), school, [:admin, school] %></li> + <% end %> + </ul> + <% end %> </div> <div class="col-lg-6"> <h3 class="h5"> @@ -44,22 +47,18 @@ <%= Education::Program.human_attribute_name('apprenticeship') %> </h3> <p><%= t @program.apprenticeship %></p> - <% if @program.schools.any? %> + <% if @program.downloadable_summary.attached? %> <h3 class="h5 mt-4"> - <%= Education::Program.human_attribute_name('schools') %> + <%= Education::Program.human_attribute_name('downloadable_summary') %> </h3> - <ul class="list-unstyled"> - <% @program.schools.ordered.each do |school| %> - <li><%= link_to_if can?(:read, school), school, [:admin, school] %></li> - <% end %> - </ul> + <p><%= link_to "#{@program.downloadable_summary.filename} (#{ number_to_human_size @program.downloadable_summary.blob.byte_size })", + url_for(@program.downloadable_summary), + target: :_blank %></p> <% end %> </div> </div> <% end %> - <%= render 'admin/education/programs/forms/part', - part: :presentation, - collapsed: true do %> + <%= render 'admin/education/programs/forms/part', part: :presentation, collapsed: true do %> <div class="row"> <div class="col-xxl-6"> <h3 class="h5"> @@ -68,75 +67,48 @@ <p><%= @program.presentation %></p> </div> <div class="col-xxl-6"> - <%= render 'admin/application/property/text', - object: @program, - property: :objectives %> + <%= render 'admin/application/property/text', object: @program, property: :objectives %> </div> </div> <% end %> <%= render 'admin/communication/blocks/list', about: @program %> - <%= render 'admin/education/programs/forms/part', - part: :pedagogy, - collapsed: true do %> + <%= render 'admin/education/programs/forms/part', part: :pedagogy, collapsed: true do %> <div class="row"> <div class="col-xxl-6"> - <%= render 'admin/application/property/text', - object: @program, - property: :content %> + <%= render 'admin/application/property/text', object: @program, property: :content %> </div> <div class="col-xxl-6"> - <%= render 'admin/application/property/text', - object: @program, - property: :pedagogy %> - <%= render 'admin/application/property/text', - object: @program, - property: :evaluation %> + <%= render 'admin/application/property/text', object: @program, property: :pedagogy %> + <%= render 'admin/application/property/text', object: @program, property: :evaluation %> </div> </div> - <%= render 'admin/education/programs/show/teachers', - involvements: @teacher_involvements %> + <%= render 'admin/education/programs/show/teachers', involvements: @teacher_involvements %> <% end %> - <%= render 'admin/education/programs/forms/part', - part: :results, - collapsed: true do %> + <%= render 'admin/education/programs/forms/part', part: :results, collapsed: true do %> <div class="row"> <div class="col-xxl-6"> - <%= render 'admin/application/property/text', - object: @program, - property: :opportunities %> + <%= render 'admin/application/property/text', object: @program, property: :opportunities %> </div> <div class="col-xxl-6"> - <%= render 'admin/application/property/text', - object: @program, - property: :results %> + <%= render 'admin/application/property/text', object: @program, property: :results %> </div> </div> <% end %> - <%= render 'admin/education/programs/forms/part', - part: :admission, - collapsed: true do %> + <%= render 'admin/education/programs/forms/part', part: :admission, collapsed: true do %> <div class="row"> <div class="col-xxl-6"> - <%= render 'admin/application/property/text', - object: @program, - property: :prerequisites %> - <%= render 'admin/application/property/text', - object: @program, - property: :accessibility %> - <%= render 'admin/application/property/text', - object: @program, - property: :other %> + <%= render 'admin/application/property/text', object: @program, property: :prerequisites %> + <%= render 'admin/application/property/text', object: @program, property: :registration %> + <%= render 'admin/application/property/text', object: @program, property: :other %> </div> <div class="col-xxl-6"> - <%= render 'admin/application/property/text', - object: @program, - property: :pricing %> - <%= render 'admin/application/property/text', - object: @program, - property: :registration %> - <%= render 'admin/application/property/text', - object: @program, - property: :contacts %> + <%= render 'admin/application/property/text', object: @program, property: :pricing %> + <%= render 'admin/application/property/text', object: @program, property: :accessibility %> + <%= render 'admin/application/property/text', object: @program, property: :contacts %> + <% if @program.registration_url.present? %> + <h3 class="h5"><%= Education::Program.human_attribute_name(:registration_url) %></h3> + <p><%= link_to @program.registration_url, @program.registration_url, target: :_blank %></p> + <% end %> </div> </div> <%= render 'admin/education/programs/show/roles', roles: @roles %> @@ -181,6 +153,9 @@ <% content_for :action_bar_left do %> <%= destroy_link @program %> + <%= link_to t('static'), + static_admin_education_program_path(@program), + class: button_classes('btn-light') if current_user.server_admin? %> <% end %> <% content_for :action_bar_right do %> diff --git a/app/views/admin/education/programs/static.html.erb b/app/views/admin/education/programs/static.html.erb index 9f0f1443fd7633ae09c94557e9adda8528a8e304..4125f02acbbc486359a2c3b263c7714f7531ab75 100644 --- a/app/views/admin/education/programs/static.html.erb +++ b/app/views/admin/education/programs/static.html.erb @@ -9,12 +9,23 @@ administrator_involvements = @about.involvements_through_roles %> title: > <%= @about.name %> -url: <%= @website.special_page(:education_programs).path %><%= @about.path %> +url: <%= @about.path_in_website(@website) %> +<% if @about.downloadable_summary.attached? %> +downloadable_summary: <%= @about.downloadable_summary.blob_id %> +<% end %> +registration_url: > + <%= @about.registration_url %> description: > <%= prepare_text_for_static @about.description %> presentation: > <%= prepare_text_for_static @about.presentation %> position: <%= @about.position %> +<% if @about.parent %> +parent: + title: > + <%= @about.parent.name %> + url: <%= @about.parent.path_in_website(@website) %> +<% end %> <%= render 'admin/communication/unsplash/static' %> category: "<%= @website.categories.find_by(program_id: @about.id)&.path %>" diplomas: "<%= @about.diploma&.slug %>" diff --git a/app/views/admin/university/alumni/experiences/_experience_fields.html.erb b/app/views/admin/university/alumni/experiences/_experience_fields.html.erb index eb6b7bd848e67df626f8d5ad055eadcb801578fb..2b431acba47f21ac7b356d0f6b76b59c5cbf8c90 100644 --- a/app/views/admin/university/alumni/experiences/_experience_fields.html.erb +++ b/app/views/admin/university/alumni/experiences/_experience_fields.html.erb @@ -1,44 +1,47 @@ -<% include_id ||= false %> +<% +include_id ||= false +hint = can?(:create, University::Organization) ? t('university.person.experience.no_organization_hint_html', url: new_admin_university_organization_path) : + t('university.person.experience.no_organization_hint_no_access_html') +%> <div class="nested-fields"> <div class="card mb-3"> <div class="card-body"> - <div class="row"> - <div class="col-md-5"> - <%= f.input :university_id, - as: :hidden, - input_html: { value: current_university.id }, - wrapper: false %> - <%= f.association :organization, - collection: current_university.organizations.ordered, - label: false, - include_blank: t('simple_form.include_blanks.defaults.organization'), - hint: can?(:create, University::Organization) ? t('university.person.experience.no_organization_hint_html', url: new_admin_university_organization_path) : - t('university.person.experience.no_organization_hint_no_access_html'), - required: true, - wrapper: false %> + <div class="d-flex"> + <div class="row flex-fill"> + <div class="col-md-6 col-xxl-4"> + <%= f.input :university_id, + as: :hidden, + input_html: { value: current_university.id }, + wrapper: false %> + <%= f.association :organization, + collection: current_university.organizations.ordered, + include_blank: t('simple_form.include_blanks.defaults.organization'), + hint: hint, + required: true, + wrapper: false %> + </div> + <div class="col-md-6 col-xxl-4"> + <%= f.input :description, as: :string %> + </div> + <div class="col-md-6 col-xxl-2"> + <%= f.input :from_year, + as: :select, + collection: ((Time.now.year).downto(1950)), + include_blank: University::Person::Experience.human_attribute_name('from_year'), + wrapper: false %> + </div> + <div class="col-md-6 col-xxl-2"> + <%= f.input :to_year, + as: :select, + collection: ((Time.now.year).downto(1950)), + include_blank: University::Person::Experience.human_attribute_name('to_year'), + wrapper: false %> + </div> </div> - <div class="col-md-3"> - <%= f.input :from_year, - as: :select, - collection: ((Time.now.year).downto(1950)), - label: false, - include_blank: University::Person::Experience.human_attribute_name('from_year'), - required: true, - wrapper: false %> - </div> - <div class="col-md-3"> - <%= f.input :to_year, - as: :select, - collection: ((Time.now.year).downto(1950)), - label: false, - include_blank: University::Person::Experience.human_attribute_name('to_year'), - required: true, - wrapper: false %> - </div> - <div class="col-md-1 text-end"> + <div> <%= link_to_remove_association '<i class="fas fa-times"></i>'.html_safe, - f, - class: 'btn btn-sm btn-danger' %> + f, + class: 'btn btn-sm btn-danger' %> </div> </div> </div> diff --git a/app/views/admin/university/alumni/experiences/edit.html.erb b/app/views/admin/university/alumni/experiences/edit.html.erb index e21fe1ce8a5bd9f3e8fca697cb9cc86f157f74a8..6e203626ca4e8a15ae479094e6f05bd3ea6fc4dc 100644 --- a/app/views/admin/university/alumni/experiences/edit.html.erb +++ b/app/views/admin/university/alumni/experiences/edit.html.erb @@ -6,25 +6,21 @@ <%= f.error_notification %> <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> - <div class="row"> - - <div class="col-md-2"> - <%= link_to_add_association t('add'), f, :experiences, - class: button_classes, - data: { - 'association-insertion-method': 'append', - 'association-insertion-node': '#experiences', - } %> - - </div> + <div class="mb-3"> + <%= link_to_add_association t('add'), + f, + :experiences, + class: button_classes, + data: { + 'association-insertion-method': 'append', + 'association-insertion-node': '#experiences', + } %> + </div> - <div class="col-md-10"> - <div id="experiences"> - <%= f.simple_fields_for :experiences, @alumnus.experiences.sort_by(&:from_year).reverse, include_id: false do |experience_f| %> - <%= render 'admin/university/alumni/experiences/experience_fields', f: experience_f, include_id: true %> - <% end %> - </div> - </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 %> + <% end %> </div> <% 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 fe27cf2c690364bbfd76336dbfa182ef58672feb..b87024b416852b349dbbce8d8bbdf415d164f5b8 100644 --- a/app/views/admin/university/alumni/show.html.erb +++ b/app/views/admin/university/alumni/show.html.erb @@ -22,23 +22,36 @@ <div class="card-header"> <h2 class="card-title mb-0 h5"><%= University::Person::Experience.model_name.human(count: @alumnus.experiences.count) %></h2> </div> - <div class="card-body"> - <ul class="list-unstyled"> - <% @alumnus.experiences.ordered.each do |experience| %> - <% organization = experience.organization %> - <li> - <%= link_to_if can?(:read, organization), organization, [:admin, organization] %> - <%= "(#{experience.from_year} - #{experience.to_year.present? ? experience.to_year : t('today')})" if experience.from_year %> - </li> - <% end %> - </ul> - </div> + <table class="table"> + <thead> + <tr> + <th><%= University::Person::Experience.human_attribute_name('description') %></th> + <th><%= University::Person::Experience.human_attribute_name('organization') %></th> + <th><%= University::Person::Experience.human_attribute_name('from_year') %></th> + <th><%= University::Person::Experience.human_attribute_name('to_year') %></th> + </tr> + </thead> + <tbody> + <% @alumnus.experiences.ordered.each do |experience| %> + <% organization = experience.organization %> + <tr> + <td><%= experience.description %></td> + <td><%= link_to_if can?(:read, organization), organization, [:admin, organization] %></td> + <td><%= experience.from_year %></td> + <td><%= experience.to_year %></td> + </tr> + <% end %> + </tbody> + </table> </div> <% end %> <% content_for :action_bar_right do %> <%= edit_link @alumnus %> - <%= link_to t('university.manage_cohorts'), cohorts_admin_university_alumnus_path(@alumnus), class: button_classes if can?(:update, @alumnus) %> - <%= link_to t('university.manage_experiences'), experiences_admin_university_alumnus_path(@alumnus), class: button_classes if can?(:update, @alumnus) %> + <%= link_to t('university.manage_cohorts'), + cohorts_admin_university_alumnus_path(@alumnus), + class: button_classes if can?(:update, @alumnus) %> + <%= link_to t('university.manage_experiences'), experiences_admin_university_alumnus_path(@alumnus), + class: button_classes if can?(:update, @alumnus) %> <% end %> diff --git a/app/views/admin/university/people/_main_infos.html.erb b/app/views/admin/university/people/_main_infos.html.erb index fafbbbb01c1b3cc082b9850a020e2e688d5b7f47..0693e24ce25716d7279acf0f0d8becf8fd36037e 100644 --- a/app/views/admin/university/people/_main_infos.html.erb +++ b/app/views/admin/university/people/_main_infos.html.erb @@ -1,5 +1,5 @@ <div class="row"> - <div class="col-md-8"> + <div class="col-md-8 col-xl-9"> <div class="card flex-fill w-100"> <div class="card-header"> <h2 class="card-title mb-0 h5"><%= t('content') %></h2> @@ -62,7 +62,7 @@ </div> <% end %> </div> - <div class="col-md-4"> + <div class="col-md-4 col-xl-3"> <div class="card flex-fill w-100"> <div class="card-header"> <h2 class="card-title mb-0 h5"><%= t('metadata') %></h2> diff --git a/app/views/admin/university/people/show.html.erb b/app/views/admin/university/people/show.html.erb index db2e0f177badf0c88839cb147a5044704a5939bb..026ee04e5cde26b495732848e3fedb3b8189ccdc 100644 --- a/app/views/admin/university/people/show.html.erb +++ b/app/views/admin/university/people/show.html.erb @@ -6,11 +6,13 @@ <h2 class="mb-3"><%= University::Person::Involvement.model_name.human(count: 2) %></h2> <div class="row"> - <div class="col-md-6"> - <%= render 'admin/education/teachers/show/programs', - involvements: @teacher_involvements, - param_name: :programs_page if @person.is_teacher? %> - </div> + <% if @person.is_teacher? && @teacher_involvements.any? %> + <div class="col-md-6"> + <%= render 'admin/education/teachers/show/programs', + involvements: @teacher_involvements, + param_name: :programs_page %> + </div> + <% end %> <div class="col-md-6"> <%= render 'admin/university/people/show/roles', involvements: @administrator_involvements, @@ -21,6 +23,10 @@ <% content_for :action_bar_left do %> <%= destroy_link @person %> + <%= link_to t('static'), + static_admin_university_person_path(@person), + target: :_blank, + class: button_classes('btn-light') if current_user.server_admin? %> <% end %> <% content_for :action_bar_right do %> diff --git a/app/views/admin/university/people/static.html.erb b/app/views/admin/university/people/static.html.erb index ea4e21c136f9dc9017bf4ae905a512b39287de28..24d2039ec892e5351bc3c3dd3fdaa5431d3f4578 100644 --- a/app/views/admin/university/people/static.html.erb +++ b/app/views/admin/university/people/static.html.erb @@ -2,11 +2,16 @@ title: > <%= @about.to_s %> slug: "<%= @about.slug %>" -first_name: "<%= @about.first_name %>" -last_name: "<%= @about.last_name %>" -phone: "<%= @about.phone_mobile %>" -email: "<%= @about.email %>" -twitter: "<%= @about.twitter %>" +first_name: > + <%= @about.first_name %> +last_name: > + <%= @about.last_name %> +phone: > + <%= @about.phone_mobile %> +email: > + <%= @about.email %> +twitter: > + <%= @about.twitter %> linkedin: >- <%= @about.linkedin %> website: >- @@ -31,5 +36,32 @@ roles: <% if @about.administrator.for_website?(@website) %> - administrator <% end %> +<% if @about.involvements_as_teacher.any? %> +teachings: +<% @about.involvements_as_teacher.each do |involvement| + target = involvement.target + %> + - description: > + <%= involvement.description %> + program: + title: > + <%= target.to_s %> + url: > + <%= target.path_in_website(@website) if target.respond_to? :path_in_website %> +<% end %> +<% end %> +<% if @about.roles_as_administrator.any? %> +administrative_missions: +<% @about.roles_as_administrator.each do |role| + target = role.target %> + - description: > + <%= role.to_s %> + target: + title: > + <%= target.to_s %> + url: > + <%= target.path_in_website(@website) if target.respond_to? :path_in_website %> +<% end %> +<% end %> --- <%= prepare_html_for_static @about.biography, @about.university %> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index b5e6644ce1d933ef78bfd483703c0b97b35371fe..c28642d8ddbee5c818c2cc315e97a55eb19dc9bb 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -97,6 +97,7 @@ en: description_short: Lead text featured_image: Featured image featured_image_alt: Alt text + full_width: Full width header_text: Title displayed in header parent: Parent page published: Published? @@ -160,6 +161,9 @@ en: placeholder: Enter credit link: target_blank: Open in new window + time_slot: + from: From + to: to templates: call_to_action: description: A title, a text, an optional image and up to 3 call to action buttons. @@ -191,6 +195,42 @@ en: text: label: Text placeholder: Enter text + contact: + description: Contact information and opening time, so anyone can get in touch. + edit: + add: Add + add_slot: Add a time slot + address: + label: Address + placeholder: Street and number + city: + label: City + placeholder: Enter the city + contacts: Mailing address + country: + label: Country + placeholder: Enter the country + element: + title: + label: Day + placeholder: Enter the day or period + time_slot_morning: + label: Morning (if necessary) + time_slot_afternoon: + label: Afternoon (or full day) + name: + label: Name (person, organization...) + placeholder: Enter the text + zipcode: + label: Zipcode + placeholder: Enter the zipcode + mails: + label: Mails + placeholder: Enter the mail + phones: + label: Telephone numbers + placeholder: Enter the number + slots: Opening times datatable: description: A table of data, as responsive and accessible as possible. edit: @@ -369,6 +409,10 @@ en: id: label: '' placeholder: Choose post + programs: + description: A selection of programs. + edit: + add: Add a program testimonials: description: One or more testimonies edit: @@ -544,6 +588,7 @@ en: template_kind: call_to_action: Call to action chapter: Chapter + contact: Contact datatable: Table definitions: Definitions embed: HTML embed @@ -555,6 +600,7 @@ en: pages: Pages partners: Partners posts: Posts + programs: Programs testimonials: Testimonials timeline: Timeline video: Video @@ -592,5 +638,6 @@ en: communication_website_page: breadcrumb_title: If the field is empty, page title will be used in breadcrumbs. description: If this field is empty, the "lead text" field will be used. If also emty the main text's begining will be used. + full_width: On large screens, a full width page uses all available space for the content. This is good for landing pages, or to make them spectacular. If the page is not full width, the content column will be smaller to make reading easier. The unused space might be used for a table of contents. communication_website_post: description: If this field is empty, the "lead text" field will be used. If also emty the main text's begining will be used. diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 3360033356516d95a8acc9fff0f7976c3dbbdd97..5017d765186c4fea73bc22609bafbd50e25ec416 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -97,6 +97,7 @@ fr: description_short: Chapô featured_image: Image à la une featured_image_alt: Texte alternatif + full_width: Pleine largeur header_text: Titre affiché dans le header parent: Page parente published: Publié ? @@ -160,6 +161,9 @@ fr: placeholder: Entrer le crédit link: target_blank: Ouvrir dans une nouvelle fenêtre + time_slot: + from: De + to: à templates: call_to_action: description: Un titre, un texte, un visuel et 3 boutons pour inviter les personnes à agir. @@ -191,6 +195,42 @@ fr: text: label: Texte placeholder: Entrer le texte + contact: + description: Des coordonnées et des horaires d'ouverture, tout ce qu'il faut pour être contacté. + edit: + add: Ajouter + add_slot: Ajouter un créneau horaire + address: + label: Adresse + placeholder: Numéro et voie + city: + label: Ville + placeholder: Entrer le nom de la ville + contacts: Adresse postale + country: + label: Pays + placeholder: Entrer le nom du pays + element: + title: + label: Jour + placeholder: Entrer le jour ou la période + time_slot_morning: + label: Matin (si nécessaire) + time_slot_afternoon: + label: Après-midi (ou jour complet) + name: + label: Nom (personne, établissement...) + placeholder: Entrer le texte + zipcode: + label: Code postal + placeholder: Entrer le code postal + mails: + label: Mails + placeholder: Entrer le mail + phones: + label: Téléphones + placeholder: Entrer le numéro + slots: Horaires datatable: description: Un tableau de données, aussi responsive et accessible que possible. edit: @@ -198,7 +238,7 @@ fr: label: Transcription textuelle placeholder: Entrer ici la transcription textuelle du tableau definitions: - description: Une liste de termes et leur définition. Un genre de dictionnaires, finalement. + description: Une liste de termes et leur définition. Un genre de dictionnaire, finalement. edit: add_definition: Ajouter une définition remove_definition: Supprimer la définition @@ -373,6 +413,10 @@ fr: id: label: '' placeholder: Choisir l'article + programs: + description: Une sélection de formations. + edit: + add: Ajouter une formation testimonials: description: Un ou plusieurs témoignages, avec le texte, l'auteur, sa fonction et sa photo. edit: @@ -548,6 +592,7 @@ fr: template_kind: call_to_action: Appel à actions chapter: Chapitre + contact: Contact datatable: Tableau definitions: Définitions embed: Intégration HTML @@ -559,6 +604,7 @@ fr: pages: Pages partners: Partenaires posts: Actualités + programs: Formations testimonials: Témoignages timeline: Frise chronologique video: Vidéo @@ -596,5 +642,6 @@ fr: communication_website_page: breadcrumb_title: Si ce champ est vide le titre de la page sera utilisé dans le fil d'Ariane. description: Si ce champ est vide le "chapô" sera utilisé. Si il est également vide le début du texte principal sera utilisé. + full_width: Sur de grands écrans, la page en pleine largeur utilisera tout l'espace disponible, ce qui est pertinent pour événementialiser une page. Si la page n'est pas en pleine largeur, l'espace dédié au contenu sera réduit pour faciliter la lecture, et l'espace libre pourra être utilisé pour une table des matières facilitant la navigation. communication_website_post: description: Si ce champ est vide le "chapô" sera utilisé. Si il est également vide le début du texte principal sera utilisé. diff --git a/config/locales/education/en.yml b/config/locales/education/en.yml index e931202a98f599a3a311af1648d254dfdb094578..c3fc9d2a5792ba56a227c80061069981b0fe660d 100644 --- a/config/locales/education/en.yml +++ b/config/locales/education/en.yml @@ -40,8 +40,9 @@ en: contacts: Contacts continuing: Continuing training description: Meta Description - duration: Duration diploma: Diploma + duration: Duration + downloadable_summary: Downloadable summary ects: Crédits ECTS evaluation: Modalités d’évaluation featured_image: Featured image @@ -59,6 +60,7 @@ en: pricing: Tarifs published: Published? registration: Modalités et délais d’accès + registration_url: Registration link (URL) roles: Roles schools: Schools with this formation short_name: Short name diff --git a/config/locales/education/fr.yml b/config/locales/education/fr.yml index 21cb53f3c241ddb7d4ac192cbc96664ca39372eb..88f83eede8b6d70ae8f20931704d600070513cde 100644 --- a/config/locales/education/fr.yml +++ b/config/locales/education/fr.yml @@ -40,8 +40,9 @@ fr: contacts: Contacts continuing: Formation continue description: Meta Description - duration: Durée diploma: Diplôme + duration: Durée + downloadable_summary: Document de synthèse téléchargeable ects: Crédits ECTS evaluation: Modalités d’évaluation featured_image: Image à la une @@ -59,6 +60,7 @@ fr: pricing: Tarifs published: Publiée ? registration: Modalités et délais d’accès + registration_url: Lien d'inscription (URL) roles: Rôles schools: Écoles proposant cette formation short_name: Nom abrégé diff --git a/config/locales/en.yml b/config/locales/en.yml index fed2ca7a2eded103e2d6343a7e000ae1914004c6..81d8721d041f8b765046598b0036baaf8552c619 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -236,6 +236,9 @@ en: desktop: Desktop privacy_policy: Privacy policy privacy_policy_url: https://osuny.org/politique-de-confidentialite + properties: + text: + missing: Missing text quit: Quit remove: Remove reset: Reset @@ -259,7 +262,7 @@ en: test_chars: "%{min_length} characters min." show: Show slug_error: can only contain downcase letters, numbers, and dashes. - sms_code: "%{code} is your authentication code on %{university} (valid #{duration})" + sms_code: "%{code} is your authentication code on %{university} (valid %{duration})" static: Static file terms_of_service: Terms of service terms_of_service_url: https://osuny.org/conditions-d-utilisation diff --git a/config/locales/fr.yml b/config/locales/fr.yml index e3a2ea6c1bf353ffc0364da69b9e0d3b4be4a8bf..d6ff7c7d58f7db7a2916ff779070495020bfb808 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -239,6 +239,9 @@ fr: desktop: Ordinateur de bureau privacy_policy: Politique de confidentialité privacy_policy_url: https://osuny.org/politique-de-confidentialite + properties: + text: + missing: Texte manquant quit: Quitter remove: Retirer reset: Réinitialiser @@ -262,7 +265,7 @@ fr: test_chars: "%{min_length} caractères min." show: Voir slug_error: ne peut contenir que des lettres minuscules, des chiffres et des traits d'union. - sms_code: "%{code} est votre code d'authentification sur %{university} (valide #{duration})" + sms_code: "%{code} est votre code d'authentification sur %{university} (valide %{duration})" static: Fichier statique terms_of_service: Conditions d'utilisation terms_of_service_url: https://osuny.org/conditions-d-utilisation diff --git a/config/locales/university/en.yml b/config/locales/university/en.yml index 9dd425381302d745bc4ac1feccf4bcccfd529845..5f5cfdffb8adfa5a131febc79f579bdc33990b04 100644 --- a/config/locales/university/en.yml +++ b/config/locales/university/en.yml @@ -69,6 +69,8 @@ en: user: User zipcode: Zipcode university/person/experience: + description: Description + organization: Organization from_year: Start year to_year: End year university/person/involvement: @@ -170,8 +172,8 @@ en: person: administrator_roles: Administrator roles experience: - no_organization_hint_html: "If the organization is not in the list,<br>you can <a href=\"%{url}\">create it</a>" - no_organization_hint_no_access_html: "If the organization is not in the list,<br>you should ask to create it" + 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 taught_programs: Taught programs sso: SSO diff --git a/config/locales/university/fr.yml b/config/locales/university/fr.yml index 372231343584187ba32c07f66670ef1deabd0899..e02d65e3a48d06e7d01311c4007583e1d77e18d8 100644 --- a/config/locales/university/fr.yml +++ b/config/locales/university/fr.yml @@ -69,6 +69,8 @@ fr: user: Utilisateur zipcode: Code postal university/person/experience: + description: Description + organization: Organisation from_year: Année de début to_year: Année de fin university/person/involvement: @@ -170,8 +172,8 @@ fr: person: administrator_roles: Rôles administratifs experience: - no_organization_hint_html: "Si l'entreprise n'apparait pas dans la liste,<br>vous pouvez la <a href=\"%{url}\">créer</a>" - no_organization_hint_no_access_html: "Si l'entreprise n'apparait pas dans la liste,<br>il faut demander à la créer" + 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 taught_programs: Formations enseignées sso: SSO diff --git a/config/routes/admin/education.rb b/config/routes/admin/education.rb index acac8d244692957fc6a9cf4d645c3ae66e928e55..e49cba17aa8ba69a18a8b36460a6545db4eb3b6c 100644 --- a/config/routes/admin/education.rb +++ b/config/routes/admin/education.rb @@ -31,9 +31,14 @@ namespace :education do member do get :children get :preview + get :static end end resources :academic_years resources :cohorts, only: [:index, :show] - resources :diplomas + resources :diplomas do + member do + get :static + end + end end diff --git a/config/routes/admin/university.rb b/config/routes/admin/university.rb index 0f453c7e503161cb1d72e2680ccb33025b24ff50..ce33420c960d8d6c8f639facec80eb197496f8ff 100644 --- a/config/routes/admin/university.rb +++ b/config/routes/admin/university.rb @@ -19,5 +19,10 @@ namespace :university do patch 'experiences' => 'alumni/experiences#update' end end - resources :people, :organizations + resources :people do + member do + get :static + end + end + resources :organizations end diff --git a/db/migrate/20220722103657_add_full_width_to_communication_website_page.rb b/db/migrate/20220722103657_add_full_width_to_communication_website_page.rb new file mode 100644 index 0000000000000000000000000000000000000000..fe39e1f418e1746cb82328703a118dab65c559a6 --- /dev/null +++ b/db/migrate/20220722103657_add_full_width_to_communication_website_page.rb @@ -0,0 +1,5 @@ +class AddFullWidthToCommunicationWebsitePage < ActiveRecord::Migration[6.1] + def change + add_column :communication_website_pages, :full_width, :boolean, default: false + end +end diff --git a/db/migrate/20220727075720_add_registration_url_to_education_program.rb b/db/migrate/20220727075720_add_registration_url_to_education_program.rb new file mode 100644 index 0000000000000000000000000000000000000000..f8bb644a96154e559ba47a1f80f52b397245cfb8 --- /dev/null +++ b/db/migrate/20220727075720_add_registration_url_to_education_program.rb @@ -0,0 +1,5 @@ +class AddRegistrationUrlToEducationProgram < ActiveRecord::Migration[6.1] + def change + add_column :education_programs, :registration_url, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 3a8420e9472bf89d4c66b57b80fd563e0be2fd80..5c8796c4a5ed371b4a1c0dcf596fcafd0a78d012 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,14 +10,14 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_07_04_164321) do +ActiveRecord::Schema.define(version: 2022_07_27_075720) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" enable_extension "unaccent" - create_table "action_text_rich_texts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "action_text_rich_texts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.string "name", null: false t.text "body" t.string "record_type", null: false @@ -27,7 +27,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true end - create_table "active_storage_attachments", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "active_storage_attachments", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.string "name", null: false t.string "record_type", null: false t.uuid "record_id", null: false @@ -37,7 +37,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true end - create_table "active_storage_blobs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "active_storage_blobs", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.string "key", null: false t.string "filename", null: false t.string "content_type" @@ -51,13 +51,13 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_active_storage_blobs_on_university_id" end - create_table "active_storage_variant_records", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "active_storage_variant_records", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "blob_id", null: false t.string "variation_digest", null: false t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true end - create_table "administration_qualiopi_criterions", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "administration_qualiopi_criterions", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.integer "number" t.text "name" t.text "description" @@ -65,7 +65,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.datetime "updated_at", precision: 6, null: false end - create_table "administration_qualiopi_indicators", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "administration_qualiopi_indicators", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "criterion_id", null: false t.integer "number" t.text "name" @@ -79,7 +79,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["criterion_id"], name: "index_administration_qualiopi_indicators_on_criterion_id" end - create_table "communication_blocks", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_blocks", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "about_type" t.uuid "about_id" @@ -94,7 +94,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_communication_blocks_on_university_id" end - create_table "communication_extranets", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_extranets", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.uuid "university_id", null: false t.string "domain" @@ -106,7 +106,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_communication_extranets_on_university_id" end - create_table "communication_website_categories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_categories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "name" @@ -136,7 +136,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["communication_website_post_id", "communication_website_category_id"], name: "post_category" end - create_table "communication_website_git_files", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_git_files", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.string "previous_path" t.string "about_type", null: false t.uuid "about_id", null: false @@ -148,7 +148,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["website_id"], name: "index_communication_website_git_files_on_website_id" end - create_table "communication_website_imported_authors", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_authors", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.uuid "author_id" @@ -164,7 +164,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["website_id"], name: "idx_communication_website_imported_auth_on_website" end - create_table "communication_website_imported_categories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_categories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.uuid "category_id" @@ -182,7 +182,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["website_id"], name: "idx_communication_website_imported_cat_on_website" end - create_table "communication_website_imported_media", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_media", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.string "identifier" t.jsonb "data" t.text "file_url" @@ -197,7 +197,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["website_id"], name: "index_communication_website_imported_media_on_website_id" end - create_table "communication_website_imported_pages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_pages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.uuid "page_id" @@ -221,7 +221,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["website_id"], name: "index_communication_website_imported_pages_on_website_id" end - create_table "communication_website_imported_posts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_posts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.uuid "post_id" @@ -246,7 +246,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["website_id"], name: "index_communication_website_imported_posts_on_website_id" end - create_table "communication_website_imported_websites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_websites", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.integer "status", default: 0 @@ -256,7 +256,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["website_id"], name: "index_communication_website_imported_websites_on_website_id" end - create_table "communication_website_menu_items", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_menu_items", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.uuid "menu_id", null: false @@ -276,7 +276,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["website_id"], name: "index_communication_website_menu_items_on_website_id" end - create_table "communication_website_menus", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_menus", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "title" @@ -288,7 +288,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_communication_website_menus_on_university_id" end - create_table "communication_website_pages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_pages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "title" @@ -310,13 +310,14 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.string "bodyclass" t.uuid "language_id" t.text "featured_image_credit" + t.boolean "full_width", default: false t.index ["communication_website_id"], name: "index_communication_website_pages_on_communication_website_id" t.index ["language_id"], name: "index_communication_website_pages_on_language_id" t.index ["parent_id"], name: "index_communication_website_pages_on_parent_id" t.index ["university_id"], name: "index_communication_website_pages_on_university_id" end - create_table "communication_website_posts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_posts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "title" @@ -340,7 +341,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_communication_website_posts_on_university_id" end - create_table "communication_websites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_websites", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "url" @@ -387,7 +388,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["priority", "run_at"], name: "delayed_jobs_priority" end - create_table "education_academic_years", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "education_academic_years", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.integer "year" t.datetime "created_at", precision: 6, null: false @@ -402,7 +403,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_person_id", "education_academic_year_id"], name: "index_person_academic_year" end - create_table "education_cohorts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "education_cohorts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "program_id", null: false t.uuid "academic_year_id", null: false @@ -421,7 +422,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_person_id", "education_cohort_id"], name: "index_person_cohort" end - create_table "education_diplomas", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "education_diplomas", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "short_name" t.integer "level", default: 0 @@ -434,7 +435,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_education_diplomas_on_university_id" end - create_table "education_programs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "education_programs", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.integer "level" @@ -468,6 +469,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.string "short_name" t.boolean "initial" t.boolean "apprenticeship" + t.string "registration_url" 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" @@ -493,7 +495,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["education_program_id", "user_id"], name: "index_education_programs_users_on_program_id_and_user_id" end - create_table "education_schools", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "education_schools", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "address" @@ -508,7 +510,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_education_schools_on_university_id" end - create_table "imports", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "imports", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.integer "number_of_lines" t.jsonb "processing_errors" t.integer "kind" @@ -521,14 +523,14 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["user_id"], name: "index_imports_on_user_id" end - create_table "languages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "languages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "iso_code" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false end - create_table "research_journal_articles", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "research_journal_articles", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.string "title" t.datetime "published_at" t.uuid "university_id", null: false @@ -558,7 +560,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["researcher_id"], name: "index_research_journal_articles_researchers_on_researcher_id" end - create_table "research_journal_volumes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "research_journal_volumes", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "research_journal_id", null: false t.string "title" @@ -577,7 +579,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_research_journal_volumes_on_university_id" end - create_table "research_journals", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "research_journals", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "title" t.text "description" @@ -589,7 +591,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_research_journals_on_university_id" end - create_table "research_laboratories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "research_laboratories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "address" @@ -601,7 +603,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_research_laboratories_on_university_id" end - create_table "research_laboratory_axes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "research_laboratory_axes", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "research_laboratory_id", null: false t.string "name" @@ -615,7 +617,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_research_laboratory_axes_on_university_id" end - create_table "research_theses", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "research_theses", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "research_laboratory_id", null: false t.uuid "author_id", null: false @@ -633,7 +635,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_research_theses_on_university_id" end - create_table "universities", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "universities", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "identifier" t.string "address" @@ -657,7 +659,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.jsonb "sso_mapping" end - create_table "university_organizations", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "university_organizations", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "long_name" @@ -680,7 +682,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_university_organizations_on_university_id" end - create_table "university_people", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "university_people", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "user_id" t.string "last_name" @@ -716,7 +718,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["user_id"], name: "index_university_people_on_user_id" end - create_table "university_person_experiences", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "university_person_experiences", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "person_id", null: false t.uuid "organization_id", null: false @@ -730,7 +732,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_university_person_experiences_on_university_id" end - create_table "university_person_involvements", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "university_person_involvements", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "person_id", null: false t.integer "kind" @@ -745,7 +747,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_university_person_involvements_on_university_id" end - create_table "university_roles", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "university_roles", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "target_type" t.uuid "target_id" @@ -757,7 +759,7 @@ ActiveRecord::Schema.define(version: 2022_07_04_164321) do t.index ["university_id"], name: "index_university_roles_on_university_id" end - create_table "users", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + create_table "users", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "first_name" t.string "last_name"