diff --git a/Gemfile.lock b/Gemfile.lock index 78674426d593f542ed0cd45924b5eddbafd6fbb5..ac4612cdc381a85fda0f3457609b91f64488bb82 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -89,8 +89,8 @@ GEM autoprefixer-rails (10.4.7.0) execjs (~> 2) aws-eventstream (1.2.0) - aws-partitions (1.631.0) - aws-sdk-core (3.148.0) + aws-partitions (1.637.0) + aws-sdk-core (3.155.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) @@ -108,9 +108,9 @@ GEM bindex (0.8.1) bootsnap (1.13.0) msgpack (~> 1.2) - bootstrap (5.2.0) + bootstrap (5.2.1) autoprefixer-rails (>= 9.1.0) - popper_js (>= 2.11.5, < 3) + popper_js (>= 2.11.6, < 3) sassc-rails (>= 2.0.0) bootstrap5-kaminari-views (0.0.1) kaminari (>= 0.13) @@ -190,6 +190,8 @@ GEM zlib (~> 2.1) faraday-http-cache (2.4.1) faraday (>= 0.8) + faraday-multipart (1.0.4) + multipart-post (~> 2) faraday-net_http (3.0.0) faraday-retry (2.0.0) faraday (~> 2.0) @@ -283,9 +285,9 @@ GEM mini_mime (1.1.2) minitest (5.16.3) msgpack (1.5.6) - multi_json (1.15.0) multi_xml (0.6.0) - mustermann (2.0.2) + multipart-post (2.2.3) + mustermann (3.0.0) ruby2_keywords (~> 0.0.1) nesty (1.0.2) nio4r (2.5.8) @@ -295,12 +297,13 @@ GEM racc (~> 1.4) nokogiri (1.13.8-x86_64-linux) racc (~> 1.4) - oauth2 (1.4.11) + oauth2 (2.0.9) faraday (>= 0.17.3, < 3.0) jwt (>= 1.0, < 3.0) - multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 4) + snaky_hash (~> 2.0) + version_gem (~> 1.1) octokit (5.6.1) faraday (>= 1, < 3) sawyer (~> 0.9) @@ -316,7 +319,7 @@ GEM ruby-saml (~> 1.12) orm_adapter (0.5.0) pg (1.4.3) - popper_js (2.11.5) + popper_js (2.11.6) public_suffix (5.0.0) puma (5.6.5) nio4r (~> 2.0) @@ -324,7 +327,7 @@ GEM rack (2.2.4) rack-mini-profiler (2.3.4) rack (>= 1.2.0) - rack-protection (2.2.2) + rack-protection (3.0.1) rack rack-test (2.0.2) rack (>= 1.3) @@ -362,7 +365,7 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - regexp_parser (2.5.0) + regexp_parser (2.6.0) responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) @@ -412,13 +415,16 @@ GEM simple_form_password_with_hints (0.0.6) rails simple_form - sinatra (2.2.2) - mustermann (~> 2.0) - rack (~> 2.2) - rack-protection (= 2.2.2) + sinatra (3.0.1) + mustermann (~> 3.0) + rack (~> 2.2, >= 2.2.4) + rack-protection (= 3.0.1) tilt (~> 2.0) sixarm_ruby_unaccent (1.2.0) - spring (4.0.0) + snaky_hash (2.0.1) + hashie + version_gem (~> 1.1, >= 1.1.1) + spring (4.1.0) sprockets (4.1.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -438,10 +444,12 @@ GEM unf_ext unf_ext (0.0.8.2) unicode-display_width (2.3.0) - unsplash (2.1.0) - httparty (~> 0.16) - oauth2 (~> 1) + unsplash (3.0.0) + faraday-multipart (~> 1.0.4) + httparty (~> 0.20) + oauth2 (>= 2.0.8) vcr (6.1.0) + version_gem (1.1.1) warden (1.2.9) rack (>= 2.0.9) web-console (4.2.0) @@ -449,7 +457,7 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webdrivers (5.0.0) + webdrivers (5.1.0) nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (~> 4.0) @@ -536,4 +544,4 @@ RUBY VERSION ruby 2.7.6p219 BUNDLED WITH - 2.3.11 + 2.3.12 diff --git a/app/assets/stylesheets/commons/_summernote.sass b/app/assets/stylesheets/commons/_summernote.sass index 4f074176c76db1c91180eb4b690bef1f88d09359..72e2f8b856b282ed07cc63ca13b3b8fce40536f4 100644 --- a/app/assets/stylesheets/commons/_summernote.sass +++ b/app/assets/stylesheets/commons/_summernote.sass @@ -9,6 +9,8 @@ img, video height: auto max-width: 100% + p:last-of-type + margin-bottom: 0 button background: transparent border: none @@ -41,9 +43,12 @@ .note-popover .popover-content, .note-editor .note-toolbar padding: 0 + background: white + border-bottom: 1px solid rgba(0, 0, 0, 0.05) + border-radius: 3px .note-popover .popover-content > .note-btn-group, .note-editor .note-toolbar > .note-btn-group margin-right: 0 margin-top: 0 .note-link-popover - display: none !important \ No newline at end of file + display: none !important diff --git a/app/views/admin/application/_dependencies.html.erb b/app/views/admin/application/_dependencies.html.erb index 2247b2c3983cad8bd8fcd0f762c0b8403716acd0..d15308a61d4382b9516e523e608a2406cd2385fa 100644 --- a/app/views/admin/application/_dependencies.html.erb +++ b/app/views/admin/application/_dependencies.html.erb @@ -2,18 +2,16 @@ expanded ||= false %> <% if current_user.server_admin? %> - <div class="card flex-fill w-100"> - <div class="card-header"> + <div class="card bg-light"> + <div class="card-header bg-light"> <div class="card-actions float-end"> - <button class="accordion-button bg-transparent <%= 'collapsed' unless expanded %> mt-n1" - type="button" - data-bs-toggle="collapse" - data-bs-target="#dependencies" - aria-expanded="<%= expanded %>" - aria-controls="dependencies"> - </button> + <i class="fas fa-arrow-down text-muted" + data-bs-toggle="collapse" + data-bs-target="#dependencies" + aria-expanded="<%= expanded %>" + aria-controls="dependencies"></i> </div> - <h2 class="card-title mb-0 h5">Dependencies</h2> + <h2 class="card-title mb-0 h5 text-muted">Dependencies <small>server admin only</small></h2> </div> <div class="card-body collapse <%= 'show' if expanded %>" id="dependencies"> <h2 class="h5">git_dependencies</h2> diff --git a/app/views/admin/communication/blocks/components/image/_preview.html.erb b/app/views/admin/communication/blocks/components/image/_preview.html.erb index e3088f599613d5e52c8ee268faf03129a5823001..e2c044efd3d0b709759d1e219c03e140f92b008b 100644 --- a/app/views/admin/communication/blocks/components/image/_preview.html.erb +++ b/app/views/admin/communication/blocks/components/image/_preview.html.erb @@ -8,7 +8,7 @@ return unless blob <div class="block-content"> <%= kamifusen_tag blob, width: 600, class: 'img-fluid mb-1' %> <figcaption> - <%= component.template.credit if component.template.credit.present? %> + <%= component.template.credit if component.template.try(:credit).present? %> </figcaption> </figure> </div> diff --git a/app/views/admin/communication/websites/pages/show.html.erb b/app/views/admin/communication/websites/pages/show.html.erb index 52d79983c0ecc325ac88aba50985168e9d9cd7d3..f90f57e626db12d9abebb9aed5943ef46dfc44c1 100644 --- a/app/views/admin/communication/websites/pages/show.html.erb +++ b/app/views/admin/communication/websites/pages/show.html.erb @@ -5,29 +5,30 @@ <div class="row"> <div class="col-md-8"> + <% unless @page.description_short.blank? %> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h2 class="card-title mb-0 h5"><%= Communication::Website::Page.human_attribute_name('description_short') %></h2> + </div> + <div class="card-body"> + <p class="lead"> + <%= sanitize @page.description_short %> + </p> + </div> + </div> + <% end %> + + <%= render 'admin/communication/blocks/list', about: @page %> + <% if @page.is_special_page? %> - <div class="card text-white bg-secondary flex-fill w-100"> + <div class="card"> <div class="card-body"> <%= t('admin.communication.website.pages.is_special_page') %> - <b class="text-white"><%= t("communication.website.pages.defaults.#{@page.kind}.admin_description") %></b> + <b><%= t("communication.website.pages.defaults.#{@page.kind}.admin_description") %></b> </div> </div> <% end %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h2 class="card-title mb-0 h5"><%= t('content') %></h2> - </div> - <div class="card-body"> - <%= render 'admin/application/property/text', - object: @page, - property: :description_short %> - <%= render 'admin/application/property/text', - object: @page, - property: :text if @page.text&.to_plain_text.present? %> - </div> - </div> - <%= render 'admin/communication/blocks/list', about: @page %> <%= render 'admin/application/dependencies', git_dependencies: @page.git_dependencies(@page.website), active_storage_blobs: @page.active_storage_blobs %> @@ -55,6 +56,12 @@ <% end %> <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('path') %></h3> <p><%= @page.path %></p> + + <% if @page.description.present? %> + <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('description') %></h3> + <%= simple_format @page.description %> + <% end %> + <% if @page.parent %> <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('parent') %></h3> <p><%= link_to_if can?(:read, @page.parent), @@ -98,17 +105,6 @@ </div> </div> <%= render 'admin/application/featured_image/show', about: @page %> - <% if @page.description.present? %> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h5 class="card-title mb-0"><%= t('seo') %></h5> - </div> - <div class="card-body"> - <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('description') %></h3> - <%= simple_format @page.description %> - </div> - </div> - <% end %> </div> </div> <% end %> diff --git a/app/views/admin/communication/websites/posts/show.html.erb b/app/views/admin/communication/websites/posts/show.html.erb index 494c467914fed62b972215e97dfc0e7454c6eacf..54052028271058e2e5fb03cfaca428d96b72665f 100644 --- a/app/views/admin/communication/websites/posts/show.html.erb +++ b/app/views/admin/communication/websites/posts/show.html.erb @@ -3,46 +3,18 @@ <%= render 'admin/communication/websites/sidebar' do %> <div class="row"> <div class="col-md-8"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h2 class="card-title mb-0 h5"><%= t('content') %></h2> - </div> - <div class="card-body"> - <%= render 'admin/application/property/text', object: @post, property: :description_short %> - <%= render 'admin/application/property/summernote_embeds', object: @post, property: :medias %> - </div> - </div> - <div class="row"> - <% if @post.categories.any? %> - <div class="col-md-6"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h2 class="card-title mb-0"><%= Communication::Website::Post.human_attribute_name('categories') %></h2> - </div> - <div class="card-body"> - <ul class="list-unstyled mb-0"> - <% @post.categories.each do |category| %> - <li><%= link_to_if can?(:read, category), category, [:admin, category] %></li> - <% end %> - </ul> - </div> + <% unless @post.description_short.blank? %> + <div class="card flex-fill w-100"> + <div class="card-header"> + <h2 class="card-title mb-0 h5"><%= Communication::Website::Post.human_attribute_name('description_short') %></h2> + </div> + <div class="card-body"> + <p class="lead"> + <%= sanitize @post.description_short %> + </p> </div> </div> <% end %> - <% if @post.description.present? %> - <div class="col-md-6"> - <div class="card flex-fill w-100"> - <div class="card-header"> - <h2 class="card-title mb-0"><%= t('seo') %></h2> - </div> - <div class="card-body"> - <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('description') %></h3> - <%= simple_format @post.description %> - </div> - </div> - </div> - <% end %> - </div> <%= render 'admin/communication/blocks/list', about: @post %> </div> <div class="col-md-4"> @@ -77,8 +49,20 @@ <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('author') %></h3> <p><%= link_to_if can?(:read, @post.author), @post.author, admin_communication_website_author_path(@post.author) %></p> <% end %> + <% if @post.categories.any? %> + <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('categories') %></h3> + <ul class="list-unstyled"> + <% @post.categories.each do |category| %> + <li><%= link_to_if can?(:read, category), category, [:admin, category] %></li> + <% end %> + </ul> + <% end %> <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('slug') %></h3> <p><%= @post.slug %></p> + <% if @post.description.present? %> + <h3 class="h5"><%= Communication::Website::Post.human_attribute_name('description') %></h3> + <%= simple_format @post.description %> + <% end %> </div> </div> <%= render 'admin/application/featured_image/show', about: @post %> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index b4f03422224b7a22a19f1f28131dd6bd691206c5..7f8b75f3d6e8ad2b336c572a89cba21dcfbe1b42 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -93,7 +93,7 @@ en: bodyclass: Specific CSS class breadcrumb_title: Title in breadcrumbs children: Children pages - description: Meta Description + description: Meta description description_short: Lead text featured_image: Featured image featured_image_alt: Alt text @@ -110,7 +110,7 @@ en: author: Author category: Category categories: Categories - description: Meta Description + description: Meta description description_short: Lead text featured_image: Featured image featured_image_alt: Alt text diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 171268b0657ab43b04a76ae2e6892f94913fa89b..a14ed5e956316c7022a426825656a24e8512bb75 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -93,16 +93,17 @@ fr: bodyclass: Classe CSS spécifique breadcrumb_title: Nom affiché dans le fil d'ariane children: Pages enfants - description: Meta Description + description: Description pour le référencement naturel description_short: Chapô featured_image: Image à la une featured_image_alt: Texte alternatif full_width: Pleine largeur header_text: Titre affiché dans le header parent: Page parente + path: Chemin published: Publié ? related_category: Catégorie liée - slug: Slug + slug: Identifiant text: Texte principal de la page title: Titre website: Site Web @@ -110,7 +111,7 @@ fr: author: Auteur·rice category: Catégorie categories: Catégories - description: Meta Description + description: Description pour le référencement naturel description_short: Chapô featured_image: Image à la une featured_image_alt: Texte alternatif @@ -118,7 +119,7 @@ fr: pinned: Mis en avant published: Publié ? published_at: Date de publication - slug: Slug + slug: Identifiant text: Texte title: Titre website: Site Web