Skip to content

Commit

Permalink
sign in page and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
clairezed committed Sep 6, 2023
1 parent 054e2d3 commit fd3c111
Show file tree
Hide file tree
Showing 16 changed files with 120 additions and 113 deletions.
2 changes: 0 additions & 2 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ def setup_cookie_text
end

def fetch_themes
p "fetch_themes"
@footer_landing = Landing.accueil
@footer_landing_themes = Rails.cache.fetch('footer_landing_themes', expires_in: 1.hour) do
@footer_landing.landing_themes.not_archived.order(:position)
end
end

end
4 changes: 2 additions & 2 deletions app/views/about/comment_ca_marche.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
.fr-col-12.fr-col-md-10.fr-col-lg-8
.fr-modal__body
.fr-modal__header
%button.fr-btn--close.fr-btn{ 'aria-controls': 'fr-transcription-modal-pde-testimonial', title: t('pages.navbar.close') }
= t('pages.navbar.close')
%button.fr-btn--close.fr-btn{ 'aria-controls': 'fr-transcription-modal-pde-testimonial', title: t('navbar.close') }
= t('navbar.close')
.fr-modal__content
= render 'about/transcription_pde_testimonial'
.fr-transcription__footer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
.fr-col-12.fr-col-md-8.fr-col-lg-6
.fr-modal__body
.fr-modal__header
%button.fr-btn--close.fr-btn{ 'aria-controls': "modal-coverage-#{referencement_coverage.id}", title: t('application.navbar.close') }
= t('application.navbar.close')
%button.fr-btn--close.fr-btn{ 'aria-controls': "modal-coverage-#{referencement_coverage.id}", title: t('navbar.close') }
= t('navbar.close')
.fr-modal__content
%h1.fr-modal__title{ id: "modal-coverage-#{referencement_coverage.id}-title" }
= [referencement_coverage.antenne.name, referencement_coverage.institution_subject.subject.label].join(' - ')
Expand Down
71 changes: 37 additions & 34 deletions app/views/application/_footer.html.haml
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
%footer.fr-footer#footer{ role: "contentinfo" }
.fr-container
.fr-footer__body
.fr-footer__brand.fr-enlarge-link
= link_to root_path, title: "#{t('come_back_to_home')}" do
%p.fr-logo
= t('republique_francaise_html')
.fr-footer__content
%p.fr-footer__content-desc
= t('.service_description')
%ul.fr-footer__content-list
%li.fr-footer__content-item
= mail_to ENV['APPLICATION_EMAIL'], 'Contactez-nous', target: :_blank, class: 'fr-footer__content-link'
%li.fr-footer__content-item
= link_to t('pages.footer.service_presentation'), '/dossier-presse.pdf', 'aria-label': t('pages.footer.service_presentation_title'), target: '_blank', rel: 'noopener', class: 'fr-footer__content-link'
%li.fr-footer__content-item
= link_to t('usage_stats'), public_index_path, class: 'fr-footer__content-link'
- if policy(Stats::All).team?
- if user_signed_in?
%footer.fr-footer#footer{ role: "contentinfo" }
.fr-container
.fr-footer__body
.fr-footer__brand.fr-enlarge-link
= link_to root_path, title: "#{t('come_back_to_home')}" do
%p.fr-logo
= t('republique_francaise_html')
.fr-footer__content
%p.fr-footer__content-desc
= t('.service_description')
%ul.fr-footer__content-list
%li.fr-footer__content-item
= link_to t('usage_team_stats'), team_index_path, class: 'fr-footer__content-link'
.fr-footer__bottom
%ul.fr-footer__bottom-list
%li.fr-footer__bottom-item
= link_to t('cgu'), cgu_path, class: 'fr-footer__bottom-link'
%li.fr-footer__bottom-item
= link_to t('about.mentions_d_information.title'), mentions_d_information_path, class: 'fr-footer__bottom-link'
%li.fr-footer__bottom-item
= link_to t('about.mentions_legales.title'), mentions_legales_path, class: 'fr-footer__bottom-link'
%li.fr-footer__bottom-item
= link_to t('conseiller.sitemap.sitemap.title'), conseiller_sitemap_path, class: 'fr-footer__bottom-link'
%li.fr-footer__bottom-item
= link_to t('about.accessibilite.footer_title'), accessibilite_path, class: 'fr-footer__bottom-link'
%li.fr-footer__bottom-item
%button.link.fr-footer__bottom-link{ id: 'open-cookies-box', 'aria-label': t('.open_cookies') }
= t('.cookies')
= mail_to ENV['APPLICATION_EMAIL'], 'Contactez-nous', target: :_blank, class: 'fr-footer__content-link'
%li.fr-footer__content-item
= link_to t('pages.footer.service_presentation'), '/dossier-presse.pdf', 'aria-label': t('pages.footer.service_presentation_title'), target: '_blank', rel: 'noopener', class: 'fr-footer__content-link'
%li.fr-footer__content-item
= link_to t('usage_stats'), public_index_path, class: 'fr-footer__content-link'
- if policy(Stats::All).team?
%li.fr-footer__content-item
= link_to t('usage_team_stats'), team_index_path, class: 'fr-footer__content-link'
.fr-footer__bottom
%ul.fr-footer__bottom-list
%li.fr-footer__bottom-item
= link_to t('cgu'), cgu_path, class: 'fr-footer__bottom-link'
%li.fr-footer__bottom-item
= link_to t('about.mentions_d_information.title'), mentions_d_information_path, class: 'fr-footer__bottom-link'
%li.fr-footer__bottom-item
= link_to t('about.mentions_legales.title'), mentions_legales_path, class: 'fr-footer__bottom-link'
%li.fr-footer__bottom-item
= link_to t('conseiller.sitemap.sitemap.title'), conseiller_sitemap_path, class: 'fr-footer__bottom-link'
%li.fr-footer__bottom-item
= link_to t('about.accessibilite.footer_title'), accessibilite_path, class: 'fr-footer__bottom-link'
%li.fr-footer__bottom-item
%button.link.fr-footer__bottom-link{ id: 'open-cookies-box', 'aria-label': t('.open_cookies') }
= t('.cookies')
- else
= render 'pages/footer'
15 changes: 8 additions & 7 deletions app/views/application/_navbar.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@
%br/
française
.fr-header__operator
= link_to root_path, class: 'pde-logo', title: t('.root_path_title') do
= link_to root_path, class: 'pde-logo', title: t('navbar.root_path_title') do
= image_tag 'logo-PDE.svg', alt: t('logos.pde')
.fr-header__navbar
%button.fr-btn--menu.fr-btn#fr-btn-menu-mobile-2{ 'aria-controls': 'modal-870', 'aria-haspopup': 'menu', 'data-fr-opened': 'false', title: t('.menu') }
= t(".menu")
%button.fr-btn--menu.fr-btn#fr-btn-menu-mobile-2{ 'aria-controls': 'modal-870', 'aria-haspopup': 'menu', 'data-fr-opened': 'false', title: t('navbar.menu') }
= t("navbar.menu")
.fr-header__tools
.fr-header__tools-links
%ul.fr-links-group
.fr-header__menu.fr-modal#modal-870{ 'aria-labelledby': 'fr-btn-menu-mobile-2' }
.fr-container
%button.fr-link--close.fr-link{ 'aria-controls': 'modal-870' }= t('.close')
%button.fr-link--close.fr-link{ 'aria-controls': 'modal-870' }= t('navbar.close')
.fr-header__menu-links
%nav.fr-nav{ 'aria-label': t(".main_menu"), role: 'navigation' }
%nav.fr-nav{ 'aria-label': t("navbar.main_menu"), role: 'navigation' }
%ul.fr-nav__list
%li.fr-nav__item
= link_to root_path, class: 'pde-logo-sm', title: t('.root_path_title') do
= image_tag 'place-des-entreprises-logo.png', alt: t('logos.pde')
= active_link_to root_path, class: 'fr-nav__link fr-text--bold', wrap_tag: :li, wrap_class: 'fr-nav__item', class_active: 'fr-nav__item--active', title: t('navbar.root_path_title'), active: :exclusive do
%span.red>= t('app_name_subdomain').sp_titleize_url
= "." + t('app_name_domain').sp_titleize_url
- if current_user.experts.present?
= active_link_to needs_path, class: 'fr-nav__link', wrap_tag: :li, wrap_class: 'fr-nav__item', class_active: 'fr-nav__item--active' do
%span.ri-inbox-fill.fr-mr-1w{ 'aria-hidden': 'true' }
Expand Down
47 changes: 27 additions & 20 deletions app/views/application/_navbar_signin.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,41 @@
.fr-header__brand-top
.fr-header__logo
%p.fr-logo
République
%br/
française
.fr-header__operator
= link_to root_path, class: 'pde-logo', title: t('application.navbar.root_path_title') do
= image_tag 'logo-PDE.svg', alt: t('logos.pde'), class: 'logo-sign-in'
= t('republique_francaise_html')
.fr-header__navbar
%button.fr-btn--menu.fr-btn#fr-btn-menu-mobile-2{ 'aria-controls': 'modal-870', 'aria-haspopup': 'menu', 'data-fr-opened': 'false', title: t("application.navbar.menu") }
= t("application.navbar.menu")
%button.fr-btn--menu.fr-btn#fr-btn-menu-mobile-2{ 'aria-controls': 'modal-870', 'aria-haspopup': 'menu', 'data-fr-opened': 'false', title: t("navbar.root_path_title") }
= t("navbar.menu")
.fr-header__service
= link_to root_path do
%p.fr-header__service-title
%span.red>= t('app_name_subdomain').sp_titleize_url
= "." + t('app_name_domain').sp_titleize_url
.fr-header__tools
%nav.fr-header__tools-links{ role: 'navigation' }
%ul.fr-links-group
.fr-header__tools-links{ role: 'navigation' }
%ul.fr-btns-group
%li
= active_link_to comment_ca_marche_path, class: 'fr-link' do
= t('about.comment_ca_marche.title')
%li
= link_to root_path, class: 'fr-link' do
= link_to root_path, class: 'fr-btn' do
= t('company_contact')
%li
= active_link_to tutoriels_path, class: 'fr-link' do
= active_link_to tutoriels_path, class: 'fr-btn' do
%span.ri-tools-line.fr-mr-1w{ 'aria-hidden': 'true' }
= t('user_pages.tutoriels.title')
%li
= link_to new_user_session_path, class: 'fr-link' do
%span.ri-tools-line.fr-mr-1w{ 'aria-hidden': 'true' }
= t('sign_in')
= link_to t('experts_login'), user_signed_in? ? needs_path : new_user_session_path, class: 'fr-btn fr-icon-lock-line'

/ Navigation principale - à garder pour éviter erreurs js sur mobile
.fr-header__menu.fr-modal#modal-870{ 'aria-labelledby': 'fr-btn-menu-mobile-2' }
.fr-container
%button.fr-link--close.fr-link{ 'aria-controls': 'modal-870' }= t("application.navbar.close")
%nav.fr-header__menu-links{ role: 'navigation' }
%button.fr-btn--close.fr-btn{ 'aria-controls': 'modal-870' }= t('navbar.close')
.fr-header__menu-links{ 'aria-label': t('navbar.main_menu') }
%nav.fr-nav{ 'aria-label': t("navbar.main_menu"), role: 'navigation' }
%ul.fr-nav__list
= active_link_to root_path, title: t('pages.navbar.link_to_blog'), class: 'fr-nav__link', wrap_tag: :li, wrap_class: 'fr-nav__item', class_active: 'fr-nav__item--active', active: :exclusive do
%span.ri-home-line.fr-mr-1w{ 'aria-hidden': 'true' }
= t('breadcrumbs_helper.home_link.home')
= active_link_to comment_ca_marche_path, class: 'fr-nav__link', wrap_tag: :li, wrap_class: 'fr-nav__item', class_active: 'fr-nav__item--active' do
%span.ri-presentation-line.fr-mr-1w{ 'aria-hidden': 'true' }
= t('about.comment_ca_marche.title')
= active_link_to tutoriels_path, class: 'fr-nav__link', wrap_tag: :li, wrap_class: 'fr-nav__item', class_active: 'fr-nav__item--active' do
%span.ri-tools-line.fr-mr-1w{ 'aria-hidden': 'true' }
= t('user_pages.tutoriels.title')
4 changes: 2 additions & 2 deletions app/views/application/_person_modal.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
.fr-col-12.fr-col-md-8.fr-col-lg-6
.fr-modal__body
.fr-modal__header
%button.fr-btn--close.fr-btn{ 'aria-controls': "modal-#{type}-#{person.id}", title: t('application.navbar.close') }
= t('application.navbar.close')
%button.fr-btn--close.fr-btn{ 'aria-controls': "modal-#{type}-#{person.id}", title: t('navbar.close') }
= t('navbar.close')
.fr-modal__content
%h1.fr-modal__title{ id: "modal-#{type}-#{person.id}-title" }
%span.fr-icon-arrow-right-line.fr-icon--lg{ 'aria-hidden': 'true' }
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/pages.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
%main#content{ role: 'main' }
= content_for?(:content) ? yield(:content) : yield # :content is used by sub-layouts

= render 'footer' unless in_iframe?
= render 'footer', footer_landing_themes: @footer_landing_themes, footer_landing: @footer_landing unless in_iframe?
4 changes: 2 additions & 2 deletions app/views/matches/_match.haml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
.fr-col-12.fr-col-md-6.fr-col-lg-4
.fr-modal__body
.fr-modal__header
%button.fr-btn--close.fr-btn.fr-ml-auto-imp.fr-mr-n2w{ 'aria-controls': "tooltip-match-#{match.id}", title: t('application.navbar.close') }
= t('application.navbar.close')
%button.fr-btn--close.fr-btn.fr-ml-auto-imp.fr-mr-n2w{ 'aria-controls': "tooltip-match-#{match.id}", title: t('navbar.close') }
= t('navbar.close')
.fr-modal__content
%h1.fr-modal__title{ id: "tooltip-match-#{match.id}-title" }
%span.fr-icon-arrow-right-line.fr-icon--lg{ 'aria-hidden': 'true' }
Expand Down
29 changes: 15 additions & 14 deletions app/views/pages/_footer.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
.fr-footer__top
.fr-container
.fr-grid-row.fr-grid-row--start.fr-grid-row--gutters
.fr-col-12.fr-col-sm-4
%h3.fr-footer__top-cat= t('.themes')
%ul.fr-footer__top-list
- @footer_landing_themes.first(5).each do |landing_theme|
- path = { controller: "landings/landing_themes", action: "show", landing_slug: @footer_landing.slug, slug: landing_theme.slug, anchor: 'section-breadcrumbs' }.merge(query_params)
%li
= link_to landing_theme.title, path, class: 'fr-footer__top-link'
.fr-col-12.fr-col-sm-4
%ul.fr-footer__top-list.fr-pt-4w
- @footer_landing_themes.last(4).each do |landing_theme|
- path = { controller: "landings/landing_themes", action: "show", landing_slug: @footer_landing.slug, slug: landing_theme.slug, anchor: 'section-breadcrumbs' }.merge(query_params)
%li
= link_to landing_theme.title, path, class: 'fr-footer__top-link'
- if defined?(footer_landing_themes)
.fr-col-12.fr-col-sm-4
%h3.fr-footer__top-cat= t('.themes')
%ul.fr-footer__top-list
- footer_landing_themes.first(5).each do |landing_theme|
- path = { controller: "landings/landing_themes", action: "show", landing_slug: footer_landing.slug, slug: landing_theme.slug, anchor: 'section-breadcrumbs' }.merge(query_params)
%li
= link_to landing_theme.title, path, class: 'fr-footer__top-link'
.fr-col-12.fr-col-sm-4
%ul.fr-footer__top-list.fr-pt-4w
- footer_landing_themes.last(4).each do |landing_theme|
- path = { controller: "landings/landing_themes", action: "show", landing_slug: footer_landing.slug, slug: landing_theme.slug, anchor: 'section-breadcrumbs' }.merge(query_params)
%li
= link_to landing_theme.title, path, class: 'fr-footer__top-link'
.fr-col-12.fr-col-sm-4
%h3.fr-footer__top-cat= t('.know_us')
%ul.fr-footer__top-list
Expand All @@ -41,7 +42,7 @@
%p.fr-footer__content-desc= t('app_tagline')
%ul.fr-footer__content-list
%li.fr-footer__content-item
= link_to 'service-publics.fr', 'https://www.service-public.fr', title: to_new_window_title(t('.service_public_title')), target: '_blank', rel: 'noopener', class: 'fr-footer__content-link'
= link_to 'service-public.fr', 'https://www.service-public.fr', title: to_new_window_title(t('.service_public_title')), target: '_blank', rel: 'noopener', class: 'fr-footer__content-link'
.fr-footer__bottom
%ul.fr-footer__bottom-list
%li.fr-footer__bottom-item
Expand Down
4 changes: 2 additions & 2 deletions app/views/pages/_how_it_works_long.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
.fr-col-12.fr-col-md-10.fr-col-lg-8
.fr-modal__body
.fr-modal__header
%button.fr-btn--close.fr-btn{ 'aria-controls': 'fr-transcription-modal-pde-presentation', title: t('pages.navbar.close') }
= t('pages.navbar.close')
%button.fr-btn--close.fr-btn{ 'aria-controls': 'fr-transcription-modal-pde-presentation', title: t('navbar.close') }
= t('navbar.close')
.fr-modal__content
= render 'about/transcription_pde_presentation'
.fr-transcription__footer
Expand Down
8 changes: 4 additions & 4 deletions app/views/pages/_navbar.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
%p.fr-logo
= t('republique_francaise_html')
.fr-header__navbar
%button.fr-btn--menu.fr-btn#fr-btn-menu-mobile-4{ 'aria-controls': 'modal-responsive-menu', 'aria-haspopup': 'menu', 'data-fr-opened': 'false', title: "#{t('pages.navbar.menu')}" }
= t('pages.navbar.menu')
%button.fr-btn--menu.fr-btn#fr-btn-menu-mobile-4{ 'aria-controls': 'modal-responsive-menu', 'aria-haspopup': 'menu', 'data-fr-opened': 'false', title: "#{t('navbar.menu')}" }
= t('navbar.menu')
.fr-header__service
= link_to root_path do
%p.fr-header__service-title
Expand All @@ -23,9 +23,9 @@
= link_to t('experts_login'), user_signed_in? ? needs_path : new_user_session_path, class: 'fr-link fr-icon-lock-line'
.fr-header__menu.fr-modal#modal-responsive-menu{ 'aria-labelledby': 'fr-btn-menu-mobile-4' }
.fr-container
%button.fr-link--close.fr-link{ 'aria-controls': 'modal-responsive-menu' }= t('pages.navbar.close')
%button.fr-link--close.fr-link{ 'aria-controls': 'modal-responsive-menu' }= t('navbar.close')
.fr-header__menu-links{ 'aria-label': 'Menu principal' }
%nav.fr-nav{ 'aria-label': t(".main_menu"), role: 'navigation' }
%nav.fr-nav{ 'aria-label': t("navbar.main_menu"), role: 'navigation' }
%ul.fr-nav__list
= active_link_to root_path, title: t('.link_to_blog'), class: 'fr-nav__link', wrap_tag: :li, wrap_class: 'fr-nav__item', class_active: 'fr-nav__item--active', active: :exclusive do
%span.ri-home-line.fr-mr-1w{ 'aria-hidden': 'true' }
Expand Down
4 changes: 2 additions & 2 deletions app/views/user_pages/tutoriels.haml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
.fr-col-12.fr-col-md-10.fr-col-lg-8
.fr-modal__body
.fr-modal__header
%button.fr-btn--close.fr-btn{ 'aria-controls': 'fr-transcription-modal-pde-tutorial', title: t('pages.navbar.close') }
= t('pages.navbar.close')
%button.fr-btn--close.fr-btn{ 'aria-controls': 'fr-transcription-modal-pde-tutorial', title: t('navbar.close') }
= t('navbar.close')
.fr-modal__content
= render 'transcription_pde_tutorial'
.fr-transcription__footer
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/custom_extensions.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class String
def sp_titleize_url
self.titlecase.gsub(' ', '-').gsub('.Fr', '.fr')
self.titlecase.tr(' ', '-').gsub('.Fr', '.fr')
end
end
end
Loading

0 comments on commit fd3c111

Please sign in to comment.