diff --git a/app/views/admin/communication/blocks/templates/pages/_preview.html.erb b/app/views/admin/communication/blocks/templates/pages/_preview.html.erb index 42f0873509ba6bec96c72a782d8ebf2352379e5e..36bf97d8769a3bc319ac57580dc8cb27b15e23fc 100644 --- a/app/views/admin/communication/blocks/templates/pages/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/pages/_preview.html.erb @@ -5,49 +5,90 @@ unless @block.title.blank? end class_name += " block-pages--" + @block.template.layout %> -<section class="<%= class_name %>" style="display: none;"> +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> - <% if @block.data %> - <% if @block.template.page %> - <%#= @block.template.page.slug %> - <% end %> + <% unless @block.title.blank? %> + <div class="top"> + <% unless @block.title.blank? %> - <% if @block.template.show_main_description %> - <p></p> + <% if @block.template.layout === "cards" || @block.template.layout === "list" %> + <h2><%= link_to @block.template.page, @block.template.page.url %></h2> + + <% elsif @block.template.layout === "grid" && @block.template.page && @block.template.show_main_description %> + <h2><%= link_to @block.title, @block.template.page.url %></h2> + <p class="description"><%= @block.template.page.summary %></p> + + <% else %> + <h2><%= @block.title %></h2> + <% end %> + + <% end %> + <% if @block.template.layout === "cards" && @block.template.show_main_description && @block.data %> + <div class="description"> + <p><%= @block.template.page.summary %></p> + </div> + <% end %> + </div> + <% if @block.template.layout === "list" && @block.template.show_main_description && @block.data %> + <p class="description"><%= @block.template.page.summary %></p> <% end %> + <% end %> + <% if @block.data %> <% if @block.template.layout === "list" %> - <ul> - <% @block.template.elements.each do |element| %> - <li> - <%#= element %> - </li> + <% @block.template.selected_pages.each do |page| + next if page.nil? + %> + <li><%= link_to page, page.url %></li> <% end %> </ul> <% elsif @block.template.layout === "cards" %> - <div class="cards"> - <% @block.template.elements.each do |element| %> + <% @block.template.selected_pages.each do |page| + next if page.nil? + %> <article class="card"> - <%# <%= element %> + <h3> + <%= link_to page, page.url %> + </h3> <% if @block.template.show_description %> - <p><%#= element.summary %></p> + <p><%= page.summary %></p> + <% end %> + + <p class="more meta" aria-hidden="true"><%= t 'admin.communication.blocks.templates.pages.layouts.cards.more' %></p> + + <% if @block.template.show_image %> + <div class="media" itemprop="image"> + <% if page.featured_image.attached? %> + <%= kamifusen_tag page.featured_image %> + <% end %> + </div> <% end %> </article> <% end %> </div> <% else %> - <div class="grid"> - <% @block.template.elements.each do |element| %> + <% @block.template.selected_pages.each do |page| + next if page.nil? + %> <article> - <%# <%= element %> + <h3> + <%= link_to page, page.url %> + </h3> <% if @block.template.show_description %> - <p><%#= element.summary %></p> + <p><%= page.summary %></p> + <% end %> + <% if @block.template.show_image %> + <div class="media" itemprop="image"> + <% if page.featured_image.attached? %> + <%= kamifusen_tag page.featured_image %> + <% end %> + </div> <% end %> </article> <% end %> diff --git a/app/views/admin/communication/blocks/templates/posts/_preview.html.erb b/app/views/admin/communication/blocks/templates/posts/_preview.html.erb index 0d73386078540ecaa076a29d2db3ed8cbbeb7d8f..3e1fa9f7d19e174fb56c77821c69e5b914e47204 100644 --- a/app/views/admin/communication/blocks/templates/posts/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/posts/_preview.html.erb @@ -1,11 +1,13 @@ <% -$class = "block block-posts" +class_name = "block block-posts" unless @block.title.blank? - $class += " block-with-title" + class_name += " block-with-title" end -$class += " block-posts--" + @block.template.layout +class_name += " block-posts--" + @block.template.layout + +date_format = "%e %B %Y" %> -<section class="<%= $class %>"> +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> <% unless @block.title.blank? %> @@ -13,26 +15,148 @@ $class += " block-posts--" + @block.template.layout <h2><%= @block.title %></h2> </div> <% end %> - <div class="list"> - <% if @block.data %> - <% @block.template.selected_posts.each do |post| %> - <article class="post" itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting"> - <div class="post-content"> - <a href="#"><%= post %></a> - <p itemprop="articleBody"><%= post.summary %></p> - </div> - <div class="post-meta"> - <time itemprop="datePublished" datetime="<%= post.published_at %>"><%= post.published_at.to_date %></time> - </div> - <% if post.best_featured_image.attached? %> + + <% if @block.template.layout === "list" %> + <div class="list"> + <% if @block.data %> + <% @block.template.selected_posts.each do |post| %> + <article class="post" itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting"> + <div class="post-content"> + <h3 itemprop="headline"> + <%= link_to post, post.url %> + </h3> + <% if !post.categories.empty? %> + <ul class="post-categories"> + <% post.categories.each do |category| %> + <%= link_to category, category.path %> + <% end %> + </ul> + <% end %> + <p itemprop="articleBody"><%= post.summary %></p> + <div class="post-meta"> + <time itemprop="datePublished" datetime="<%= post.published_at %>"><%= l(post.published_at, format: date_format) %></time> + <% if post.author.present? %> + <div class="post-author" itemscope itemtype="https://schema.org/Person" itemprop="author"> + <p itemprop="name"><%= post.author %></p> + </div> + <% end %> + </div> + </div> <div class="media"> - <%= kamifusen_tag post.best_featured_image %> + <% if post.best_featured_image.attached? %> + <%= kamifusen_tag post.best_featured_image %> + <% end %> </div> - <% end %> - </article> + </article> + <% end %> <% end %> + </div> + + <% elsif @block.template.layout === "highlight"%> + <% if @block.data + $highlight_post = @block.template.selected_posts.first + %> + <div class="highlight"> + <div class="highlight-post"> + <article class="post" itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting"> + <div class="post-content"> + <h3 itemprop="headline"> + <%= link_to $highlight_post, $highlight_post.url %> + </h3> + <% if !$highlight_post.categories.empty? %> + <ul class="post-categories"> + <% $highlight_post.categories.each do |category| %> + <%= link_to category, category.path %> + <% end %> + </ul> + <% end %> + <p itemprop="articleBody"><%= $highlight_post.summary %></p> + <div class="post-meta"> + <time itemprop="datePublished" datetime="<%= $highlight_post.published_at %>"><%= l($highlight_post.published_at, format: date_format) %></time> + <% if $highlight_post.author.present? %> + <div class="post-author" itemscope itemtype="https://schema.org/Person" itemprop="author"> + <p itemprop="name"><%= $highlight_post.author %></p> + </div> + <% end %> + </div> + </div> + <div class="media"> + <% if $highlight_post.best_featured_image.attached? %> + <%= kamifusen_tag $highlight_post.best_featured_image %> + <% end %> + </div> + </article> + </div> + + <div class="list"> + <% @block.template.selected_posts.each do |post| + next if post.nil? + %> + <article class="post" itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting"> + <div class="post-content"> + <h3 itemprop="headline"> + <%= link_to post, post.url %> + </h3> + <% if !post.categories.empty? %> + <ul class="post-categories"> + <% post.categories.each do |category| %> + <%= link_to category, category.path %> + <% end %> + </ul> + <% end %> + <p itemprop="articleBody"><%= post.summary %></p> + <div class="post-meta"> + <time itemprop="datePublished" datetime="<%= post.published_at %>"><%= l(post.published_at, format: date_format) %></time> + <% if post.author.present? %> + <div class="post-author" itemscope itemtype="https://schema.org/Person" itemprop="author"> + <p itemprop="name"><%= post.author %></p> + </div> + <% end %> + </div> + </div> + </article> + <% end %> + </div> + </div> <% end %> - </div> + <% else %> + <div class="grid"> + <% if @block.data %> + <% @block.template.selected_posts.each do |post| + next if post.nil? + %> + <article class="post" itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting"> + <div class="post-content"> + <h3 itemprop="headline"> + <%= link_to post, post.url %> + </h3> + <% if !post.categories.empty? %> + <ul class="post-categories"> + <% post.categories.each do |category| %> + <%= link_to category, category.path %> + <% end %> + </ul> + <% end %> + <p itemprop="articleBody"><%= post.summary %></p> + <div class="post-meta"> + <time itemprop="datePublished" datetime="<%= post.published_at %>"><%= l(post.published_at, format: date_format) %></time> + <% if post.author.present? %> + <div class="post-author" itemscope itemtype="https://schema.org/Person" itemprop="author"> + <p itemprop="name"><%= post.author %></p> + </div> + <% end %> + </div> + </div> + <div class="media"> + <% if post.best_featured_image.attached? %> + <%= kamifusen_tag post.best_featured_image %> + <% end %> + </div> + </article> + <% end %> + <% end %> + </div> + <% end %> </div> </div> </section> \ No newline at end of file diff --git a/app/views/admin/communication/blocks/templates/programs/_preview.html.erb b/app/views/admin/communication/blocks/templates/programs/_preview.html.erb index adda2a10c96ddae8c77b783cac0f71414345269d..6abdb0c738143387ec6cb657c7c6b9aa22c9145f 100644 --- a/app/views/admin/communication/blocks/templates/programs/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/programs/_preview.html.erb @@ -1,16 +1,27 @@ <% -$class = "block block-programs" +class_name = "block block-programs" unless @block.title.blank? - $class += " block-with-title" + class_name += " block-with-title" end %> -<section class="<%= $class %>" style="display: none;"> + +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> + <% unless @block.title.blank? %> + <div class="top"> + <% unless @block.title.blank? %> + <h2><%= @block.title %></h2> + <% end %> + </div> + <% end %> <ol class="programs"> - <% @block.template.selected_programs.each do |program| %> + <% @block.template.elements.each do |element| + program = element.program + next if program.nil? + %> <li> - <%= program %></p> + <%= link_to program, [:admin, program] %> </li> <% end %> </ol> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 609c93f67e84e8da98d5e20087a25fb09b7d648c..e286af195cea02007932cf7955fe81d11a37cd8a 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -467,6 +467,7 @@ en: cards: label: Cards description: Side by side cards, same height, strong color on rollover. Perfect for a small amount of pages. + more: Show more grid: label: Grid description: As a grid, left to right and top to bottom. diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index bd8bb87a8481ec6b37a48da42e9c09b7496ca8e3..7ffc42b334ffb299e9025232211af72766fb3d46 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -467,6 +467,7 @@ fr: cards: label: Cartes description: Des cartes côte à côte, de même hauteur, avec une couleur forte au survol. Ce format est idéal pour un petit nombre de pages. + more: En savoir plus grid: label: Grille description: Les pages sont présentées en grille, de gauche à droite puis de haut en bas. diff --git a/db/schema.rb b/db/schema.rb index 90fb648f002649d4e932e84f13512ca13f023a81..37ee1f26306b4e5fbe4e0d626d916c474dc21de6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -16,7 +16,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do enable_extension "plpgsql" enable_extension "unaccent" - create_table "action_text_rich_texts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "action_text_rich_texts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name", null: false t.text "body" t.string "record_type", null: false @@ -26,7 +26,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) 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: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "active_storage_attachments", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name", null: false t.string "record_type", null: false t.uuid "record_id", null: false @@ -36,7 +36,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) 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: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "active_storage_blobs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "key", null: false t.string "filename", null: false t.string "content_type" @@ -50,13 +50,13 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_active_storage_blobs_on_university_id" end - create_table "active_storage_variant_records", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "active_storage_variant_records", id: :uuid, default: -> { "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: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "administration_qualiopi_criterions", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.integer "number" t.text "name" t.text "description" @@ -64,7 +64,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.datetime "updated_at", null: false end - create_table "administration_qualiopi_indicators", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "administration_qualiopi_indicators", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "criterion_id", null: false t.integer "number" t.text "name" @@ -78,23 +78,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["criterion_id"], name: "index_administration_qualiopi_indicators_on_criterion_id" end - create_table "communication_block_headings", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| - t.uuid "university_id", null: false - t.string "about_type", null: false - t.uuid "about_id", null: false - t.string "title" - t.integer "level", default: 2 - t.uuid "parent_id" - t.integer "position" - t.string "slug" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["about_type", "about_id"], name: "index_communication_block_headings_on_about" - t.index ["parent_id"], name: "index_communication_block_headings_on_parent_id" - t.index ["university_id"], name: "index_communication_block_headings_on_university_id" - end - - create_table "communication_blocks", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_blocks", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "about_type" t.uuid "about_id" @@ -105,9 +89,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.datetime "updated_at", null: false t.string "title" t.boolean "published", default: true - t.uuid "heading_id" t.index ["about_type", "about_id"], name: "index_communication_website_blocks_on_about" - t.index ["heading_id"], name: "index_communication_blocks_on_heading_id" t.index ["university_id"], name: "index_communication_blocks_on_university_id" end @@ -193,7 +175,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_communication_extranet_posts_on_university_id" end - create_table "communication_extranets", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_extranets", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.uuid "university_id", null: false t.string "host" @@ -225,7 +207,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_communication_extranets_on_university_id" end - create_table "communication_website_categories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_categories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "name" @@ -259,22 +241,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["communication_website_post_id", "communication_website_category_id"], name: "post_category" end - create_table "communication_website_connections", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| - t.uuid "university_id", null: false - t.uuid "website_id", null: false - t.string "indirect_object_type", null: false - t.uuid "indirect_object_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "direct_source_type" - t.uuid "direct_source_id" - t.index ["direct_source_type", "direct_source_id"], name: "index_communication_website_connections_on_source" - t.index ["indirect_object_type", "indirect_object_id"], name: "index_communication_website_connections_on_object" - t.index ["university_id"], name: "index_communication_website_connections_on_university_id" - t.index ["website_id"], name: "index_communication_website_connections_on_website_id" - end - - create_table "communication_website_git_files", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_git_files", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "previous_path" t.string "about_type", null: false t.uuid "about_id", null: false @@ -286,7 +253,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["website_id"], name: "index_communication_website_git_files_on_website_id" end - create_table "communication_website_imported_authors", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_authors", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.uuid "author_id" @@ -302,7 +269,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["website_id"], name: "idx_communication_website_imported_auth_on_website" end - create_table "communication_website_imported_categories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_categories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.uuid "category_id" @@ -320,7 +287,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["website_id"], name: "idx_communication_website_imported_cat_on_website" end - create_table "communication_website_imported_media", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_media", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "identifier" t.jsonb "data" t.text "file_url" @@ -335,7 +302,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["website_id"], name: "index_communication_website_imported_media_on_website_id" end - create_table "communication_website_imported_pages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_pages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.uuid "page_id" @@ -359,7 +326,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["website_id"], name: "index_communication_website_imported_pages_on_website_id" end - create_table "communication_website_imported_posts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_posts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.uuid "post_id" @@ -384,7 +351,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["website_id"], name: "index_communication_website_imported_posts_on_website_id" end - create_table "communication_website_imported_websites", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_imported_websites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.integer "status", default: 0 @@ -394,7 +361,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["website_id"], name: "index_communication_website_imported_websites_on_website_id" end - create_table "communication_website_menu_items", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_menu_items", id: :uuid, default: -> { "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 @@ -414,7 +381,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["website_id"], name: "index_communication_website_menu_items_on_website_id" end - create_table "communication_website_menus", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_menus", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "title" @@ -430,7 +397,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_communication_website_menus_on_university_id" end - create_table "communication_website_pages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_pages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "title" @@ -445,10 +412,10 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.text "github_path" t.string "featured_image_alt" t.text "text" - t.text "summary" t.string "breadcrumb_title" t.text "header_text" t.integer "kind" + t.text "summary" t.string "bodyclass" t.uuid "language_id", null: false t.text "featured_image_credit" @@ -462,7 +429,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_communication_website_pages_on_university_id" end - create_table "communication_website_permalinks", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_permalinks", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.string "about_type", null: false @@ -476,7 +443,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["website_id"], name: "index_communication_website_permalinks_on_website_id" end - create_table "communication_website_posts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_posts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "communication_website_id", null: false t.string "title" @@ -502,7 +469,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_communication_website_posts_on_university_id" end - create_table "communication_websites", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_websites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "url" @@ -554,7 +521,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["priority", "run_at"], name: "delayed_jobs_priority" end - create_table "education_academic_years", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_academic_years", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.integer "year" t.datetime "created_at", null: false @@ -569,7 +536,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_person_id", "education_academic_year_id"], name: "index_person_academic_year" end - create_table "education_cohorts", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_cohorts", id: :uuid, default: -> { "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 @@ -590,7 +557,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_person_id", "education_cohort_id"], name: "index_person_cohort" end - create_table "education_diplomas", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_diplomas", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "short_name" t.integer "level", default: 0 @@ -604,7 +571,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_education_diplomas_on_university_id" end - create_table "education_programs", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_programs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.integer "capacity" @@ -664,7 +631,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) 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: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "education_schools", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "address" @@ -680,7 +647,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_education_schools_on_university_id" end - create_table "imports", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "imports", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.integer "number_of_lines" t.jsonb "processing_errors" t.integer "kind" @@ -693,7 +660,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["user_id"], name: "index_imports_on_user_id" end - create_table "languages", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "languages", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "iso_code" t.datetime "created_at", null: false @@ -760,7 +727,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_research_journal_paper_kinds_on_university_id" end - create_table "research_journal_papers", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_journal_papers", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "title" t.datetime "published_at", precision: nil t.uuid "university_id", null: false @@ -797,7 +764,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["researcher_id"], name: "index_research_journal_papers_researchers_on_researcher_id" end - create_table "research_journal_volumes", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_journal_volumes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "research_journal_id", null: false t.string "title" @@ -817,7 +784,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_research_journal_volumes_on_university_id" end - create_table "research_journals", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_journals", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "title" t.text "meta_description" @@ -828,7 +795,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_research_journals_on_university_id" end - create_table "research_laboratories", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_laboratories", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "address" @@ -840,7 +807,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_research_laboratories_on_university_id" end - create_table "research_laboratory_axes", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_laboratory_axes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "research_laboratory_id", null: false t.string "name" @@ -854,7 +821,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_research_laboratory_axes_on_university_id" end - create_table "research_theses", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "research_theses", id: :uuid, default: -> { "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 @@ -872,7 +839,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_research_theses_on_university_id" end - create_table "universities", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "universities", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.string "name" t.string "identifier" t.string "address" @@ -911,7 +878,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_university_organization_categories_on_university_id" end - create_table "university_organizations", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_organizations", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "name" t.string "long_name" @@ -949,7 +916,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["organization_id"], name: "index_university_organizations_categories_on_organization_id" end - create_table "university_people", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_people", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "user_id" t.string "last_name" @@ -1005,7 +972,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_university_person_categories_on_university_id" end - create_table "university_person_experiences", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_person_experiences", id: :uuid, default: -> { "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 @@ -1019,7 +986,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_university_person_experiences_on_university_id" end - create_table "university_person_involvements", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_person_involvements", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "person_id", null: false t.integer "kind" @@ -1034,7 +1001,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_university_person_involvements_on_university_id" end - create_table "university_roles", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "university_roles", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "target_type" t.uuid "target_id" @@ -1046,7 +1013,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do t.index ["university_id"], name: "index_university_roles_on_university_id" end - create_table "users", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "users", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.string "first_name" t.string "last_name" @@ -1095,9 +1062,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" add_foreign_key "administration_qualiopi_indicators", "administration_qualiopi_criterions", column: "criterion_id" - add_foreign_key "communication_block_headings", "communication_block_headings", column: "parent_id" - add_foreign_key "communication_block_headings", "universities" - add_foreign_key "communication_blocks", "communication_block_headings", column: "heading_id" add_foreign_key "communication_blocks", "universities" add_foreign_key "communication_extranet_connections", "communication_extranets", column: "extranet_id" add_foreign_key "communication_extranet_connections", "universities" @@ -1122,8 +1086,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_04_05_142031) do add_foreign_key "communication_website_categories", "education_programs", column: "program_id" add_foreign_key "communication_website_categories", "languages" add_foreign_key "communication_website_categories", "universities" - add_foreign_key "communication_website_connections", "communication_websites", column: "website_id" - add_foreign_key "communication_website_connections", "universities" add_foreign_key "communication_website_git_files", "communication_websites", column: "website_id" add_foreign_key "communication_website_imported_authors", "communication_website_imported_websites", column: "website_id" add_foreign_key "communication_website_imported_authors", "universities"