diff --git a/.github/workflows/gitlab.yml b/.github/workflows/gitlab.yml new file mode 100644 index 0000000000000000000000000000000000000000..aac739274eb8946eee49f8568f7b290a0564a5db --- /dev/null +++ b/.github/workflows/gitlab.yml @@ -0,0 +1,19 @@ +name: GitlabSync + +on: + - push + - delete + +jobs: + sync: + runs-on: ubuntu-latest + name: Git Repo Sync + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: wangchucheng/git-repo-sync@v0.1.0 + with: + target-url: ${{ secrets.GITLAB_TARGET_URL }} + target-username: ${{ secrets.GITLAB_TARGET_USERNAME }} + target-token: ${{ secrets.GITLAB_TARGET_TOKEN }} \ No newline at end of file diff --git a/Gemfile b/Gemfile index 8358008487f8378a7c17b05628d12b9ffb69a25f..a1eae116bce4500a9144a9e65503c69cb76cdff1 100644 --- a/Gemfile +++ b/Gemfile @@ -27,7 +27,6 @@ gem "enum_help" gem "faceted_search" gem "font-awesome-sass" gem "front_matter_parser" -gem "gdpr", "~> 1.2.5" gem "geocoder", "~> 1.8" gem "geo_point" gem "gitlab" diff --git a/Gemfile.lock b/Gemfile.lock index 093d7a859f6986a54e4aff65d117d93370bc2a47..a93bf9338577c783ee930fcacd32ed6240440ff5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -93,7 +93,7 @@ GEM i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.2) + addressable (2.8.3) public_suffix (>= 2.0.2, < 6.0) angularjs-rails (1.8.0) annotate (3.2.0) @@ -102,7 +102,7 @@ GEM autoprefixer-rails (10.4.13.0) execjs (~> 2) aws-eventstream (1.2.0) - aws-partitions (1.740.0) + aws-partitions (1.742.0) aws-sdk-core (3.171.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) @@ -111,7 +111,7 @@ GEM aws-sdk-kms (1.63.0) aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.120.0) + aws-sdk-s3 (1.120.1) aws-sdk-core (~> 3, >= 3.165.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) @@ -224,10 +224,6 @@ GEM font-awesome-sass (6.4.0) sassc (~> 2.0) front_matter_parser (1.0.1) - gdpr (1.2.5) - js_cookie_rails - rails - sassc-rails geo_calc (0.7.8) activesupport (>= 3.0.1) geo_units (~> 0.3.2) @@ -279,8 +275,6 @@ GEM thor (>= 0.14, < 2.0) jquery-ui-rails (6.0.1) railties (>= 3.2.16) - js_cookie_rails (2.2.0) - railties (>= 3.1) json (2.6.3) jwt (2.7.0) kamifusen (1.11.2) @@ -588,7 +582,6 @@ DEPENDENCIES figaro font-awesome-sass front_matter_parser - gdpr (~> 1.2.5) geo_point geocoder (~> 1.8) gitlab diff --git a/app/assets/images/communication/blocks/templates/features.jpg b/app/assets/images/communication/blocks/templates/features.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6c32f7e0dac707c1b58cf3c5f02ed8339cdd4096 Binary files /dev/null and b/app/assets/images/communication/blocks/templates/features.jpg differ diff --git a/app/assets/images/communication/blocks/templates/posts/alternate.png b/app/assets/images/communication/blocks/templates/posts/alternate.png new file mode 100644 index 0000000000000000000000000000000000000000..0e3517906860abe0f2bf69cde13750917ac839c9 Binary files /dev/null and b/app/assets/images/communication/blocks/templates/posts/alternate.png differ diff --git a/app/assets/javascripts/admin/appstack.js b/app/assets/javascripts/admin/appstack.js index eea9af01b78b0bd2d79035316b5dc8b2c4bd094f..cd460cea74caa81e28e1a514ca9cbb7473cccdb9 100644 --- a/app/assets/javascripts/admin/appstack.js +++ b/app/assets/javascripts/admin/appstack.js @@ -8,7 +8,6 @@ //= require cropperjs/dist/cropper //= require jquery-cropper/dist/jquery-cropper //= require appstack/app -//= require gdpr/cookie_consent //= require sortablejs/Sortable //= require summernote/summernote-bs5 //= require slug/slug diff --git a/app/assets/javascripts/admin/pure.js b/app/assets/javascripts/admin/pure.js index 00c97d27fd4b2f11e65cae02ff8802e0d6ef27fd..4cc380290368a53cb9caebe40eb3a841c4c31d36 100644 --- a/app/assets/javascripts/admin/pure.js +++ b/app/assets/javascripts/admin/pure.js @@ -9,7 +9,6 @@ //= require jquery-cropper/dist/jquery-cropper // TODO remove appstack js //= require appstack/app -//= require gdpr/cookie_consent //= require sortablejs/Sortable //= require summernote/summernote-bs5 //= require slug/slug diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 19545a0bccd3fa9908e5b35280ed224190b74b3e..e8a0f2e802bc126febf0934d16a09fd55818ac04 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -8,7 +8,6 @@ //= require simple_form_password_with_hints //= require simple_form_bs5_file_input //= require summernote/summernote-bs5 -//= require gdpr/cookie_consent //= require autocomplete-rails //= require_tree ./application/plugins //= require_self diff --git a/app/assets/javascripts/devise.js b/app/assets/javascripts/devise.js index 26efc2d665f4a7e902f56e9075c6baec61b83df2..87f4ad18ee3ead168bb2e72b76cfb736557c7246 100644 --- a/app/assets/javascripts/devise.js +++ b/app/assets/javascripts/devise.js @@ -8,7 +8,6 @@ //= require simple_form_bs5_file_input //= require cropperjs/dist/cropper //= require jquery-cropper/dist/jquery-cropper -//= require gdpr/cookie_consent //= require_self //= require_tree ./admin/plugins diff --git a/app/assets/javascripts/extranet.js b/app/assets/javascripts/extranet.js index acfd1811ba7440b3a839c8868adee361bf550d1c..f82a3bacb14d7873d0bef0c38bd5f1f2832cafc4 100644 --- a/app/assets/javascripts/extranet.js +++ b/app/assets/javascripts/extranet.js @@ -10,7 +10,6 @@ //= require simple_form_password_with_hints //= require simple_form_bs5_file_input //= require summernote/summernote-bs5 -//= require gdpr/cookie_consent //= require autocomplete-rails //= require_tree ./application/plugins //= require_tree ./extranet diff --git a/app/assets/stylesheets/admin/appstack.sass b/app/assets/stylesheets/admin/appstack.sass index 3413526ba440914d25ccfa8aea3f2e44d45ddf3e..d2a849435d0051d3cd1b00934fd699d71e0f826d 100644 --- a/app/assets/stylesheets/admin/appstack.sass +++ b/app/assets/stylesheets/admin/appstack.sass @@ -6,7 +6,6 @@ @import 'simple_form_bs5_file_input' @import 'summernote-bs5' @import 'cropperjs/dist/cropper' -@import 'gdpr/cookie_consent' @import 'codemirror/lib/codemirror' @import '../commons/*' @import 'commons/*' diff --git a/app/assets/stylesheets/admin/pure.sass b/app/assets/stylesheets/admin/pure.sass index 0b29efb7e3f0b6037ceba282053169f3b6cdaf67..b3638de514982db5fb02d87543400830c493721b 100644 --- a/app/assets/stylesheets/admin/pure.sass +++ b/app/assets/stylesheets/admin/pure.sass @@ -10,7 +10,6 @@ @import 'simple_form_bs5_file_input' @import 'summernote-bs5' @import 'cropperjs/dist/cropper' -@import 'gdpr/cookie_consent' @import 'codemirror/lib/codemirror' @import '../commons/*' @import 'commons/*' diff --git a/app/assets/stylesheets/admin/pure/grid.sass b/app/assets/stylesheets/admin/pure/grid.sass index ff028e0fa6d911a7dcd4b07f1e27b0b81f0e0ad6..ffdb47b85b9d4a40d07889a70e80e9d6f0ad4053 100644 --- a/app/assets/stylesheets/admin/pure/grid.sass +++ b/app/assets/stylesheets/admin/pure/grid.sass @@ -1,4 +1,4 @@ * --bs-gutter-x: 64px !important @media (max-width: 768px) - --bs-gutter-x: 20px !important + --bs-gutter-x: 32px !important diff --git a/app/assets/stylesheets/application.sass b/app/assets/stylesheets/application.sass index cbdad2dd5161fd3e130203aabb7e325e41f39451..407658cd3780ab5ca9bb1ff60e3db4f77441fd70 100644 --- a/app/assets/stylesheets/application.sass +++ b/app/assets/stylesheets/application.sass @@ -3,7 +3,6 @@ @import 'simple_form_password_with_hints' @import 'simple_form_bs5_file_input' @import 'cropperjs/dist/cropper' -@import 'gdpr/cookie_consent' @import 'faceted_search' @import 'commons/*' @import 'application/*' diff --git a/app/assets/stylesheets/extranet.sass b/app/assets/stylesheets/extranet.sass index 7beab43bb867d71afd0fe6afdbf4e304fc0976d3..de4182540a5c480f4ce792507521b2e02d6ebb41 100644 --- a/app/assets/stylesheets/extranet.sass +++ b/app/assets/stylesheets/extranet.sass @@ -6,7 +6,6 @@ @import 'simple_form_password_with_hints' @import 'simple_form_bs5_file_input' @import 'summernote-bs5' -@import 'gdpr/cookie_consent' @import 'cropperjs/dist/cropper' @import 'commons/summernote' @import 'commons/bootstrap-icons' diff --git a/app/assets/stylesheets/extranet/pages/_posts.sass b/app/assets/stylesheets/extranet/pages/_posts.sass index 1d785f2606e0a2728bddb1c9a6375ea115529736..6eea8a17340e00de999c521dbfbdfe9291891dab 100644 --- a/app/assets/stylesheets/extranet/pages/_posts.sass +++ b/app/assets/stylesheets/extranet/pages/_posts.sass @@ -1,10 +1,6 @@ .posts-show header figure position: relative - @include media-breakpoint-up(md) - display: inline-block - padding-left: 2.813rem - width: 25% picture img width: 100% &.with-credit::after diff --git a/app/models/communication/block.rb b/app/models/communication/block.rb index 44c6c34e522ec687aee80a1b10ef42a4eb48f877..dfc4e60f645305c627bc38a67c2edf2617d9818b 100644 --- a/app/models/communication/block.rb +++ b/app/models/communication/block.rb @@ -42,12 +42,19 @@ class Communication::Block < ApplicationRecord # template_blobs would be a better name, because there are files has_many_attached :template_images + # Les numĆ©ros sont un peu en vrac + # Dans l'idĆ©e, pour le futur + # 1000 basic + # 2000 storytelling + # 3000 references + # 4000 utilities enum template_kind: { chapter: 50, image: 51, gallery: 300, video: 52, key_figures: 56, + features: 2010, datatable: 54, files: 55, embed: 53, @@ -65,7 +72,7 @@ class Communication::Block < ApplicationRecord CATEGORIES = { basic: [:chapter, :image, :video, :datatable], - storytelling: [:key_figures, :gallery, :call_to_action, :testimonials, :timeline], + storytelling: [:key_figures, :features, :gallery, :call_to_action, :testimonials, :timeline], references: [:pages, :posts, :organization_chart, :partners, :programs], utilities: [:files, :definitions, :embed, :contact] } diff --git a/app/models/communication/block/template/feature.rb b/app/models/communication/block/template/feature.rb new file mode 100644 index 0000000000000000000000000000000000000000..bd888d365cc1fecb680ab6301ca49411336f203b --- /dev/null +++ b/app/models/communication/block/template/feature.rb @@ -0,0 +1,6 @@ +class Communication::Block::Template::Feature < Communication::Block::Template::Base + + has_elements + has_component :description, :rich_text + +end diff --git a/app/models/communication/block/template/feature/element.rb b/app/models/communication/block/template/feature/element.rb new file mode 100644 index 0000000000000000000000000000000000000000..25cd20876617e71004bcb3143b0ecb5568192a4b --- /dev/null +++ b/app/models/communication/block/template/feature/element.rb @@ -0,0 +1,9 @@ +class Communication::Block::Template::Feature::Element < Communication::Block::Template::Base + + has_component :title, :string + has_component :description, :text + has_component :image, :image + has_component :alt, :string + has_component :credit, :rich_text + +end diff --git a/app/models/communication/block/template/post.rb b/app/models/communication/block/template/post.rb index 617ff89ae25c1df41ee019a780ca2d128baf7ce1..de2ad77e93ac2f575e7ce5fc41f42697dfc418dc 100644 --- a/app/models/communication/block/template/post.rb +++ b/app/models/communication/block/template/post.rb @@ -1,7 +1,7 @@ class Communication::Block::Template::Post < Communication::Block::Template::Base has_elements - has_layouts [:grid, :list, :highlight] + has_layouts [:grid, :list, :highlight, :alternate] has_component :mode, :option, options: [:all, :category, :selection] has_component :posts_quantity, :number, options: 3 has_component :category_id, :category diff --git a/app/services/osuny/simple_navigation_renderer.rb b/app/services/osuny/simple_navigation_renderer.rb index b6857b68e21279677696b68b500714ad00d18d76..b1dcd9275ac3f0fdfcef8fad3ed1c1a3092b0e34 100644 --- a/app/services/osuny/simple_navigation_renderer.rb +++ b/app/services/osuny/simple_navigation_renderer.rb @@ -1,5 +1,5 @@ class Osuny::SimpleNavigationRenderer < SimpleNavigation::Renderer::Base - OPEN = "<div class=\"col-md-4 col-lg-3 mb-5\">" + OPEN = "<div class=\"col-sm-6 col-md-4 col-lg-3 mb-5\">" CLOSE = "</div>" attr_accessor :content, :index, :item diff --git a/app/views/admin/communication/blocks/_preview.html.erb b/app/views/admin/communication/blocks/_preview.html.erb index bd26dfe7acf4a9579b6cae270b2b5c53423d96b8..1fc6d39b60eb598b4f0d980d138013af92860f17 100644 --- a/app/views/admin/communication/blocks/_preview.html.erb +++ b/app/views/admin/communication/blocks/_preview.html.erb @@ -1,18 +1,4 @@ -<% is_leaflet_needed = true; %> - <% about.blocks.published.ordered.each do |block| %> <% @block = block %> <%= render "admin/communication/blocks/templates/#{@block.template_kind}/preview" %> - <% if block.template_kind == "partners" && block.data[:layout] == "map" %> - <% is_leaflet_needed = true; %> - <% end %> -<% end %> - -<% if is_leaflet_needed %> - <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css" - integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI=" - crossorigin=""/> - <script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js" - integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" - crossorigin=""></script> <% end %> diff --git a/app/views/admin/communication/blocks/templates/features/_edit.html.erb b/app/views/admin/communication/blocks/templates/features/_edit.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..e9a60f1c569c753464c16a159eeab64dd613273f --- /dev/null +++ b/app/views/admin/communication/blocks/templates/features/_edit.html.erb @@ -0,0 +1,35 @@ +<div class="row pure__row--small"> + <div class="col-xl-6"> + <%= block_component_edit :description %> + </div> +</div> + +<%= block_component_add_element t('.add_element') %> +<draggable :list="data.elements" handle=".dragHandle" class="mb-3 <%= if_appstack 'list-group' %>"> + <div v-for="(element, index) in data.elements" class="draggable-item <%= if_appstack 'list-group-item' %>"> + <div> + <a class="btn ps-0 pt-0 dragHandle"><i class="<%= Icon::DRAG %> handle"></i></a>{{element.title}} + <a class="btn btn-sm text-danger float-end pe-0" + v-on:click="data.elements.splice(data.elements.indexOf(element), 1)" + title="<%= t '.remove_element' %>"> + <i class="<%= Icon::DELETE %>"></i> + </a> + </div> + <div class="row pure__row--small"> + <div class="col-lg-4"> + <%= block_component_edit :title, template: @element %> + <%= block_component_edit :description, template: @element, rows: 5 %> + </div> + <div class="col-lg-4"> + <%= block_component_edit :image, template: @element %> + </div> + <div class="col-lg-4" v-show="element.image.id != ''"> + <%= block_component_edit :alt, template: @element %> + <%= block_component_edit :credit, template: @element %> + </div> + </div> + </div> +</draggable> +<div v-show="data.elements.length > 2"> + <%= block_component_add_element t('.add_element') %> +</div> \ No newline at end of file diff --git a/app/views/admin/communication/blocks/templates/features/_preview.html.erb b/app/views/admin/communication/blocks/templates/features/_preview.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/app/views/admin/communication/blocks/templates/features/_static.html.erb b/app/views/admin/communication/blocks/templates/features/_static.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..2dd180eae5b5d1367c84827e7f24a8b8f89d7ea0 --- /dev/null +++ b/app/views/admin/communication/blocks/templates/features/_static.html.erb @@ -0,0 +1,9 @@ +<%= block_component_static :description %> + elements: +<% block.template.elements.each do |element| %> +<%= block_component_static :title, template: element, list: true, depth: 4 %> +<%= block_component_static :description, template: element, depth: 5 %> +<%= block_component_static :image, template: element, depth: 5 %> +<%= block_component_static :alt, template: element, depth: 5 %> +<%= block_component_static :credit, template: element, depth: 5 %> +<% end %> 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/partners/_preview.html.erb b/app/views/admin/communication/blocks/templates/partners/_preview.html.erb index 3d14a837cd01c07bf62f7a736c28b8a6926d2b7a..40246eb957ea8eb7e8cf8f241bc7a295e63eeefd 100644 --- a/app/views/admin/communication/blocks/templates/partners/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/partners/_preview.html.erb @@ -24,44 +24,37 @@ <% if @block.template.layout == "grid" %> <div class="organizations grid"> - <% @block.template.elements.each do |element| %> - <article class="organization"> - <h3> - <% if element.best_url %> - <a href="<%= element.best_url %>" target="_blank"> - <% end %> - <%= element.best_name %> - <% if element.best_url%> - </a> - <% end %> - </h3> - <div class="media"> - <%= kamifusen_tag element.best_logo, width: 600%> - </div> - </article> - <% end %> - </div> - <% else %> + <% else # Map %> <div class="map" data-marker-icon="<%= image_path 'map-marker.svg' %>"> - <% @block.template.elements.each do |element| %> - <article class="organization" data-latitude="<%= element.organization.latitude %>" data-longitude="<%= element.organization.longitude %>"> - <h3> - <% if element.best_url %> - <a href="<%= element.best_url %>" target="_blank"> - <% end %> - <%= element.best_name %> - <% if element.best_url%> - </a> - <% end %> - </h3> + <link rel="stylesheet" + href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css" + integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI=" + crossorigin=""/> + <script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js" + integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" + crossorigin=""></script> + <% end %> + <% @block.template.elements.each do |element| %> + <article class="organization" + data-latitude="<%= element.organization&.latitude %>" + data-longitude="<%= element.organization&.longitude %>"> + <h3> + <% if element.best_url %> + <a href="<%= element.best_url %>" target="_blank"> + <% end %> + <%= element.best_name %> + <% if element.best_url%> + </a> + <% end %> + </h3> + <% if element.best_logo %> <div class="media"> <%= kamifusen_tag element.best_logo, width: 600%> </div> - </article> - <% end %> - </div> - <% end %> + <% end %> + </article> + <% end %> + </div> </div> </div> </section> - 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/posts/_static.html.erb b/app/views/admin/communication/blocks/templates/posts/_static.html.erb index c88c34d54acdc9ebd95ba3f82b357d9abb596cc4..167e7e361c87955622b10570652ec5db3a6da0fa 100644 --- a/app/views/admin/communication/blocks/templates/posts/_static.html.erb +++ b/app/views/admin/communication/blocks/templates/posts/_static.html.erb @@ -1,4 +1,6 @@ -<% if block.template.category %> +<% if block.template.mode == 'all' %> + all: true +<% elsif block.template.mode == 'category' && block.template.category %> category: "<%= block.template.category.path %>" <% end %> layout: <%= block.template.layout %> 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/app/views/admin/communication/websites/categories/_form.html.erb b/app/views/admin/communication/websites/categories/_form.html.erb index 0769ed9a26c14933cbdd34e5b2854e2cfb62e2e1..44bb161df365955ebd7e93b56af6c48629675c52 100644 --- a/app/views/admin/communication/websites/categories/_form.html.erb +++ b/app/views/admin/communication/websites/categories/_form.html.erb @@ -4,37 +4,25 @@ <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 :name %> - <%= render 'admin/application/summary/form', f: f, about: category %> - </div> - </div> + <%= osuny_panel t('content') do %> + <%= f.input :name %> + <%= render 'admin/application/summary/form', f: f, about: category %> + <% end %> <%= render 'admin/application/meta_description/form', f: f, about: category %> </div> <div class="col-md-4"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('metadata') %></h5> - </div> - <div class="card-body"> - <%= f.input :slug, - as: :string, - input_html: category.persisted? ? {} : { - class: 'js-slug-input', - data: { source: '#communication_website_category_name' } - } %> - <%= f.association :parent, - collection: collection_tree(@website.categories.for_language(current_website_language), category), - label_method: ->(p) { sanitize p[:label] }, - value_method: ->(p) { p[:id] } %> - <ul> - </ul> - </div> - </div> + <%= osuny_panel t('metadata') do %> + <%= f.input :slug, + as: :string, + input_html: category.persisted? ? {} : { + class: 'js-slug-input', + data: { source: '#communication_website_category_name' } + } %> + <%= f.association :parent, + collection: collection_tree(@website.categories.for_language(current_website_language), category), + label_method: ->(p) { sanitize p[:label] }, + value_method: ->(p) { p[:id] } %> + <% end %> <%= render 'admin/application/featured_image/edit', about: category, f: f %> </div> </div> diff --git a/app/views/admin/dashboard/index.html.erb b/app/views/admin/dashboard/index.html.erb index 0fefbb6fb51ef980e4dc8affc00113c1c3edafd6..e067d7978729903f04eda3bb49b8835ec5664efc 100644 --- a/app/views/admin/dashboard/index.html.erb +++ b/app/views/admin/dashboard/index.html.erb @@ -14,14 +14,14 @@ <%= osuny_panel t('hello', name: current_user.first_name) do %> <% if current_admin_theme == 'appstack' %> <p> - Osuny a un nouveau thĆØme pour l'administration, "Pure". <br> - Voulez-vous l'essayer ? + Osuny a un nouveau thĆØme pour l'administration, "Pure". + Voulez-vous l'essayerĀ ? </p> <%= link_to 'Changer de thĆØme', admin_set_theme_path(theme: 'pure'), method: :put %> <% else %> <p> - Vous utilisez le thĆØme "Pure" pour l'administration. <br> - Voulez-vous revenir au thĆØme "Appstack" ? + Vous utilisez le thĆØme "Pure" pour l'administration. + Voulez-vous revenir au thĆØme "Appstack"Ā ? </p> <%= link_to 'Changer de thĆØme', admin_set_theme_path(theme: 'appstack'), method: :put %> <% end %> @@ -143,9 +143,6 @@ <%= link_to t("#{term}"), t("#{term}_url"), target: '_blank', rel: 'noreferrer' %> </li> <% end %> - <li class="list-inline-item"> - <%= link_to t('cookies_consent_choice'), '', class: 'js-gdpr__cookie_consent__display_again' %> - </li> </ul> </div> <% end %> diff --git a/app/views/admin/layouts/themes/_appstack.html.erb b/app/views/admin/layouts/themes/_appstack.html.erb index 331f7b38364abd8c6d9a9b7a46c14fb087a0b5b0..96264a0a66990ef247ed2d5b1fc2a8604521e200 100644 --- a/app/views/admin/layouts/themes/_appstack.html.erb +++ b/app/views/admin/layouts/themes/_appstack.html.erb @@ -27,7 +27,6 @@ </div> </div> <%= javascript_include_tag 'admin/appstack' %> - <%= render 'gdpr/cookie_consent' %> <%= render 'bugsnag' %> <%= render 'summernote_localization' %> </body> diff --git a/app/views/admin/layouts/themes/_pure.html.erb b/app/views/admin/layouts/themes/_pure.html.erb index 965029888465752746d75e9336121af843a8d2e2..b6e54cbba664e91fd9a116ee58858d6cf35de1f0 100644 --- a/app/views/admin/layouts/themes/_pure.html.erb +++ b/app/views/admin/layouts/themes/_pure.html.erb @@ -20,7 +20,6 @@ <%= render "admin/layouts/themes/pure/commands" %> <%= render "admin/layouts/themes/pure/footer" %> <%= javascript_include_tag 'admin/pure' %> - <%= render 'gdpr/cookie_consent' %> <%= render 'bugsnag' %> <%= render 'summernote_localization' %> </body> diff --git a/app/views/admin/layouts/themes/pure/_nav.html.erb b/app/views/admin/layouts/themes/pure/_nav.html.erb index 4e18def30d29207c87a930a3a8bddd84ffb88eac..5c34176bea861792e4764b0e404761586af15e82 100644 --- a/app/views/admin/layouts/themes/pure/_nav.html.erb +++ b/app/views/admin/layouts/themes/pure/_nav.html.erb @@ -42,7 +42,7 @@ context ||= :admin <div class="container-fluid"> <div class="row"> <%= render_navigation context: context, renderer: Osuny::SimpleNavigationRenderer %> - <div class="col-md-4 col-lg-3"> + <div class="col-sm-6 col-md-4 col-lg-3"> <% if current_user.picture.attached? && current_user.picture.variable? image = current_user.picture.variant(resize: '200x200') diff --git a/app/views/admin/research/journals/papers/_form.html.erb b/app/views/admin/research/journals/papers/_form.html.erb index 03c61a270834052d812d2743a72f9ded8a4000ba..b3cd705d9edf20280240a5f00234c8fbfef3cd9c 100644 --- a/app/views/admin/research/journals/papers/_form.html.erb +++ b/app/views/admin/research/journals/papers/_form.html.erb @@ -6,6 +6,7 @@ <div class="col-md-8"> <%= osuny_panel t('content') do %> <%= f.input :title, as: :text, input_html: { rows: 3 } %> + <%= f.input :summary %> <%= f.input :abstract, as: :text, input_html: { rows: 8 } %> <%= f.input :pdf %> <%= f.input :doi %> diff --git a/app/views/admin/university/organizations/show.html.erb b/app/views/admin/university/organizations/show.html.erb index ce72a0a5eba056cb9631625eddb7b0a3cd7be6b8..dccb51446de3a8d610129d8c7ca84e5fe53b5be7 100644 --- a/app/views/admin/university/organizations/show.html.erb +++ b/app/views/admin/university/organizations/show.html.erb @@ -104,12 +104,16 @@ <%= osuny_panel t('university.organization.logo') do %> <% if @organization.logo.attached? %> - <%= osuny_label University::Organization.human_attribute_name('logo') %><br> - <%= kamifusen_tag @organization.logo, class: 'img-fluid img-fill bg-light img-thumbnail p-5 mb-3' %> + <div> + <%= osuny_label University::Organization.human_attribute_name('logo') %><br> + <%= kamifusen_tag @organization.logo, class: 'img-fluid img-fill bg-light img-thumbnail p-5 mb-3' %> + </div> <% end %> <% if @organization.logo_on_dark_background.attached? %> - <%= osuny_label University::Organization.human_attribute_name('logo_on_dark_background') %><br> - <%= kamifusen_tag @organization.logo_on_dark_background, class: 'img-fluid img-fill bg-dark img-thumbnail p-5' %> + <div> + <%= osuny_label University::Organization.human_attribute_name('logo_on_dark_background') %><br> + <%= kamifusen_tag @organization.logo_on_dark_background, class: 'img-fluid img-fill bg-dark img-thumbnail p-5' %> + </div> <% end %> <% end if @organization.logo.attached? || @organization.logo_on_dark_background.attached? %> diff --git a/app/views/api/layouts/application.html.erb b/app/views/api/layouts/application.html.erb index 29a6ebea36ce213ade8cdce3702a2260918f7191..1053513aec3a9f60eb18b13556c008ad70ed8bce 100644 --- a/app/views/api/layouts/application.html.erb +++ b/app/views/api/layouts/application.html.erb @@ -23,7 +23,6 @@ <%= yield %> </main> <%= render 'footer' %> - <%= render 'gdpr/cookie_consent' %> <%= render 'bugsnag' %> </body> </html> diff --git a/app/views/application/_footer.html.erb b/app/views/application/_footer.html.erb index 530f5a966f9b8b3f19be1e545ee2823448ba94cd..abd05f1f855f16846bd4eefb57306e8110e027fc 100644 --- a/app/views/application/_footer.html.erb +++ b/app/views/application/_footer.html.erb @@ -1,27 +1,24 @@ -<footer class="pt-5"> - <div class="container text-center"> - <div class="mb-5"> +<footer class="mt-5 pt-5"> + <div class="container"> + <div class="mb-5 text-lg-center"> <%= image_tag 'osuny-black.svg', width: 80 %> </div> - <nav class="nav justify-content-center"> + <nav class="nav small d-block d-lg-flex justify-content-lg-center"> <%= link_to t('terms_of_service'), t('terms_of_service_url'), - class: 'nav-link', + class: 'nav-link ps-0', target: '_blank', rel: 'noreferrer' %> <%= link_to t('privacy_policy'), t('privacy_policy_url'), - class: 'nav-link', + class: 'nav-link ps-0', target: '_blank', rel: 'noreferrer' %> <%= link_to t('cookies_policy'), t('cookies_policy_url'), - class: 'nav-link', + class: 'nav-link ps-0', target: '_blank', rel: 'noreferrer' %> - <%= link_to t('cookies_consent_choice'), - '', - class: 'nav-link js-gdpr__cookie_consent__display_again' %> </nav> </div> </footer> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 08194d186dc16e87a888231f500e9a43dee4a33e..5bb6d917bb75447f5ad32f404aceade0130ceabe 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -4,7 +4,7 @@ <%= f.error_notification %> <div class="row"> - <div class="col-md-4"> + <div class="col-lg-6"> <%= f.input :email, required: true %> <%= f.input :first_name, required: true, @@ -13,15 +13,12 @@ <%= f.input :last_name, required: true, input_html: { autocomplete: "last_name" } %> - </div> - <div class="col-md-4"> <%= f.association :language, include_blank: false, label_method: lambda { |l| t("languages.#{l.iso_code.to_s}") } %> - <%= f.input :mobile_phone %> <%= f.input :admin_theme, include_blank: false %> </div> - <div class="col-md-4"> + <div class="col-lg-6"> <%= f.input :password, as: :password_with_hints, allow_password_uncloaking: true, @@ -35,6 +32,7 @@ hint: t(".leave_blank_if_you_don_t_want_to_change_it"), required: false, input_html: { autocomplete: "new-password" } %> + <%= f.input :mobile_phone %> <%= f.input :picture, as: :single_deletable_file, input_html: { accept: '.jpg,.jpeg,.png,.svg' }, diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 34db524df5ac26e9ec94e93f7afb440ab5d695eb..cc85287f0ac19054fb0b051522e7b1684be16a12 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -6,7 +6,7 @@ <%= f.error_notification %> <div class="row"> - <div class="col-md-6"> + <div class="col-lg-6"> <%= f.input :email, required: true, input_html: { autocomplete: "email" } %> @@ -22,7 +22,7 @@ label_method: lambda { |l| t("languages.#{l.iso_code.to_s}") }, include_blank: :translate %> </div> - <div class="col-md-6"> + <div class="col-lg-6"> <%= f.input :password, as: :password_with_hints, required: true, diff --git a/app/views/devise/two_factor_authentication/show.html.erb b/app/views/devise/two_factor_authentication/show.html.erb index 964870ab3d7a2c78b0fa0198938d3c72bffb8b79..e200bb69b183fa9beed2eb58dd97691d74c7f1c1 100644 --- a/app/views/devise/two_factor_authentication/show.html.erb +++ b/app/views/devise/two_factor_authentication/show.html.erb @@ -1,6 +1,8 @@ <%= content_for :title, t('.title') %> -<h4> +<h4 class="mb-5"><%= t('.title') %></h4> + +<p> <% if resource.direct_otp %> <% if resource.direct_otp_delivery_method == 'mobile_phone' %> <%= t('devise.two_factor_authentication.enter_code_direct_otp_mobile_phone', phone: masked_phone(resource.mobile_phone)) %> @@ -10,42 +12,37 @@ <% else %> <%= t('devise.two_factor_authentication.enter_code_totp') %> <% end %> -</h4> +</p> <%= simple_form_for(resource, url: user_two_factor_authentication_path, html: { method: :put, class: 'my-3' }) do |f| %> - <div class="row"> - <div class="col-md-6"> - <div class="form-inputs"> - <div class="form-group required mt-0"> - <%= text_field_tag :code, - '', - type: 'tel', - pattern: '\d*', - required: true, - autofocus: true, - autocomplete: 'off', - class: 'form-control string required'%> - <p class="mt-2 mb-0"> - <% if resource.direct_otp %> - <%= link_to t('devise.two_factor_authentication.resend_code'), [:resend_code, resource_name, :two_factor_authentication] %> - <% else %> - <%= link_to t('devise.two_factor_authentication.send_code_instead'), [:resend_code, resource_name, :two_factor_authentication] %> - <% end %> - <% unless resource.mobile_phone.blank? # when phone is blank default code method is already :email so we don't need another link %> - ā€¢ <%= link_to t('devise.two_factor_authentication.send_email_code'), [:resend_code, resource_name, :two_factor_authentication, delivery_method: :email] %> - <% end %> - </p> - </div> - </div> - </div> - <div class="col-md-6"> - <%= link_to t('devise.shared.links.sign_out'), - destroy_user_session_path, - method: :delete, - class: "btn btn-danger float-end" %> + <div class="form-inputs"> + <div class="input-group required mt-0" style="max-width: 400px"> + <%= text_field_tag :code, + '', + type: 'tel', + pattern: '\d*', + required: true, + autofocus: true, + autocomplete: 'off', + class: 'form-control string required'%> <%= f.button :submit, t('devise.two_factor_authentication.validate'), class: "btn btn-primary" %> </div> + <p class="mt-4 mb-5"> + <% if resource.direct_otp %> + <%= link_to t('devise.two_factor_authentication.resend_code'), [:resend_code, resource_name, :two_factor_authentication] %> + <% else %> + <%= link_to t('devise.two_factor_authentication.send_code_instead'), [:resend_code, resource_name, :two_factor_authentication] %> + <% end %> + <% unless resource.mobile_phone.blank? # when phone is blank default code method is already :email so we don't need another link %> + ā€¢ <%= link_to t('devise.two_factor_authentication.send_email_code'), [:resend_code, resource_name, :two_factor_authentication, delivery_method: :email] %> + <% end %> + </p> </div> <% end %> + +<%= link_to t('devise.shared.links.sign_out'), + destroy_user_session_path, + method: :delete, + class: "btn btn-outline-danger" %> diff --git a/app/views/extranet/application/_footer.html.erb b/app/views/extranet/application/_footer.html.erb index 90c6d199b9fba77c8d58b1e512e88671c735f37f..6f774e2449b0e57f4d82608656fcf81e1aa8dd3c 100644 --- a/app/views/extranet/application/_footer.html.erb +++ b/app/views/extranet/application/_footer.html.erb @@ -45,10 +45,6 @@ about = current_extranet.about target: '_blank', rel: 'noreferrer' if current_extranet.has_cookies_policy? %> <%= link_to t('extranet.data'), data_path %> - <%= link_to t('cookies_consent_choice'), - '', - class: 'js-gdpr__cookie_consent__display_again' %> - <%= t 'extranet.osuny_html' %> </nav> </div> diff --git a/app/views/extranet/gdpr/_cookie_consent.html.erb b/app/views/extranet/gdpr/_cookie_consent.html.erb deleted file mode 100644 index 3a1cfe18e18ad1aff4e2fffef35dbf87a7a0dfd3..0000000000000000000000000000000000000000 --- a/app/views/extranet/gdpr/_cookie_consent.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<div class="gdpr__cookie_consent js-gdpr__cookie_consent"> - <div class="gdpr__cookie_consent__text"> - <%= t('gdpr.cookie_consent.text') %> - <%= t('gdpr.cookie_consent.learn_more_html', link: cookies_policy_path) %> - </div> - <div class="gdpr__cookie_consent__buttons"> - <button class="gdpr__cookie_consent__buttons__ok js-gdpr__cookie_consent__buttons__ok btn btn-primary btn-sm btn-xs"> <%= t('gdpr.cookie_consent.button_ok') %></button> - <button class="gdpr__cookie_consent__buttons__ko js-gdpr__cookie_consent__buttons__ko btn btn-primary btn-sm btn-xs"> <%= t('gdpr.cookie_consent.button_ko') %></button> - </div> -</div> \ No newline at end of file diff --git a/app/views/extranet/layouts/application.html.erb b/app/views/extranet/layouts/application.html.erb index 8b20a64470b47db0a214116ba3c18c4e12a065a1..ccad435576b5eec0aea0abed45ea8745def16a78 100644 --- a/app/views/extranet/layouts/application.html.erb +++ b/app/views/extranet/layouts/application.html.erb @@ -11,7 +11,6 @@ <%= yield %> </main> <%= render 'extranet/application/footer' %> - <%= render 'extranet/gdpr/cookie_consent' %> <%= render 'bugsnag' %> <%= javascript_include_tag 'extranet' %> <script src="https://example.osuny.org/js/extranet.js"></script> diff --git a/app/views/extranet/layouts/devise.html.erb b/app/views/extranet/layouts/devise.html.erb index f94aae6fee43e9285b0b021aa7c4ae9b779a4464..69ff30bdc1c2f7817e2ff0782323af130aab3621 100644 --- a/app/views/extranet/layouts/devise.html.erb +++ b/app/views/extranet/layouts/devise.html.erb @@ -24,12 +24,10 @@ <%= link_to t('terms_of_service'), terms_path, rel: 'noreferrer' if current_extranet.has_terms? %> <%= link_to t('privacy_policy'), privacy_policy_path, rel: 'noreferrer' if current_extranet.has_privacy_policy? %> <%= link_to t('cookies_policy'), cookies_policy_path, rel: 'noreferrer' if current_extranet.has_cookies_policy? %> - <%= link_to t('cookies_consent_choice'), '', class: 'js-gdpr__cookie_consent__display_again' %> </footer> </div> </div> </main> - <%= render 'extranet/gdpr/cookie_consent' %> <%= render 'bugsnag' %> <%= javascript_include_tag 'extranet' %> </body> diff --git a/app/views/extranet/posts/posts/show.html.erb b/app/views/extranet/posts/posts/show.html.erb index df92a2c85ad8cf28f31d9afac3f6801ebb902505..f661b233a85ae883efbb47eb52f1b0eae4c09edf 100644 --- a/app/views/extranet/posts/posts/show.html.erb +++ b/app/views/extranet/posts/posts/show.html.erb @@ -1,20 +1,32 @@ -<% content_for :title, @post %> - -<% content_for :header_right do %> - <% if @post.featured_image.attached? %> - <figure <% if @post.featured_image_credit.present? %>class="with-credit"<% end %>> - <%= kamifusen_tag @post.featured_image, class: 'img-fluid', width: 300 %> - <% if @post.featured_image_credit.present? %> - <figcaption tabindex="0"> - <%= sanitize @post.featured_image_credit %> - </figcaption> +<% content_for :header do %> + <div class="row"> + <div class="header__info col-md-8"> + <h1><%= @post %></h1> + <p class="small"> + <% if @post.published_at %> + PubliĆ© le <%= l @post.published_at.to_date, format: :long %> + <% end %> + <% if @post.category %> + <br> + Dans : <%= link_to @post.category, posts_category_path(slug: @post.category.slug), class: "link" %> + <% end %> + </p> + </div> + <div class="col-md-4"> + <% if @post.featured_image.attached? %> + <figure class="<% if @post.featured_image_credit.present? %>with-credit<% end %>"> + <%= kamifusen_tag @post.featured_image, class: 'img-fluid', width: 300 %> + <% if @post.featured_image_credit.present? %> + <figcaption tabindex="0"> + <%= sanitize @post.featured_image_credit %> + </figcaption> + <% end %> + </figure> <% end %> - </figure> - <% end %> + </div> + </div> <% end %> -<%= link_to @post.category, posts_category_path(slug: @post.category.slug) if @post.category %> - </main> <%= render 'admin/communication/blocks/preview', about: @post %> <main> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index d7a2782bd31e89f40eb05cc1090e87caeb0b5ed7..fa8ec3ad26ada8cec7b7640605039a938125412a 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -17,7 +17,6 @@ <%= yield %> </main> <%= render 'footer' %> - <%= render 'gdpr/cookie_consent' %> <%= render 'bugsnag' %> <%= render 'summernote_localization' %> </body> diff --git a/app/views/layouts/devise.html.erb b/app/views/layouts/devise.html.erb index 6c3eb195df94f507849be3b7c6073a7cf27339bc..09a94714b1c8e7954b3b9da2e3093fe40d5a9bf9 100644 --- a/app/views/layouts/devise.html.erb +++ b/app/views/layouts/devise.html.erb @@ -12,29 +12,20 @@ </head> <body class="<%= body_classes %>"> <div class="container"> - <div class="row"> - <div class="col-sm-10 mx-auto"> - <h1 class="my-5 py-5 text-center"> - <%= link_to root_path do %> - <%= render 'logo' %> - <% end %> - </h1> - <div class="card"> - <div class="card-body text-start"> - <% unless notice.blank? %> - <div class="alert alert-success mt-2" role="alert"><%= notice.html_safe %></div> - <% end %> - <% unless alert.blank? %> - <div class="alert alert-danger mt-2" role="alert"><%= alert.html_safe %></div> - <% end %> - <%= yield %> - </div> - </div> - </div> - </div> + <h1 class="my-5 py-5 text-center"> + <%= link_to root_path do %> + <%= render 'logo' %> + <% end %> + </h1> + <% unless notice.blank? %> + <div class="alert alert-success mt-2" role="alert"><%= notice.html_safe %></div> + <% end %> + <% unless alert.blank? %> + <div class="alert alert-danger mt-2" role="alert"><%= alert.html_safe %></div> + <% end %> + <%= yield %> </div> <%= render 'footer' %> - <%= render 'gdpr/cookie_consent' %> <%= render 'bugsnag' %> <%= render 'summernote_localization' %> </body> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 0267ffb5ead36d617b465409ab5aa2d35c5ed0f9..b44050096f649c85683cbc2db8abe6fd118731ff 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -373,6 +373,27 @@ en: label: Iframe title (mandatory for accessibility) placeholder: Enter the title warning: Beware, the code below is used as is, without any security filtering. Be extremely careful and never integrate possibly unreliable code. + features: + description: A list of features with images (often icons) and a description. + edit: + add_element: Add feature + remove_element: Remove feature + element: + image: + label: Image (.png, .jpg, .svg) + remove: Remove image + alt: + label: Alternative text + placeholder: Enter text description + credit: + label: Credit + placeholder: Enter image's credit here + title: + label: Title + placeholder: Enter title here + description: + label: Text + placeholder: Enter text here files: description: A list of downloadable files, mentioning their file size. edit: @@ -458,6 +479,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. @@ -532,6 +554,9 @@ en: list: label: List description: A list of posts with small images the same width. + alternate: + label: Alternate + description: Posts either on the left or on the right, composing a graphically light page. edit: add_post: Add post mode: @@ -718,6 +743,7 @@ en: datatable: Table definitions: Definitions embed: HTML embed + features: Features files: Files gallery: Gallery image: Image diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 8794d71d438a5a77160f4ae71a1627a0e362ad1a..4d98d28791c099cf4fbcf224f3c6a77b63621cec 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -373,6 +373,27 @@ fr: label: Titre de l'iframe (nĆ©cessaire pour l'accessibilitĆ©) placeholder: Entrer le titre warning: Attention, le code ci-dessous est intĆ©grĆ© tel quel, sans filtrage de sĆ©curitĆ©. N'intĆ©grez jamais de code externe dont la fiabilitĆ© n'est pas certaine. + features: + description: Une liste de fonctionnalitĆ©s avec des images, par exemple des icĆ´nes, et une description. + edit: + add_element: Ajouter une fonctionnalitĆ© + remove_element: Supprimer la fonctionnalitĆ© + element: + image: + label: Image (.png, .jpg, .svg) + remove: Enlever l'image + alt: + label: Texte alternatif + placeholder: Entrer la description textuelle + credit: + label: CrĆ©dit + placeholder: Entrer le crĆ©dit de l'image ici + title: + label: Titre + placeholder: Entrer le titre de la fonctionnalitĆ© + description: + label: Texte + placeholder: Entrer la description de la fonctionnalitĆ© files: description: Une liste de fichiers tĆ©lĆ©chargeables, prĆ©sentĆ©s avec leur poids. edit: @@ -458,6 +479,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. @@ -532,6 +554,9 @@ fr: list: label: Liste description: Une liste d'articles avec de petites images Ć la mĆŖme largeur. + alternate: + label: Alternance + description: Une alternance trĆØs lĆ©gĆØre graphiquement d'articles entre la gauche et la droite de la page. edit: add_post: Ajouter un article mode: @@ -718,6 +743,7 @@ fr: datatable: Tableau definitions: DĆ©finitions embed: IntĆ©gration HTML + features: FonctionnalitĆ©s files: Fichiers gallery: Galerie image: Image diff --git a/config/locales/en.yml b/config/locales/en.yml index 91169d4178a01d62dd536c08878967686b2177a3..551e5fb3b8104a64070910aec3a0232cf3e89bd9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -201,8 +201,6 @@ en: empty: Folder is empty open: Open folder close: Close folder - gdpr: - privacy_policy: https://osuny.org/politique-de-confidentialite hello: "Hello %{name}!" home: Home imports: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index d978aafc97311eaa4f3f2004d0d1bf71dbb4ed48..1fc37088e5c8ff952d9534c617e994326808d2da 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -201,8 +201,6 @@ fr: empty: Le dossier est vide open: Ouvrir le dossier close: Fermer le dossier - gdpr: - privacy_policy: https://osuny.org/politique-de-confidentialite hello: "Bonjour %{name}Ā !" home: Accueil imports: diff --git a/db/schema.rb b/db/schema.rb index 246160b0e88961a98d0f4fc6f8dfc4e92ea09cf4..90fb648f002649d4e932e84f13512ca13f023a81 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -78,6 +78,22 @@ 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| t.uuid "university_id", null: false t.string "about_type" @@ -89,7 +105,9 @@ 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 @@ -1077,6 +1095,9 @@ 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"