Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptation des menus du site #2575

Merged
merged 15 commits into from
Jan 14, 2025
Binary file modified app/assets/fonts/inclusive-sans/InclusiveSans-Bold.woff
Binary file not shown.
Binary file modified app/assets/fonts/inclusive-sans/InclusiveSans-Bold.woff2
Binary file not shown.
Binary file modified app/assets/fonts/inclusive-sans/InclusiveSans-BoldItalic.woff
Binary file not shown.
Binary file modified app/assets/fonts/inclusive-sans/InclusiveSans-BoldItalic.woff2
Binary file not shown.
Binary file modified app/assets/fonts/inclusive-sans/InclusiveSans-Italic.woff
Binary file not shown.
Binary file modified app/assets/fonts/inclusive-sans/InclusiveSans-Italic.woff2
Binary file not shown.
Binary file modified app/assets/fonts/inclusive-sans/InclusiveSans-Regular.woff
Binary file not shown.
Binary file modified app/assets/fonts/inclusive-sans/InclusiveSans-Regular.woff2
Binary file not shown.
3 changes: 2 additions & 1 deletion app/assets/stylesheets/admin/_variables.sass
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ $color-white: #FFFFFF
// MAIN COLORS
$color-accent: $color-flexoki-blue-a11y
$color-text: #000000
$color-text-alt: #454545
$color-text-alt: #585653
$color-text-alt-large: #75746F
$color-border: rgba(0, 0, 0, 0.1)
$color-background-alt: #F2F2F2
$color-background: #FFFFFF
Expand Down
17 changes: 16 additions & 1 deletion app/assets/stylesheets/admin/components/card.sass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,7 +32,7 @@
font-weight: normal
.card-body,
.card-footer
line-height: 120%
line-height: 110%
.table
margin-bottom: 0
th,
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stylesheets/admin/design-system/fonts.sass
Original file line number Diff line number Diff line change
Expand Up @@ -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")

14 changes: 12 additions & 2 deletions app/assets/stylesheets/admin/design-system/hero.sass
Original file line number Diff line number Diff line change
@@ -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
line-height: 100%
margin-bottom: 0
&--summary
.hero__content
border-bottom: none
margin-bottom: $spacing2
.welcome
color: $color-text-alt
font-size: pxToRem(14)
11 changes: 8 additions & 3 deletions app/assets/stylesheets/admin/design-system/nav.sass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -138,16 +141,18 @@ 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
line-height: 100%
margin-bottom: 0
margin-right: pxToRem(40)
margin-top: 0
a
color: $color-text-alt-large
font-family: $font-family-serif
h1
font-weight: bold

#menu-main
.menu-content
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/admin/osuny/thumbnail.sass
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def index
end

def show
@hero_summary = true
breadcrumb
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/education/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/education/programs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def children

def show
@preview = true
@hero_summary = true
breadcrumb
end

Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/research/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/research/journals_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def show
@volumes = @journal.volumes
.ordered(current_language)
.limit(6)
@hero_summary = true
breadcrumb
end

Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/university/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions app/models/communication/website/with_feature_agenda.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions app/models/communication/website/with_feature_portfolio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions app/models/communication/website/with_feature_posts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 12 additions & 0 deletions app/views/admin/application/components/_all.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div>
<div class="<%= osuny_card_classes(horizontal: true) %> card--all">
<div class="osuny__thumbnail osuny__thumbnail--small">
<span class="osuny__thumbnail__initials">
<%= lucide_icon('arrow-right') %>
</span>
</div>
<div class="card-body">
<a href="<%= link %>" class="stretched-link"><%= t('admin.item.see_all') %></a>
</div>
</div>
</div>
30 changes: 16 additions & 14 deletions app/views/admin/application/components/_hero.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="hero">
<div class="hero<%= ' hero--summary' if @hero_summary %>">
<div class="container-fluid">
<% if breadcrumbs.one? %>
<div class="welcome py-4">
Expand All @@ -7,20 +7,22 @@
<% else %>
<%= render_breadcrumbs builder: Osuny::BreadcrumbsOnRailsBuilder %>
<% end %>
<div class="d-xl-flex mt-5">
<% if @feature_nav.present? %>
<%= render_navigation context: @feature_nav %>
<% else %>
<h1><%= yield :title %></h1>
<% end %>
<div class="ms-xl-auto text-xl-end mt-2">
<%= yield :title_right %>
<div class="hero__content">
<div class="d-xl-flex align-items-end">
<% if @feature_nav.present? %>
<%= render_navigation context: @feature_nav %>
<% else %>
<h1><%= yield :title %></h1>
<% end %>
<div class="ms-xl-auto text-xl-end mt-2">
<%= yield :title_right %>
</div>
</div>
<% if content_for(:title_left) %>
<div class="mt-2">
<%= yield :title_left %>
</div>
<% end %>
</div>
<% if content_for(:title_left) %>
<div class="mt-2">
<%= yield :title_left %>
</div>
<% end %>
</div>
</div>
2 changes: 1 addition & 1 deletion app/views/admin/application/components/_panel.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<% if small %>
<%= osuny_label title %>
<% else %>
<h2 class="me-3 pt-1 h6 text-uppercase"><%= title %></h2>
<h2 class="me-3 pt-1 h6 text-muted text-uppercase"><%= title %></h2>
<% end %>
<% end %>
<% if action %>
Expand Down
Loading
Loading