From 08ec1a2aa210d287ef4bef69c7217024177aa1e2 Mon Sep 17 00:00:00 2001 From: Arnaud Levy Date: Mon, 13 Jan 2025 15:02:14 +0100 Subject: [PATCH 01/12] wip --- .../communication/websites/posts/application_controller.rb | 2 +- .../admin/communication/websites/posts_controller.rb | 2 +- app/models/communication/website/with_feature_posts.rb | 7 +++++++ config/locales/fr.yml | 3 +++ .../admin/communication/website/posts_navigation.rb | 2 +- .../navigation/admin/communication/website_navigation.rb | 2 +- 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/controllers/admin/communication/websites/posts/application_controller.rb b/app/controllers/admin/communication/websites/posts/application_controller.rb index 221b50d1ad..7ac5a3a9b7 100644 --- a/app/controllers/admin/communication/websites/posts/application_controller.rb +++ b/app/controllers/admin/communication/websites/posts/application_controller.rb @@ -4,7 +4,7 @@ class Admin::Communication::Websites::Posts::ApplicationController < Admin::Comm def breadcrumb super - add_breadcrumb Communication::Website::Post.model_name.human(count: 2), + add_breadcrumb @website.feature_posts_name(current_language), admin_communication_website_posts_path end end diff --git a/app/controllers/admin/communication/websites/posts_controller.rb b/app/controllers/admin/communication/websites/posts_controller.rb index 16927bc0f0..371a2aab72 100644 --- a/app/controllers/admin/communication/websites/posts_controller.rb +++ b/app/controllers/admin/communication/websites/posts_controller.rb @@ -101,7 +101,7 @@ def destroy def breadcrumb super - add_breadcrumb Communication::Website::Post.model_name.human(count: 2), + add_breadcrumb @website.feature_posts_name(current_language), admin_communication_website_posts_path breadcrumb_for @post end diff --git a/app/models/communication/website/with_feature_posts.rb b/app/models/communication/website/with_feature_posts.rb index 4d8b56edf7..7d17e0f638 100644 --- a/app/models/communication/website/with_feature_posts.rb +++ b/app/models/communication/website/with_feature_posts.rb @@ -16,4 +16,11 @@ module Communication::Website::WithFeaturePosts scope :with_feature_posts, -> { where(feature_posts: true) } end + def feature_posts_name(language) + begin + special_page(Communication::Website::Page::CommunicationPost).best_localization_for(language) + rescue + Communication::Website::Post.model_name.human(count: 2) + end + end end \ No newline at end of file diff --git a/config/locales/fr.yml b/config/locales/fr.yml index c1f44adb5f..8d133a1123 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -140,6 +140,9 @@ fr: sentence_html: Valeur héritée de %{link} sentence_without_link: Valeur héritée status: Valeur héritée + item: + one: Élément + other: Éléments meta_description: hint: Texte simple, dédié au à l'optimisation pour les moteurs de recherche (Search Engine Optimization, SEO). label: Description pour les moteurs de recherche (meta) diff --git a/config/navigation/admin/communication/website/posts_navigation.rb b/config/navigation/admin/communication/website/posts_navigation.rb index f52d65a414..70c5bbad97 100644 --- a/config/navigation/admin/communication/website/posts_navigation.rb +++ b/config/navigation/admin/communication/website/posts_navigation.rb @@ -5,7 +5,7 @@ navigation.items do |primary| primary.item :feature_nav_posts, - Communication::Website::Post.model_name.human(count: 2), + @website.feature_posts_name(current_language), admin_communication_website_posts_path(website_id: @website.id), highlights_on: lambda { controller_name == "posts" && action_name == "index" diff --git a/config/navigation/admin/communication/website_navigation.rb b/config/navigation/admin/communication/website_navigation.rb index 0865adb543..8890c5e77c 100644 --- a/config/navigation/admin/communication/website_navigation.rb +++ b/config/navigation/admin/communication/website_navigation.rb @@ -12,7 +12,7 @@ controller_name == "websites" && action_name == "show" } if can?(:read, @website) primary.item :subnav_posts, - Communication::Website::Post.model_name.human(count: 2), + @website.feature_posts_name(current_language), admin_communication_website_posts_path(website_id: @website.id), highlights_on: lambda { admin_communication_website_posts_path(website_id: @website.id).in?(request.path) || From aab640f04f8939538296301e57ad5190836ea5a4 Mon Sep 17 00:00:00 2001 From: Arnaud Levy Date: Mon, 13 Jan 2025 15:34:28 +0100 Subject: [PATCH 02/12] fix --- .../websites/agenda/application_controller.rb | 2 +- .../communication/websites/agenda/events_controller.rb | 2 -- .../websites/portfolio/application_controller.rb | 2 +- app/models/communication/website/with_feature_agenda.rb | 8 ++++++++ .../communication/website/with_feature_portfolio.rb | 7 +++++++ .../communication/websites/agenda/events/index.html.erb | 4 ++-- .../communication/websites/agenda/events/new.html.erb | 2 +- .../websites/portfolio/projects/index.html.erb | 4 ++-- .../websites/portfolio/projects/new.html.erb | 3 +-- .../admin/communication/websites/posts/index.html.erb | 2 +- app/views/admin/communication/websites/posts/new.html.erb | 6 ++---- .../admin/communication/websites/show/_events.html.erb | 2 +- .../admin/communication/websites/show/_pages.html.erb | 4 ++-- .../admin/communication/websites/show/_posts.html.erb | 2 +- .../admin/communication/websites/show/_projects.html.erb | 2 +- config/locales/communication/en.yml | 4 ---- config/locales/communication/fr.yml | 4 ---- config/locales/en.yml | 3 +++ config/locales/fr.yml | 4 ++-- .../admin/communication/website/agenda_navigation.rb | 2 +- .../admin/communication/website/portfolio_navigation.rb | 2 +- .../navigation/admin/communication/website_navigation.rb | 4 ++-- 22 files changed, 40 insertions(+), 35 deletions(-) diff --git a/app/controllers/admin/communication/websites/agenda/application_controller.rb b/app/controllers/admin/communication/websites/agenda/application_controller.rb index facc2c2b1e..3cc988644f 100644 --- a/app/controllers/admin/communication/websites/agenda/application_controller.rb +++ b/app/controllers/admin/communication/websites/agenda/application_controller.rb @@ -4,7 +4,7 @@ class Admin::Communication::Websites::Agenda::ApplicationController < Admin::Com def breadcrumb super - add_breadcrumb Communication::Website::Agenda.model_name.human(count: 2), + add_breadcrumb @website.feature_agenda_name(current_language), admin_communication_website_agenda_events_path end end diff --git a/app/controllers/admin/communication/websites/agenda/events_controller.rb b/app/controllers/admin/communication/websites/agenda/events_controller.rb index 4778541ce5..a3510fd0c0 100644 --- a/app/controllers/admin/communication/websites/agenda/events_controller.rb +++ b/app/controllers/admin/communication/websites/agenda/events_controller.rb @@ -79,8 +79,6 @@ def destroy def breadcrumb super - add_breadcrumb Communication::Website::Agenda::Event.model_name.human(count: 2), - admin_communication_website_agenda_events_path breadcrumb_for @event end diff --git a/app/controllers/admin/communication/websites/portfolio/application_controller.rb b/app/controllers/admin/communication/websites/portfolio/application_controller.rb index b82998d3cc..7c4fec19c5 100644 --- a/app/controllers/admin/communication/websites/portfolio/application_controller.rb +++ b/app/controllers/admin/communication/websites/portfolio/application_controller.rb @@ -4,7 +4,7 @@ class Admin::Communication::Websites::Portfolio::ApplicationController < Admin:: def breadcrumb super - add_breadcrumb Communication::Website::Portfolio.model_name.human(count: 2), + add_breadcrumb @website.feature_portfolio_name(current_language), admin_communication_website_portfolio_projects_path end end diff --git a/app/models/communication/website/with_feature_agenda.rb b/app/models/communication/website/with_feature_agenda.rb index 65dcf356ea..6d6c7e6222 100644 --- a/app/models/communication/website/with_feature_agenda.rb +++ b/app/models/communication/website/with_feature_agenda.rb @@ -16,4 +16,12 @@ module Communication::Website::WithFeatureAgenda scope :with_feature_agenda, -> { where(feature_agenda: true) } end + def feature_agenda_name(language) + begin + special_page(Communication::Website::Page::CommunicationAgenda).best_localization_for(language) + rescue + Communication::Website::Agenda::Event.model_name.human(count: 2) + end + end + end \ No newline at end of file diff --git a/app/models/communication/website/with_feature_portfolio.rb b/app/models/communication/website/with_feature_portfolio.rb index 5dfb80a25a..88296cefcd 100644 --- a/app/models/communication/website/with_feature_portfolio.rb +++ b/app/models/communication/website/with_feature_portfolio.rb @@ -17,4 +17,11 @@ module Communication::Website::WithFeaturePortfolio scope :with_feature_portfolio, -> { where(feature_portfolio: true) } end + def feature_portfolio_name(language) + begin + special_page(Communication::Website::Page::CommunicationPortfolio).best_localization_for(language) + rescue + Communication::Website::Portfolio::Project.model_name.human(count: 2) + end + end end \ No newline at end of file diff --git a/app/views/admin/communication/websites/agenda/events/index.html.erb b/app/views/admin/communication/websites/agenda/events/index.html.erb index e5ac386942..35e6d6528e 100644 --- a/app/views/admin/communication/websites/agenda/events/index.html.erb +++ b/app/views/admin/communication/websites/agenda/events/index.html.erb @@ -1,9 +1,9 @@ -<% content_for :title, Communication::Website::Agenda::Event.model_name.human(count: 2) %> +<% content_for :title, t('create') %>

<%= @events.total_count %> - <%= Communication::Website::Agenda::Event.model_name.human(count: @events.total_count).downcase %> + <%= t('admin.item', count: @events.total_count) %>

<%= render 'filters', current_path: admin_communication_website_agenda_events_path, website: @website %>
diff --git a/app/views/admin/communication/websites/agenda/events/new.html.erb b/app/views/admin/communication/websites/agenda/events/new.html.erb index fbfc590f10..f86b5aec11 100644 --- a/app/views/admin/communication/websites/agenda/events/new.html.erb +++ b/app/views/admin/communication/websites/agenda/events/new.html.erb @@ -1,2 +1,2 @@ -<% content_for :title, Communication::Website::Agenda::Event.model_name.human %> +<% content_for :title, t('create') %> <%= render 'form', event: @event, l10n: @l10n %> diff --git a/app/views/admin/communication/websites/portfolio/projects/index.html.erb b/app/views/admin/communication/websites/portfolio/projects/index.html.erb index 47effeadf5..e76067b3b2 100644 --- a/app/views/admin/communication/websites/portfolio/projects/index.html.erb +++ b/app/views/admin/communication/websites/portfolio/projects/index.html.erb @@ -1,9 +1,9 @@ -<% content_for :title, Communication::Website::Portfolio::Project.model_name.human(count: 2) %> +<% content_for :title, t('create') %>

<%= @projects.total_count %> - <%= Communication::Website::Portfolio::Project.model_name.human(count: @projects.total_count).downcase %> + <%= t('admin.item', count: @projects.total_count) %>

<%= render 'filters', current_path: admin_communication_website_portfolio_projects_path, website: @website %>
diff --git a/app/views/admin/communication/websites/portfolio/projects/new.html.erb b/app/views/admin/communication/websites/portfolio/projects/new.html.erb index d759f03e69..7ab76908fe 100644 --- a/app/views/admin/communication/websites/portfolio/projects/new.html.erb +++ b/app/views/admin/communication/websites/portfolio/projects/new.html.erb @@ -1,3 +1,2 @@ -<% content_for :title, Communication::Website::Portfolio::Project.model_name.human %> - +<% content_for :title, t('create') %> <%= render 'form', project: @project, l10n: @l10n %> diff --git a/app/views/admin/communication/websites/posts/index.html.erb b/app/views/admin/communication/websites/posts/index.html.erb index 61c158ebe8..de6933727b 100644 --- a/app/views/admin/communication/websites/posts/index.html.erb +++ b/app/views/admin/communication/websites/posts/index.html.erb @@ -3,7 +3,7 @@

<%= @posts.total_count %> - <%= Communication::Website::Post.model_name.human(count: @posts.total_count).downcase %> + <%= t('admin.item', count: @posts.total_count) %>

<%= render 'filters', current_path: admin_communication_website_posts_path, website: @website %>
diff --git a/app/views/admin/communication/websites/posts/new.html.erb b/app/views/admin/communication/websites/posts/new.html.erb index fc75ad158d..a8796a3a67 100644 --- a/app/views/admin/communication/websites/posts/new.html.erb +++ b/app/views/admin/communication/websites/posts/new.html.erb @@ -1,4 +1,2 @@ -<% content_for :title, Communication::Website::Post.model_name.human %> -<%= render 'form', - post: @post, - l10n: @l10n %> +<% content_for :title, t('create') %> +<%= render 'form', post: @post, l10n: @l10n %> diff --git a/app/views/admin/communication/websites/show/_events.html.erb b/app/views/admin/communication/websites/show/_events.html.erb index 33b2ec64e0..082f7612ec 100644 --- a/app/views/admin/communication/websites/show/_events.html.erb +++ b/app/views/admin/communication/websites/show/_events.html.erb @@ -1,5 +1,5 @@ <% -title = t('communication.website.last_events') +title = @website.feature_agenda_name(current_language) action = '' action += link_to t('create'), new_admin_communication_website_agenda_event_path(website_id: @website), diff --git a/app/views/admin/communication/websites/show/_pages.html.erb b/app/views/admin/communication/websites/show/_pages.html.erb index cbfbdd1788..06ea518e74 100644 --- a/app/views/admin/communication/websites/show/_pages.html.erb +++ b/app/views/admin/communication/websites/show/_pages.html.erb @@ -1,11 +1,11 @@ <% +title = Communication::Website::Page.model_name.human(count: 2) action = '' action += link_to t('create'), new_admin_communication_website_page_path(website_id: @website), class: button_classes if can?(:create, Communication::Website::Page) %> -<%= osuny_panel t('communication.website.last_pages'), - action: action do %> +<%= osuny_panel title, action: action do %>
<% @pages.each do |page| %>
diff --git a/app/views/admin/communication/websites/show/_posts.html.erb b/app/views/admin/communication/websites/show/_posts.html.erb index 3624648597..fed83395ae 100644 --- a/app/views/admin/communication/websites/show/_posts.html.erb +++ b/app/views/admin/communication/websites/show/_posts.html.erb @@ -1,5 +1,5 @@ <% -title = t('communication.website.last_posts') +title = @website.feature_posts_name(current_language) action = '' action += link_to t('create'), new_admin_communication_website_post_path(website_id: @website), diff --git a/app/views/admin/communication/websites/show/_projects.html.erb b/app/views/admin/communication/websites/show/_projects.html.erb index 60e3c67dbc..9f54509150 100644 --- a/app/views/admin/communication/websites/show/_projects.html.erb +++ b/app/views/admin/communication/websites/show/_projects.html.erb @@ -1,5 +1,5 @@ <% -title = t('communication.website.last_projects') +title = @website.feature_portfolio_name(current_language) action = '' action += link_to t('create'), new_admin_communication_website_portfolio_project_path(website_id: @website), diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 824cb37691..d769d86086 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -451,10 +451,6 @@ en: button: Go live title: Go live hosting: Hosting - last_events: Last events - last_pages: Last pages - last_posts: Last posts - last_projects: Last projects menus: automatic: This menu is created automatically.
This means that it reflects the site's tree structure.
As soon as you want to modify it, by creating an item, the automatism will stop. default_title: diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 9675142441..6fc263694c 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -451,10 +451,6 @@ fr: button: Mettre en production title: Mise en production hosting: Hébergement - last_events: Derniers événements - last_pages: Dernières pages - last_posts: Dernières actualités - last_projects: Derniers projets menus: automatic: Ce menu se constitue automatiquement.
Cela signifie qu'il reflète l'arborescence du site.
Dès que vous souhaiterez le modifier, en créant un élément, l'automatisme s'arrêtera. default_title: diff --git a/config/locales/en.yml b/config/locales/en.yml index f8c487f2d3..bdba365cd8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -136,6 +136,9 @@ en: in: in %{lang} switch_to: switch to %{choices} infos: Informations + items: + one: item + other: items inheritance: sentence_html: Value inherited from %{link} sentence_without_link: Value inherited diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 8d133a1123..189c78b3fe 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -141,8 +141,8 @@ fr: sentence_without_link: Valeur héritée status: Valeur héritée item: - one: Élément - other: Éléments + one: élément + other: éléments meta_description: hint: Texte simple, dédié au à l'optimisation pour les moteurs de recherche (Search Engine Optimization, SEO). label: Description pour les moteurs de recherche (meta) diff --git a/config/navigation/admin/communication/website/agenda_navigation.rb b/config/navigation/admin/communication/website/agenda_navigation.rb index 6b0d20b7b8..f96ddd8619 100644 --- a/config/navigation/admin/communication/website/agenda_navigation.rb +++ b/config/navigation/admin/communication/website/agenda_navigation.rb @@ -5,7 +5,7 @@ navigation.items do |primary| primary.item :feature_nav_events, - Communication::Website::Agenda::Event.model_name.human(count: 2), + @website.feature_agenda_name(current_language), admin_communication_website_agenda_events_path(website_id: @website.id) primary.item :feature_nav_categories, Communication::Website::Agenda::Category.model_name.human(count: 2), diff --git a/config/navigation/admin/communication/website/portfolio_navigation.rb b/config/navigation/admin/communication/website/portfolio_navigation.rb index 59404e0fd8..4919786a6b 100644 --- a/config/navigation/admin/communication/website/portfolio_navigation.rb +++ b/config/navigation/admin/communication/website/portfolio_navigation.rb @@ -5,7 +5,7 @@ navigation.items do |primary| primary.item :feature_nav_projects, - Communication::Website::Portfolio::Project.model_name.human(count: 2), + @website.feature_portfolio_name(current_language), admin_communication_website_portfolio_projects_path(website_id: @website.id) primary.item :feature_nav_categories, Communication::Website::Portfolio::Category.model_name.human(count: 2), diff --git a/config/navigation/admin/communication/website_navigation.rb b/config/navigation/admin/communication/website_navigation.rb index 8890c5e77c..411cddb723 100644 --- a/config/navigation/admin/communication/website_navigation.rb +++ b/config/navigation/admin/communication/website_navigation.rb @@ -20,13 +20,13 @@ admin_communication_website_post_authors_path(website_id: @website.id).in?(request.path) } if @website.feature_posts primary.item :subnav_agenda, - Communication::Website::Agenda.model_name.human(count: 2), + @website.feature_agenda_name(current_language), admin_communication_website_agenda_events_path(website_id: @website.id), highlights_on: lambda { admin_communication_website_agenda_root_path(website_id: @website.id).in?(request.path) } if @website.feature_agenda primary.item :subnav_portfolio, - Communication::Website::Portfolio.model_name.human(count: 2), + @website.feature_portfolio_name(current_language), admin_communication_website_portfolio_projects_path(website_id: @website.id), highlights_on: lambda { admin_communication_website_portfolio_root_path(website_id: @website.id).in?(request.path) From 255684c07ac01826f69a8f6ebb239c7c8f26e42b Mon Sep 17 00:00:00 2001 From: Arnaud Levy Date: Mon, 13 Jan 2025 16:32:57 +0100 Subject: [PATCH 03/12] nice links --- .../stylesheets/admin/components/card.sass | 17 ++++++++++++++++- .../stylesheets/admin/osuny/thumbnail.sass | 2 +- .../admin/application/components/_all.html.erb | 12 ++++++++++++ .../application/components/_panel.html.erb | 2 +- .../websites/agenda/events/_list.html.erb | 3 +++ .../websites/portfolio/projects/_list.html.erb | 3 +++ .../communication/websites/posts/_list.html.erb | 10 ++++++++++ .../websites/show/_events.html.erb | 5 ++--- .../communication/websites/show/_pages.html.erb | 4 ++-- .../communication/websites/show/_posts.html.erb | 5 ++--- .../websites/show/_projects.html.erb | 5 ++--- config/locales/en.yml | 1 + config/locales/fr.yml | 1 + 13 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 app/views/admin/application/components/_all.html.erb diff --git a/app/assets/stylesheets/admin/components/card.sass b/app/assets/stylesheets/admin/components/card.sass index 6872aff185..463a0cb5cf 100644 --- a/app/assets/stylesheets/admin/components/card.sass +++ b/app/assets/stylesheets/admin/components/card.sass @@ -4,6 +4,21 @@ &--osuny height: 100% overflow: hidden + &--all + background: none + box-shadow: none + &:hover + box-shadow: none !important + .osuny__thumbnail + background: $color-flexoki-200 + .osuny__thumbnail__initials + color: $color-text + .osuny__thumbnail + border-radius: var(--bs-card-border-radius) + transition: background 0.3s ease-in-out + .osuny__thumbnail__initials + margin-top: -6px + transition: color 0.3s ease-in-out &--horizontal align-items: center flex-direction: row @@ -17,7 +32,7 @@ font-weight: normal .card-body, .card-footer - line-height: 120% + line-height: 110% .table margin-bottom: 0 th, diff --git a/app/assets/stylesheets/admin/osuny/thumbnail.sass b/app/assets/stylesheets/admin/osuny/thumbnail.sass index fa8e937d36..4d63578a5d 100644 --- a/app/assets/stylesheets/admin/osuny/thumbnail.sass +++ b/app/assets/stylesheets/admin/osuny/thumbnail.sass @@ -8,7 +8,7 @@ @include media-breakpoint-down(md) display: none &__initials - color: #CCCCCC + color: $color-flexoki-200 display: block font-family: $font-family-serif font-size: pxToRem(30) diff --git a/app/views/admin/application/components/_all.html.erb b/app/views/admin/application/components/_all.html.erb new file mode 100644 index 0000000000..740bdf05c9 --- /dev/null +++ b/app/views/admin/application/components/_all.html.erb @@ -0,0 +1,12 @@ +
+
+
+ + <%= lucide_icon('arrow-right') %> + +
+ +
+
\ No newline at end of file diff --git a/app/views/admin/application/components/_panel.html.erb b/app/views/admin/application/components/_panel.html.erb index ccb842d2f3..f9ab71cbfe 100644 --- a/app/views/admin/application/components/_panel.html.erb +++ b/app/views/admin/application/components/_panel.html.erb @@ -5,7 +5,7 @@ <% if small %> <%= osuny_label title %> <% else %> -

<%= title %>

+

<%= title %>

<% end %> <% end %> <% if action %> diff --git a/app/views/admin/communication/websites/agenda/events/_list.html.erb b/app/views/admin/communication/websites/agenda/events/_list.html.erb index 061ed5ef49..51aafb76d5 100644 --- a/app/views/admin/communication/websites/agenda/events/_list.html.erb +++ b/app/views/admin/communication/websites/agenda/events/_list.html.erb @@ -1,5 +1,6 @@ <% small ||= false +link_to_all ||= false %> <% if events.none? %>

<%= t('admin.communication.website.agenda.events.none') %>

@@ -36,5 +37,7 @@ small ||= false
<% end %> + <%= render 'admin/application/components/all', + link: admin_communication_website_agenda_events_path(website_id: @website) if link_to_all %> <% end %> \ No newline at end of file diff --git a/app/views/admin/communication/websites/portfolio/projects/_list.html.erb b/app/views/admin/communication/websites/portfolio/projects/_list.html.erb index 296313850b..695e32175e 100644 --- a/app/views/admin/communication/websites/portfolio/projects/_list.html.erb +++ b/app/views/admin/communication/websites/portfolio/projects/_list.html.erb @@ -1,5 +1,6 @@ <% small ||= false +link_to_all ||= false %> <% if projects.none? %>

<%= t('admin.communication.website.portfolio.projects.none') %>

@@ -24,5 +25,7 @@ small ||= false <% end %> + <%= render 'admin/application/components/all', + link: admin_communication_website_portfolio_projects_path(website_id: @website) if link_to_all %> <% end %> \ No newline at end of file diff --git a/app/views/admin/communication/websites/posts/_list.html.erb b/app/views/admin/communication/websites/posts/_list.html.erb index 98aabe2353..83852bbae3 100644 --- a/app/views/admin/communication/websites/posts/_list.html.erb +++ b/app/views/admin/communication/websites/posts/_list.html.erb @@ -6,6 +6,7 @@ selectable ||= false if small hide_buttons = true end +link_to_all ||= false %> <% if posts.none? %>

<%= t('communication.website.posts.none') %>

@@ -69,6 +70,15 @@ end <% end %> + <% if link_to_all %> + + + + <%= render 'admin/application/components/all', + link: admin_communication_website_posts_path(website_id: @website) %> + + + <% end %> diff --git a/app/views/admin/communication/websites/show/_events.html.erb b/app/views/admin/communication/websites/show/_events.html.erb index 082f7612ec..96e963efe4 100644 --- a/app/views/admin/communication/websites/show/_events.html.erb +++ b/app/views/admin/communication/websites/show/_events.html.erb @@ -8,7 +8,6 @@ action += link_to t('create'), <%= osuny_panel title, action: action do %> <%= render 'admin/communication/websites/agenda/events/list', events: @events, - small: true %> - <%= link_to t('communication.website.see_all', number: @all_events.size), - admin_communication_website_agenda_events_path(website_id: @website) if @all_events.any? %> + small: true, + link_to_all: true %> <% end %> diff --git a/app/views/admin/communication/websites/show/_pages.html.erb b/app/views/admin/communication/websites/show/_pages.html.erb index 06ea518e74..ff51c3171a 100644 --- a/app/views/admin/communication/websites/show/_pages.html.erb +++ b/app/views/admin/communication/websites/show/_pages.html.erb @@ -20,7 +20,7 @@ action += link_to t('create'), <% end %> + <%= render 'admin/application/components/all', + link: admin_communication_website_pages_path(website_id: @website) %> - <%= link_to t('communication.website.see_all', number: @all_pages.count), - admin_communication_website_pages_path(website_id: @website) %> <% end %> diff --git a/app/views/admin/communication/websites/show/_posts.html.erb b/app/views/admin/communication/websites/show/_posts.html.erb index fed83395ae..cfe47b2ad2 100644 --- a/app/views/admin/communication/websites/show/_posts.html.erb +++ b/app/views/admin/communication/websites/show/_posts.html.erb @@ -11,7 +11,6 @@ action += link_to t('communication.website.posts.new_curation'), <%= osuny_panel title, action: action do %> <%= render 'admin/communication/websites/posts/list', posts: @posts, - small: true %> - <%= link_to t('communication.website.see_all', number: @all_posts.size), - admin_communication_website_posts_path(website_id: @website) if @all_posts.any? %> + small: true, + link_to_all: true %> <% end %> diff --git a/app/views/admin/communication/websites/show/_projects.html.erb b/app/views/admin/communication/websites/show/_projects.html.erb index 9f54509150..2a5f10b57c 100644 --- a/app/views/admin/communication/websites/show/_projects.html.erb +++ b/app/views/admin/communication/websites/show/_projects.html.erb @@ -8,7 +8,6 @@ action += link_to t('create'), <%= osuny_panel title, action: action do %> <%= render 'admin/communication/websites/portfolio/projects/list', projects: @projects, - small: true %> - <%= link_to t('communication.website.see_all', number: @all_projects.size), - admin_communication_website_portfolio_projects_path(website_id: @website) if @all_projects.any? %> + small: true, + link_to_all: true %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index bdba365cd8..8b0da04a9c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -139,6 +139,7 @@ en: items: one: item other: items + see_all: See all inheritance: sentence_html: Value inherited from %{link} sentence_without_link: Value inherited diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 189c78b3fe..0eb6e1be0c 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -143,6 +143,7 @@ fr: item: one: élément other: éléments + see_all: Voir tout meta_description: hint: Texte simple, dédié au à l'optimisation pour les moteurs de recherche (Search Engine Optimization, SEO). label: Description pour les moteurs de recherche (meta) From d475ee2c233c223a2e20c90eda8e5f5f57bf65ee Mon Sep 17 00:00:00 2001 From: Arnaud Levy Date: Mon, 13 Jan 2025 17:35:05 +0100 Subject: [PATCH 04/12] css --- app/assets/stylesheets/admin/design-system/nav.sass | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/admin/design-system/nav.sass b/app/assets/stylesheets/admin/design-system/nav.sass index ff506f0224..f5a037bc54 100644 --- a/app/assets/stylesheets/admin/design-system/nav.sass +++ b/app/assets/stylesheets/admin/design-system/nav.sass @@ -83,9 +83,12 @@ nav[aria-label="breadcrumb"] overflow-x: scroll padding-left: var(--bs-gutter-x) padding-right: var(--bs-gutter-x) + @include media-breakpoint-up(sm) + padding-bottom: $spacing1 .breadcrumb align-items: center flex-wrap: nowrap + text-transform: uppercase * color: $color-text-alt !important .breadcrumb-item @@ -138,9 +141,6 @@ nav[aria-label="breadcrumb"] .feature-nav line-height: 100% - a - color: $color-flexoki-600 - font-family: $font-family-serif h1, a display: inline-block font-size: $h1-font-size !important @@ -148,6 +148,11 @@ nav[aria-label="breadcrumb"] margin-bottom: 0 margin-right: pxToRem(40) margin-top: 0 + a + color: $color-flexoki-600 + font-family: $font-family-serif + h1 + font-weight: bold #menu-main .menu-content From faf07d57c370a99282fa287462091a1e147a24f8 Mon Sep 17 00:00:00 2001 From: Arnaud Levy Date: Mon, 13 Jan 2025 17:37:37 +0100 Subject: [PATCH 05/12] css --- app/assets/stylesheets/admin/_variables.sass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/admin/_variables.sass b/app/assets/stylesheets/admin/_variables.sass index f86ab31325..7c06a2f2b4 100644 --- a/app/assets/stylesheets/admin/_variables.sass +++ b/app/assets/stylesheets/admin/_variables.sass @@ -6,7 +6,7 @@ $color-white: #FFFFFF // MAIN COLORS $color-accent: $color-flexoki-blue-a11y $color-text: #000000 -$color-text-alt: #454545 +$color-text-alt: #585653 $color-border: rgba(0, 0, 0, 0.1) $color-background-alt: #F2F2F2 $color-background: #FFFFFF From e75af9c3d9bbb08e82bd6d87b23b7a5d7e59abbb Mon Sep 17 00:00:00 2001 From: Arnaud Levy Date: Mon, 13 Jan 2025 19:20:50 +0100 Subject: [PATCH 06/12] better --- app/assets/stylesheets/admin/_variables.sass | 1 + app/assets/stylesheets/admin/design-system/nav.sass | 2 +- app/views/admin/communication/websites/show.html.erb | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/admin/_variables.sass b/app/assets/stylesheets/admin/_variables.sass index 7c06a2f2b4..605ec982a7 100644 --- a/app/assets/stylesheets/admin/_variables.sass +++ b/app/assets/stylesheets/admin/_variables.sass @@ -7,6 +7,7 @@ $color-white: #FFFFFF $color-accent: $color-flexoki-blue-a11y $color-text: #000000 $color-text-alt: #585653 +$color-text-alt-large: #75746f $color-border: rgba(0, 0, 0, 0.1) $color-background-alt: #F2F2F2 $color-background: #FFFFFF diff --git a/app/assets/stylesheets/admin/design-system/nav.sass b/app/assets/stylesheets/admin/design-system/nav.sass index f5a037bc54..f005dde8d7 100644 --- a/app/assets/stylesheets/admin/design-system/nav.sass +++ b/app/assets/stylesheets/admin/design-system/nav.sass @@ -149,7 +149,7 @@ nav[aria-label="breadcrumb"] margin-right: pxToRem(40) margin-top: 0 a - color: $color-flexoki-600 + color: $color-text-alt-large font-family: $font-family-serif h1 font-weight: bold diff --git a/app/views/admin/communication/websites/show.html.erb b/app/views/admin/communication/websites/show.html.erb index 10c83a7ae0..023e062f9f 100644 --- a/app/views/admin/communication/websites/show.html.erb +++ b/app/views/admin/communication/websites/show.html.erb @@ -38,10 +38,10 @@ number_of_panels = 0 -<%= image_tag @website.deployment_status_badge, alt: '' if @website.deployment_status_badge.present? %> - <%= render 'admin/application/l10n/widget', about: @website, l10n: @l10n, small: true %> +<%= image_tag @website.deployment_status_badge, alt: '' if @website.deployment_status_badge.present? %> + <% if current_user.server_admin? %> <% content_for :action_bar_left do %> <%= destroy_link @website %> From f36b999c95768decb8b0fec030a4ae94ac16c754 Mon Sep 17 00:00:00 2001 From: Arnaud Levy Date: Mon, 13 Jan 2025 21:15:35 +0100 Subject: [PATCH 07/12] caps --- app/assets/stylesheets/admin/_variables.sass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/admin/_variables.sass b/app/assets/stylesheets/admin/_variables.sass index 605ec982a7..3508be2b98 100644 --- a/app/assets/stylesheets/admin/_variables.sass +++ b/app/assets/stylesheets/admin/_variables.sass @@ -7,7 +7,7 @@ $color-white: #FFFFFF $color-accent: $color-flexoki-blue-a11y $color-text: #000000 $color-text-alt: #585653 -$color-text-alt-large: #75746f +$color-text-alt-large: #75746F $color-border: rgba(0, 0, 0, 0.1) $color-background-alt: #F2F2F2 $color-background: #FFFFFF From 889cea7e616d74d61d5716896d0e2a7653368d88 Mon Sep 17 00:00:00 2001 From: Arnaud Levy Date: Tue, 14 Jan 2025 07:54:08 +0100 Subject: [PATCH 08/12] semibold --- app/assets/stylesheets/admin/design-system/fonts.sass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/admin/design-system/fonts.sass b/app/assets/stylesheets/admin/design-system/fonts.sass index b7e893aa26..d68ecd4fd8 100644 --- a/app/assets/stylesheets/admin/design-system/fonts.sass +++ b/app/assets/stylesheets/admin/design-system/fonts.sass @@ -49,12 +49,12 @@ font-family: 'Adelphe' font-style: normal font-weight: bold - src: asset-url("adelphe/Adelphe-GerminalBold.woff2") format("woff2"), url("adelphe/Adelphe-GerminalBold.woff") format("woff") + src: asset-url("adelphe/Adelphe-GerminalSemiBold.woff2") format("woff2"), url("adelphe/Adelphe-GerminalSemiBold.woff") format("woff") @font-face font-display: swap font-family: 'Adelphe' font-style: italic font-weight: bold - src: asset-url("adelphe/Adelphe-GerminalBoldItalic.woff2") format("woff2"), url("adelphe/Adelphe-GerminalBoldItalic.woff") format("woff") + src: asset-url("adelphe/Adelphe-GerminalSemiBoldItalic.woff2") format("woff2"), url("adelphe/Adelphe-GerminalSemiBoldItalic.woff") format("woff") From 807d4cd60c128a16cb287894d9ec7e87bec0f923 Mon Sep 17 00:00:00 2001 From: Arnaud Levy Date: Tue, 14 Jan 2025 08:32:34 +0100 Subject: [PATCH 09/12] better hero --- .../stylesheets/admin/design-system/hero.sass | 14 +++++++-- .../administration/dashboard_controller.rb | 1 + .../communication/dashboard_controller.rb | 1 + .../communication/extranets_controller.rb | 1 + .../communication/websites_controller.rb | 1 + app/controllers/admin/dashboard_controller.rb | 1 + .../admin/education/dashboard_controller.rb | 1 + .../admin/education/programs_controller.rb | 1 + .../admin/research/dashboard_controller.rb | 1 + .../admin/research/journals_controller.rb | 1 + .../admin/university/dashboard_controller.rb | 1 + .../application/components/_hero.html.erb | 30 +++++++++--------- .../websites/agenda/events/_list.html.erb | 31 +++++++++++-------- .../communication/websites/show.html.erb | 8 ++--- 14 files changed, 60 insertions(+), 33 deletions(-) diff --git a/app/assets/stylesheets/admin/design-system/hero.sass b/app/assets/stylesheets/admin/design-system/hero.sass index b55dc3abed..428ecfb01f 100644 --- a/app/assets/stylesheets/admin/design-system/hero.sass +++ b/app/assets/stylesheets/admin/design-system/hero.sass @@ -1,6 +1,16 @@ .hero - margin-bottom: 50px - min-height: 200px + margin-bottom: $spacing0 + &__content + border-bottom: 1px solid $color-border + margin-top: $spacing2 + padding-bottom: $spacing0 + h1 + margin-bottom: 0 + line-height: 100% + &--summary + .hero__content + border-bottom: none + margin-bottom: $spacing2 .welcome color: $color-text-alt font-size: pxToRem(14) diff --git a/app/controllers/admin/administration/dashboard_controller.rb b/app/controllers/admin/administration/dashboard_controller.rb index 58b679812d..f5f2c8e39a 100644 --- a/app/controllers/admin/administration/dashboard_controller.rb +++ b/app/controllers/admin/administration/dashboard_controller.rb @@ -3,6 +3,7 @@ class Admin::Administration::DashboardController < Admin::Administration::Applic def index raise_403_unless feature_administration? @namespace = Administration + @hero_summary = true breadcrumb render 'admin/dashboard/namespace' end diff --git a/app/controllers/admin/communication/dashboard_controller.rb b/app/controllers/admin/communication/dashboard_controller.rb index c8acc704aa..f6d4a1f1e8 100644 --- a/app/controllers/admin/communication/dashboard_controller.rb +++ b/app/controllers/admin/communication/dashboard_controller.rb @@ -3,6 +3,7 @@ class Admin::Communication::DashboardController < Admin::Communication::Applicat def index raise_403_unless feature_communication? @namespace = Communication + @hero_summary = true breadcrumb render 'admin/dashboard/namespace' end diff --git a/app/controllers/admin/communication/extranets_controller.rb b/app/controllers/admin/communication/extranets_controller.rb index 9756c0cc37..6af8f322ac 100644 --- a/app/controllers/admin/communication/extranets_controller.rb +++ b/app/controllers/admin/communication/extranets_controller.rb @@ -13,6 +13,7 @@ def index end def show + @hero_summary = true breadcrumb end diff --git a/app/controllers/admin/communication/websites_controller.rb b/app/controllers/admin/communication/websites_controller.rb index 1936d45763..e69c4e5036 100644 --- a/app/controllers/admin/communication/websites_controller.rb +++ b/app/controllers/admin/communication/websites_controller.rb @@ -35,6 +35,7 @@ def show @events = @all_events.latest_in(current_language) @all_projects = @website.projects.accessible_by(current_ability) @projects = @all_projects.latest_in(current_language) + @hero_summary = true breadcrumb end diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb index 6edfbed00e..3d9496cad9 100644 --- a/app/controllers/admin/dashboard_controller.rb +++ b/app/controllers/admin/dashboard_controller.rb @@ -5,6 +5,7 @@ def index @namespaces << Research if feature_research? @namespaces << Communication if feature_communication? @namespaces << Administration if feature_administration? + @hero_summary = true breadcrumb end diff --git a/app/controllers/admin/education/dashboard_controller.rb b/app/controllers/admin/education/dashboard_controller.rb index 03824a39fa..37ac924faa 100644 --- a/app/controllers/admin/education/dashboard_controller.rb +++ b/app/controllers/admin/education/dashboard_controller.rb @@ -3,6 +3,7 @@ class Admin::Education::DashboardController < Admin::Education::ApplicationContr def index raise_403_unless feature_education? @namespace = Education + @hero_summary = true breadcrumb render 'admin/dashboard/namespace' end diff --git a/app/controllers/admin/education/programs_controller.rb b/app/controllers/admin/education/programs_controller.rb index c892cddacc..a2a6ffbf33 100644 --- a/app/controllers/admin/education/programs_controller.rb +++ b/app/controllers/admin/education/programs_controller.rb @@ -33,6 +33,7 @@ def children def show @preview = true + @hero_summary = true breadcrumb end diff --git a/app/controllers/admin/research/dashboard_controller.rb b/app/controllers/admin/research/dashboard_controller.rb index 25bc14de7b..c6017033a7 100644 --- a/app/controllers/admin/research/dashboard_controller.rb +++ b/app/controllers/admin/research/dashboard_controller.rb @@ -3,6 +3,7 @@ class Admin::Research::DashboardController < Admin::Research::ApplicationControl def index raise_403_unless feature_research? @namespace = Research + @hero_summary = true breadcrumb render 'admin/dashboard/namespace' end diff --git a/app/controllers/admin/research/journals_controller.rb b/app/controllers/admin/research/journals_controller.rb index 80057a9320..52793a4fa8 100644 --- a/app/controllers/admin/research/journals_controller.rb +++ b/app/controllers/admin/research/journals_controller.rb @@ -22,6 +22,7 @@ def show @volumes = @journal.volumes .ordered(current_language) .limit(6) + @hero_summary = true breadcrumb end diff --git a/app/controllers/admin/university/dashboard_controller.rb b/app/controllers/admin/university/dashboard_controller.rb index c8f2c91f46..346581bf47 100644 --- a/app/controllers/admin/university/dashboard_controller.rb +++ b/app/controllers/admin/university/dashboard_controller.rb @@ -3,6 +3,7 @@ class Admin::University::DashboardController < Admin::University::ApplicationCon def index raise_403_unless feature_settings? @namespace = University + @hero_summary = true breadcrumb render 'admin/dashboard/namespace' end diff --git a/app/views/admin/application/components/_hero.html.erb b/app/views/admin/application/components/_hero.html.erb index 7786e7fea5..7a9c94cfcf 100644 --- a/app/views/admin/application/components/_hero.html.erb +++ b/app/views/admin/application/components/_hero.html.erb @@ -1,4 +1,4 @@ -
+
<% if breadcrumbs.one? %>
@@ -7,20 +7,22 @@ <% else %> <%= render_breadcrumbs builder: Osuny::BreadcrumbsOnRailsBuilder %> <% end %> -
- <% if @feature_nav.present? %> - <%= render_navigation context: @feature_nav %> - <% else %> -

<%= yield :title %>

- <% end %> -
- <%= yield :title_right %> +
+
+ <% if @feature_nav.present? %> + <%= render_navigation context: @feature_nav %> + <% else %> +

<%= yield :title %>

+ <% end %> +
+ <%= yield :title_right %> +
+ <% if content_for(:title_left) %> +
+ <%= yield :title_left %> +
+ <% end %>
- <% if content_for(:title_left) %> -
- <%= yield :title_left %> -
- <% end %>
\ No newline at end of file diff --git a/app/views/admin/communication/websites/agenda/events/_list.html.erb b/app/views/admin/communication/websites/agenda/events/_list.html.erb index 51aafb76d5..77e3b5baed 100644 --- a/app/views/admin/communication/websites/agenda/events/_list.html.erb +++ b/app/views/admin/communication/websites/agenda/events/_list.html.erb @@ -13,20 +13,25 @@ link_to_all ||= false
<%= osuny_thumbnail_localized event %> -
- <%= osuny_published_localized event unless small %> - <%= osuny_link_localized event, - admin_communication_website_agenda_event_path( - website_id: event.website.id, - id: event.id - ), - classes: "stretched-link" %> - <% if event_l10n&.subtitle.present? %> -
- - <%= event_l10n.subtitle.truncate(45) %> - +
+ <% unless small %> +
+ <%= osuny_published_localized event %> +
<% end %> +
+ <%= osuny_link_localized event, + admin_communication_website_agenda_event_path( + website_id: event.website.id, + id: event.id + ), + classes: "stretched-link" %> + <% if event_l10n&.subtitle.present? %> +
+ <%= event_l10n.subtitle.truncate(45) %> +
+ <% end %> +