|
1 | 1 | <% content_for :page_title, @patient.initials %> |
2 | 2 |
|
3 | | -<% content_for :navigation do %> |
4 | | - <%= render AppBreadcrumbComponent.new(items: [ |
5 | | - { text: "Home", href: dashboard_path }, |
6 | | - { text: t("sessions.index.title"), href: sessions_path }, |
7 | | - { text: @session.location.name, href: session_path(@session) }, |
8 | | - @breadcrumb_item, |
9 | | - ].compact) %> |
10 | | -<% end %> |
11 | | - |
12 | 3 | <% if (outstanding_programmes = patient_outstanding_programmes(@patient, session: @session)).any? %> |
13 | 4 | <% programmes_can_record_vaccination = outstanding_programmes.filter do |programme| |
14 | 5 | policy(VaccinationRecord.new(patient: @patient, session: @session, programme:)).new? |
15 | 6 | end %> |
16 | 7 |
|
17 | | - <%= govuk_notification_banner(title_text: "Important") do |notification_banner| %> |
18 | | - <% notification_banner.with_heading(text: "You still need to record an outcome for #{programmes_can_record_vaccination.map(&:name).to_sentence}.") %> |
19 | | - <% end %> |
20 | | -<% end %> |
21 | | - |
22 | | -<h1 class="nhsuk-heading-l nhsuk-u-margin-bottom-2"> |
23 | | - <%= @patient.full_name %> |
24 | | -</h1> |
25 | | - |
26 | | -<p class="nhsuk-caption-l nhsuk-u-margin-bottom-4"> |
27 | | - <%= patient_year_group(@patient, academic_year: @academic_year) %> |
28 | | -</p> |
29 | | - |
30 | | -<%= render AppActionListComponent.new do |action_list| %> |
31 | | - <% if @programme && @session.psd_enabled? %> |
32 | | - <% action_list.with_item do %> |
33 | | - <% if @patient.has_patient_specific_direction?(academic_year: @academic_year, programme_type: @programme.type, team: current_team) %> |
34 | | - <%= render AppStatusTagComponent.new(:added, context: :patient_specific_direction) %> |
35 | | - <% else %> |
36 | | - <%= render AppStatusTagComponent.new(:not_added, context: :patient_specific_direction) %> |
37 | | - <% end %> |
38 | | - <% end %> |
39 | | - <% end %> |
40 | | - |
41 | | - <% if @session.requires_registration? && (date = @session.dates.find(&:today?)) %> |
42 | | - <% attendance_record = @patient.attendance_records.find_or_initialize_by(location: @session.location, date:) %> |
43 | | - |
44 | | - <% action_list.with_item do %> |
45 | | - <%= render AppStatusTagComponent.new(@patient.registration_status(session: @session)&.status || "unknown", context: :registration) %> |
46 | | - <% end %> |
47 | | - |
48 | | - <% attendance_record.session = @session %> |
49 | | - <% if policy(attendance_record).edit? %> |
50 | | - <% action_list.with_item( |
51 | | - text: "Update attendance", |
52 | | - href: edit_session_patient_attendance_path(@session, @patient), |
53 | | - ) %> |
| 8 | + <% content_for :before_content do %> |
| 9 | + <%= govuk_notification_banner(title_text: "Important") do |notification_banner| %> |
| 10 | + <% notification_banner.with_heading(text: "You still need to record an outcome for #{programmes_can_record_vaccination.map(&:name).to_sentence}.") %> |
54 | 11 | <% end %> |
55 | 12 | <% end %> |
56 | 13 | <% end %> |
57 | 14 |
|
58 | | -<%= render AppStickyNavigationComponent.new do %> |
59 | | - <%= render AppSecondaryNavigationComponent.new do |nav| |
60 | | - @session.programmes_for(patient: @patient).each do |programme| |
61 | | - nav.with_item( |
62 | | - href: session_patient_programme_path(@session, @patient, programme, return_to: params[:return_to]), |
63 | | - text: programme.name, |
64 | | - selected: @programme == programme, |
65 | | - ticked: @patient.programme_status(programme, academic_year: @academic_year).vaccinated?, |
66 | | - ) |
67 | | - end |
68 | | - |
69 | | - nav.with_item( |
70 | | - href: session_patient_activity_path(@session, @patient, return_to: params[:return_to]), |
71 | | - text: "Session activity and notes", |
72 | | - selected: request.path.ends_with?("/activity"), |
73 | | - ) |
74 | | - end %> |
| 15 | +<% content_for :main_content do %> |
| 16 | + <div class="app-session-banner" data-module="app-sticky"> |
| 17 | + <div class="nhsuk-width-container"> |
| 18 | + <%= render AppBreadcrumbComponent.new(items: [ |
| 19 | + { text: session_title(@session, include_dates: false), href: session_path(@session) }, |
| 20 | + @breadcrumb_item, |
| 21 | + ].compact, reverse: true) %> |
| 22 | + |
| 23 | + <div class="nhsuk-main-wrapper app-main-wrapper--xs"> |
| 24 | + <%= h1 @patient.full_name %> |
| 25 | + </div> |
| 26 | + |
| 27 | + <%= render AppSecondaryNavigationComponent.new(reverse: true) do |nav| |
| 28 | + @session.programmes_for(patient: @patient).each do |programme| |
| 29 | + nav.with_item( |
| 30 | + href: session_patient_programme_path(@session, @patient, programme, return_to: params[:return_to]), |
| 31 | + text: programme.name, |
| 32 | + selected: @programme == programme, |
| 33 | + ticked: @patient.programme_status(programme, academic_year: @academic_year).vaccinated?, |
| 34 | + ) |
| 35 | + end |
| 36 | + |
| 37 | + nav.with_item( |
| 38 | + href: session_patient_activity_path(@session, @patient, return_to: params[:return_to]), |
| 39 | + text: "Session activity and notes", |
| 40 | + selected: request.path.ends_with?("/activity"), |
| 41 | + ) |
| 42 | + end %> |
| 43 | + </div> |
| 44 | + </div> |
75 | 45 | <% end %> |
0 commit comments