|
1 | | -<%= h1 @session.location.name, class: "nhsuk-u-margin-bottom-2" %> |
| 1 | +<% content_for :before_container do %> |
| 2 | + <% if Flipper.enabled?(:schools_and_sessions) %> |
| 3 | + <div class="app-session-banner"> |
| 4 | + <div class="nhsuk-width-container"> |
| 5 | + <div class="nhsuk-main-wrapper nhsuk-main-wrapper--s"> |
| 6 | + <%= h1 session_title(@session), class: "nhsuk-u-margin-bottom-2" %> |
2 | 7 |
|
3 | | -<p class="nhsuk-caption-l nhsuk-u-margin-bottom-4"> |
4 | | - <%= @session.programmes.map(&:name).to_sentence %> |
5 | | - (<%= format_academic_year(@session.academic_year) %>) |
6 | | -</p> |
| 8 | + <p class="nhsuk-caption-l nhsuk-u-margin-bottom-0"> |
| 9 | + <%= format_year_groups(@session.year_groups) %> |
| 10 | + </p> |
| 11 | + </div> |
7 | 12 |
|
8 | | -<%= render AppSecondaryNavigationComponent.new do |nav| |
9 | | - nav.with_item( |
10 | | - href: session_path(@session), |
11 | | - text: t("sessions.tabs.overview"), |
12 | | - selected: request.path == session_path(@session), |
13 | | - ) |
14 | | - |
15 | | - nav.with_item( |
16 | | - href: session_patients_path(@session), |
17 | | - text: t("sessions.tabs.patients"), |
18 | | - selected: request.path == session_patients_path(@session), |
19 | | - ) |
20 | | - |
21 | | - unless Flipper.enabled?(:programme_status, current_team) |
22 | | - nav.with_item( |
23 | | - href: session_consent_path(@session), |
24 | | - text: t("sessions.tabs.consent"), |
25 | | - selected: request.path == session_consent_path(@session), |
26 | | - ) |
27 | | - |
| 13 | + <%= render AppSecondaryNavigationComponent.new(reverse: true) do |nav| |
| 14 | + nav.with_item( |
| 15 | + href: session_path(@session), |
| 16 | + text: t("sessions.tabs.overview"), |
| 17 | + selected: request.path == session_path(@session), |
| 18 | + ) |
| 19 | + |
| 20 | + nav.with_item( |
| 21 | + href: session_patients_path(@session), |
| 22 | + text: t("sessions.tabs.patients"), |
| 23 | + selected: request.path == session_patients_path(@session), |
| 24 | + ) |
| 25 | + |
| 26 | + if @session.psd_enabled? |
| 27 | + nav.with_item( |
| 28 | + href: session_patient_specific_directions_path(@session), |
| 29 | + text: t("sessions.tabs.patient_specific_directions"), |
| 30 | + selected: request.path == session_patient_specific_directions_path(@session), |
| 31 | + ) |
| 32 | + end |
| 33 | + |
| 34 | + if @session.requires_registration? |
| 35 | + nav.with_item( |
| 36 | + href: session_register_path(@session), |
| 37 | + text: t("sessions.tabs.register"), |
| 38 | + selected: request.path == session_register_path(@session), |
| 39 | + ) |
| 40 | + end |
| 41 | + |
| 42 | + nav.with_item( |
| 43 | + href: session_record_path(@session), |
| 44 | + text: t("sessions.tabs.record"), |
| 45 | + selected: request.path == session_record_path(@session), |
| 46 | + ) |
| 47 | + end %> |
| 48 | + </div> |
| 49 | + </div> |
| 50 | + <% end %> |
| 51 | +<% end %> |
| 52 | + |
| 53 | +<% content_for :before_main do %> |
| 54 | + <% unless Flipper.enabled?(:schools_and_sessions) %> |
| 55 | + <%= render AppBreadcrumbComponent.new(items: [ |
| 56 | + { text: t("dashboard.index.title"), href: dashboard_path }, |
| 57 | + { text: t("sessions.index.title"), href: sessions_path }, |
| 58 | + { text: @session.location.name, href: session_path(@session) }, |
| 59 | + ]) %> |
| 60 | + <% end %> |
| 61 | +<% end %> |
| 62 | + |
| 63 | +<% unless Flipper.enabled?(:schools_and_sessions) %> |
| 64 | + <%= h1 @session.location.name, class: "nhsuk-u-margin-bottom-2" %> |
| 65 | + |
| 66 | + <p class="nhsuk-caption-l nhsuk-u-margin-bottom-4"> |
| 67 | + <%= @session.programmes.map(&:name).to_sentence %> |
| 68 | + (<%= format_academic_year(@session.academic_year) %>) |
| 69 | + </p> |
| 70 | + |
| 71 | + <%= render AppSecondaryNavigationComponent.new do |nav| |
28 | 72 | nav.with_item( |
29 | | - href: session_triage_path(@session), |
30 | | - text: t("sessions.tabs.triage"), |
31 | | - selected: request.path == session_triage_path(@session), |
| 73 | + href: session_path(@session), |
| 74 | + text: t("sessions.tabs.overview"), |
| 75 | + selected: request.path == session_path(@session), |
32 | 76 | ) |
33 | | - end |
34 | | - |
35 | | - if @session.psd_enabled? |
| 77 | + |
36 | 78 | nav.with_item( |
37 | | - href: session_patient_specific_directions_path(@session), |
38 | | - text: t("sessions.tabs.patient_specific_directions"), |
39 | | - selected: request.path == session_patient_specific_directions_path(@session), |
| 79 | + href: session_patients_path(@session), |
| 80 | + text: t("sessions.tabs.patients"), |
| 81 | + selected: request.path == session_patients_path(@session), |
40 | 82 | ) |
41 | | - end |
42 | | - |
43 | | - if @session.requires_registration? |
| 83 | + |
| 84 | + unless Flipper.enabled?(:programme_status, current_team) |
| 85 | + nav.with_item( |
| 86 | + href: session_consent_path(@session), |
| 87 | + text: t("sessions.tabs.consent"), |
| 88 | + selected: request.path == session_consent_path(@session), |
| 89 | + ) |
| 90 | + |
| 91 | + nav.with_item( |
| 92 | + href: session_triage_path(@session), |
| 93 | + text: t("sessions.tabs.triage"), |
| 94 | + selected: request.path == session_triage_path(@session), |
| 95 | + ) |
| 96 | + end |
| 97 | + |
| 98 | + if @session.psd_enabled? |
| 99 | + nav.with_item( |
| 100 | + href: session_patient_specific_directions_path(@session), |
| 101 | + text: t("sessions.tabs.patient_specific_directions"), |
| 102 | + selected: request.path == session_patient_specific_directions_path(@session), |
| 103 | + ) |
| 104 | + end |
| 105 | + |
| 106 | + if @session.requires_registration? |
| 107 | + nav.with_item( |
| 108 | + href: session_register_path(@session), |
| 109 | + text: t("sessions.tabs.register"), |
| 110 | + selected: request.path == session_register_path(@session), |
| 111 | + ) |
| 112 | + end |
| 113 | + |
44 | 114 | nav.with_item( |
45 | | - href: session_register_path(@session), |
46 | | - text: t("sessions.tabs.register"), |
47 | | - selected: request.path == session_register_path(@session), |
| 115 | + href: session_record_path(@session), |
| 116 | + text: t("sessions.tabs.record"), |
| 117 | + selected: request.path == session_record_path(@session), |
48 | 118 | ) |
49 | | - end |
50 | | - |
51 | | - nav.with_item( |
52 | | - href: session_record_path(@session), |
53 | | - text: t("sessions.tabs.record"), |
54 | | - selected: request.path == session_record_path(@session), |
55 | | - ) |
56 | | - end %> |
| 119 | + end %> |
| 120 | +<% end %> |
0 commit comments