Skip to content

Commit

Permalink
chore(announces): main navigation across announces
Browse files Browse the repository at this point in the history
  • Loading branch information
colinux committed Oct 30, 2023
1 parent 79da969 commit a9eda07
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app/views/layouts/_header.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
13 changes: 13 additions & 0 deletions app/views/super_admins/release_notes/_main_navigation.html.haml
Original file line number Diff line number Diff line change
@@ -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" }
2 changes: 2 additions & 0 deletions app/views/super_admins/release_notes/edit.html.haml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 11 additions & 4 deletions app/views/super_admins/release_notes/index.html.haml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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'
2 changes: 2 additions & 0 deletions app/views/super_admins/release_notes/new.html.haml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit a9eda07

Please sign in to comment.