From 835d263ce5a9e12b6e02241928d4b6f5b7287495 Mon Sep 17 00:00:00 2001 From: Arnaud Levy Date: Sat, 1 Jun 2024 16:04:09 +0200 Subject: [PATCH 01/34] Done for websites ! --- app/assets/stylesheets/admin/_variables.sass | 2 + .../stylesheets/admin/components/table.sass | 3 - .../admin/design-system/forms.sass | 1 + .../stylesheets/admin/design-system/nav.sass | 26 +++++- .../admin/application_controller.rb | 5 ++ .../websites/application_controller.rb | 4 + app/helpers/admin/application_helper.rb | 2 +- .../components}/_commands.html.erb | 0 .../components}/_footer.html.erb | 0 .../components}/_hero.html.erb | 0 .../components}/_nav.html.erb | 2 +- .../components}/_panel.html.erb | 0 .../application/components/_subnav.html.erb | 18 ++++ .../components}/_user_unconfirmed.html.erb | 0 .../admin/application/summary/_form.html.erb | 1 + .../websites/_language_switcher.html.erb | 19 +++++ .../communication/websites/_sidebar.html.erb | 16 +--- .../websites/agenda/categories/edit.html.erb | 4 +- .../websites/agenda/categories/index.html.erb | 10 +-- .../websites/agenda/categories/new.html.erb | 4 +- .../websites/agenda/categories/show.html.erb | 32 ++++---- .../websites/agenda/events/edit.html.erb | 4 +- .../websites/agenda/events/index.html.erb | 28 +++---- .../websites/agenda/events/new.html.erb | 4 +- .../websites/agenda/events/show.html.erb | 50 ++++++----- .../communication/websites/analytics.html.erb | 23 +++--- .../websites/localizations/show.html.erb | 61 +++++++------- .../websites/menus/edit.html.erb | 4 +- .../websites/menus/index.html.erb | 10 +-- .../websites/menus/items/_form.html.erb | 2 +- .../websites/menus/items/edit.html.erb | 4 +- .../websites/menus/items/new.html.erb | 4 +- .../websites/menus/items/show.html.erb | 50 +++++------ .../communication/websites/menus/new.html.erb | 4 +- .../websites/menus/show.html.erb | 30 ++++--- .../websites/pages/edit.html.erb | 4 +- .../websites/pages/index.html.erb | 76 ++++++++--------- .../websites/pages/index_list.html.erb | 48 +++++------ .../communication/websites/pages/new.html.erb | 4 +- .../websites/pages/show.html.erb | 48 ++++++----- .../portfolio/categories/edit.html.erb | 4 +- .../portfolio/categories/index.html.erb | 10 +-- .../portfolio/categories/new.html.erb | 5 +- .../portfolio/categories/show.html.erb | 38 ++++----- .../websites/portfolio/projects/edit.html.erb | 4 +- .../portfolio/projects/index.html.erb | 27 +++--- .../websites/portfolio/projects/new.html.erb | 4 +- .../websites/portfolio/projects/show.html.erb | 44 +++++----- .../websites/posts/authors/index.html.erb | 10 +-- .../websites/posts/authors/show.html.erb | 14 ++-- .../websites/posts/categories/edit.html.erb | 4 +- .../websites/posts/categories/index.html.erb | 10 +-- .../websites/posts/categories/new.html.erb | 4 +- .../websites/posts/categories/show.html.erb | 82 +++++++++---------- .../websites/posts/edit.html.erb | 4 +- .../websites/posts/index.html.erb | 63 +++++++------- .../communication/websites/posts/new.html.erb | 4 +- .../websites/posts/show.html.erb | 48 +++++------ .../communication/websites/show.html.erb | 36 ++++++-- app/views/admin/layouts/application.html.erb | 11 +-- app/views/admin/layouts/preview.html.erb | 2 +- app/views/extranet/application/_nav.html.erb | 10 ++- app/views/server/layouts/application.html.erb | 6 +- config/locales/communication/en.yml | 3 + config/locales/communication/fr.yml | 3 + .../admin/communication/website_navigation.rb | 34 ++++++++ config/{ => navigation}/admin_navigation.rb | 0 .../{ => navigation}/extranet_navigation.rb | 0 config/{ => navigation}/server_navigation.rb | 0 69 files changed, 581 insertions(+), 510 deletions(-) rename app/views/admin/{layouts/themes/pure => application/components}/_commands.html.erb (100%) rename app/views/admin/{layouts/themes/pure => application/components}/_footer.html.erb (100%) rename app/views/admin/{layouts/themes/pure => application/components}/_hero.html.erb (100%) rename app/views/admin/{layouts/themes/pure => application/components}/_nav.html.erb (98%) rename app/views/admin/{layouts/themes/pure => application/components}/_panel.html.erb (100%) create mode 100644 app/views/admin/application/components/_subnav.html.erb rename app/views/admin/{layouts/themes/pure => application/components}/_user_unconfirmed.html.erb (100%) create mode 100644 app/views/admin/communication/websites/_language_switcher.html.erb create mode 100644 config/navigation/admin/communication/website_navigation.rb rename config/{ => navigation}/admin_navigation.rb (100%) rename config/{ => navigation}/extranet_navigation.rb (100%) rename config/{ => navigation}/server_navigation.rb (100%) diff --git a/app/assets/stylesheets/admin/_variables.sass b/app/assets/stylesheets/admin/_variables.sass index 6b9074465..711c088d7 100644 --- a/app/assets/stylesheets/admin/_variables.sass +++ b/app/assets/stylesheets/admin/_variables.sass @@ -1,3 +1,4 @@ +$color-black: #000000 $color-bg: #FFFCF0 $color-bg-soft: #F2F0E5 $color-white: #FFFFFF @@ -25,6 +26,7 @@ $spacing-section-y: pxToRem(36) // Bootstrap +$body-bg: $color-bg $primary: $color-accent $color-background-alt: #F5F5F5 diff --git a/app/assets/stylesheets/admin/components/table.sass b/app/assets/stylesheets/admin/components/table.sass index e1322f157..fe2498202 100644 --- a/app/assets/stylesheets/admin/components/table.sass +++ b/app/assets/stylesheets/admin/components/table.sass @@ -5,9 +5,6 @@ color: $color-text-alt font-size: $form-label-font-size font-weight: normal - td, - th - background: transparent !important th:first-of-type, td:first-of-type padding-left: 0 diff --git a/app/assets/stylesheets/admin/design-system/forms.sass b/app/assets/stylesheets/admin/design-system/forms.sass index 57ad68328..9a7d8c84f 100644 --- a/app/assets/stylesheets/admin/design-system/forms.sass +++ b/app/assets/stylesheets/admin/design-system/forms.sass @@ -5,6 +5,7 @@ input.form-control[type=password], input.form-control[type=url], textarea.form-control font-family: $font-family-serif + background: $color-white .form-control:valid, .form-control.is-valid, diff --git a/app/assets/stylesheets/admin/design-system/nav.sass b/app/assets/stylesheets/admin/design-system/nav.sass index 99e22c94a..64cbe5488 100644 --- a/app/assets/stylesheets/admin/design-system/nav.sass +++ b/app/assets/stylesheets/admin/design-system/nav.sass @@ -64,4 +64,28 @@ nav[aria-label="breadcrumb"] white-space: nowrap &:last-of-type padding-right: var(--bs-gutter-x) - + +.subnav + border-bottom: 1px solid $color-bg-soft + padding-bottom: 0 + padding-top: 0 + #subnav + justify-content: center + .navbar-toggler + border: none + padding-left: 0 + a + color: $color-text-alt + display: inline-block + line-height: 100% + margin: 0 30px + padding-bottom: 20px + padding-top: 15px + border-top-color: transparent + border-top-style: solid + border-top-width: 5px + &:hover + color: $color-black + &.active + border-top-color: $color-black + color: $color-black diff --git a/app/controllers/admin/application_controller.rb b/app/controllers/admin/application_controller.rb index 119a0c694..aeff6aa8c 100644 --- a/app/controllers/admin/application_controller.rb +++ b/app/controllers/admin/application_controller.rb @@ -16,6 +16,11 @@ def background_tasks_count end helper_method :background_tasks_count + def current_subnav_context + nil + end + helper_method :current_subnav_context + protected def breadcrumb diff --git a/app/controllers/admin/communication/websites/application_controller.rb b/app/controllers/admin/communication/websites/application_controller.rb index f5111244d..c747b1692 100644 --- a/app/controllers/admin/communication/websites/application_controller.rb +++ b/app/controllers/admin/communication/websites/application_controller.rb @@ -11,6 +11,10 @@ def current_website_language end helper_method :current_website_language + def current_subnav_context + 'navigation/admin/communication/website' if @website + end + def breadcrumb super add_breadcrumb Communication::Website.model_name.human(count: 2), admin_communication_websites_path diff --git a/app/helpers/admin/application_helper.rb b/app/helpers/admin/application_helper.rb index ce3f6188d..eb843cb2c 100644 --- a/app/helpers/admin/application_helper.rb +++ b/app/helpers/admin/application_helper.rb @@ -69,7 +69,7 @@ def static_link(path) end def osuny_panel(title = nil, subtitle: nil, action: nil, image: nil, small: false, classes: '', &block) - render layout: "admin/layouts/themes/pure/panel", + render layout: "admin/application/components/panel", locals: { title: title, subtitle: subtitle, diff --git a/app/views/admin/layouts/themes/pure/_commands.html.erb b/app/views/admin/application/components/_commands.html.erb similarity index 100% rename from app/views/admin/layouts/themes/pure/_commands.html.erb rename to app/views/admin/application/components/_commands.html.erb diff --git a/app/views/admin/layouts/themes/pure/_footer.html.erb b/app/views/admin/application/components/_footer.html.erb similarity index 100% rename from app/views/admin/layouts/themes/pure/_footer.html.erb rename to app/views/admin/application/components/_footer.html.erb diff --git a/app/views/admin/layouts/themes/pure/_hero.html.erb b/app/views/admin/application/components/_hero.html.erb similarity index 100% rename from app/views/admin/layouts/themes/pure/_hero.html.erb rename to app/views/admin/application/components/_hero.html.erb diff --git a/app/views/admin/layouts/themes/pure/_nav.html.erb b/app/views/admin/application/components/_nav.html.erb similarity index 98% rename from app/views/admin/layouts/themes/pure/_nav.html.erb rename to app/views/admin/application/components/_nav.html.erb index 0f1b76fe2..cc0dfe3f9 100644 --- a/app/views/admin/layouts/themes/pure/_nav.html.erb +++ b/app/views/admin/application/components/_nav.html.erb @@ -1,5 +1,5 @@ <% -context ||= :admin +context ||= 'navigation/admin' %>