diff --git a/app/views/layouts/_header.haml b/app/views/layouts/_header.haml index 58e290b9bcb..22a4e47e3a7 100644 --- a/app/views/layouts/_header.haml +++ b/app/views/layouts/_header.haml @@ -99,4 +99,8 @@ - if current_user.expert && current_expert.avis_summary[:total] > 0 = render partial: 'layouts/header/avis_tab', locals: { current_expert: current_expert } + - if content_for?(:navigation_principale) + .fr-container + = yield(:navigation_principale) + = yield(:notice_info) diff --git a/app/views/super_admins/release_notes/_main_navigation.html.haml b/app/views/super_admins/release_notes/_main_navigation.html.haml new file mode 100644 index 00000000000..b7cc60f49cb --- /dev/null +++ b/app/views/super_admins/release_notes/_main_navigation.html.haml @@ -0,0 +1,13 @@ +- content_for(:navigation_principale) do + %nav.fr-nav#header-navigation{ role: "navigation", aria: { label: 'Menu principal annonces' } } + %ul.fr-nav__list + %li.fr-nav__item + = link_to "Toutes les annonces", super_admins_release_notes_path, class: "fr-nav__link", target: "_self", aria: { current: action == :index ? "page" : nil } + + - if action == :edit + %li.fr-nav__item + = link_to "Annonce", '', class: "fr-nav__link", target: "_self", aria: { current: "page" } + + - elsif action == :new + %li.fr-nav__item + = link_to "Nouvelle annonce", '', class: "fr-nav__link", target: "_self", aria: { current: "page" } diff --git a/app/views/super_admins/release_notes/edit.html.haml b/app/views/super_admins/release_notes/edit.html.haml index 9b3e3108f9e..355f59b11ef 100644 --- a/app/views/super_admins/release_notes/edit.html.haml +++ b/app/views/super_admins/release_notes/edit.html.haml @@ -1,3 +1,5 @@ += render "main_navigation", action: :edit + .fr-container.fr-my-5w .fr-grid-row.fr-grid-row--center .fr-col-lg-10 diff --git a/app/views/super_admins/release_notes/index.html.haml b/app/views/super_admins/release_notes/index.html.haml index a22e00f61e6..627e0d730f3 100644 --- a/app/views/super_admins/release_notes/index.html.haml +++ b/app/views/super_admins/release_notes/index.html.haml @@ -1,3 +1,5 @@ += render "main_navigation", action: :index + .fr-container.fr-my-5w .fr-grid-row.fr-grid-row--center .fr-col-lg-10 @@ -9,15 +11,20 @@ %thead %th Annoncé le %th Publié? + %th Notes %th Actions %tbody - - @release_notes.each do |release| + - @release_notes_groups.each do |group, releases| %tr - %td= l(release.released_on) if release.released_on + %td= l(releases.first.released_on) if releases.first.released_on %td - - if release.published? + - if releases.first.published? %span.fr-badge.fr-badge--success.fr-badge--no-icon Publié - else %span.fr-badge.fr-badge--warning.fr-badge--no-icon Brouillon %td - = link_to 'Modifier', edit_super_admins_release_note_path(group: release.group), class: 'fr-btn fr-btn--secondary' + %ul + - releases.each do |note| + %li= note.body.to_plain_text.truncate_words(10) + %td + = link_to 'Modifier', edit_super_admins_release_note_path(group: group), class: 'fr-btn fr-btn--secondary' diff --git a/app/views/super_admins/release_notes/new.html.haml b/app/views/super_admins/release_notes/new.html.haml index e5eccd5c529..88b62e9f9db 100644 --- a/app/views/super_admins/release_notes/new.html.haml +++ b/app/views/super_admins/release_notes/new.html.haml @@ -1,3 +1,5 @@ += render "main_navigation", action: :new + .fr-container.fr-my-5w .fr-grid-row.fr-grid-row--center .fr-col-lg-10