Skip to content

Commit c5e5438

Browse files
committed
Add new session header design
In this design the session header will have a darker blue background to highlight the difference between being in a session and viewing a school. Jira-Issue: MAV-2645
1 parent e82d9ae commit c5e5438

10 files changed

Lines changed: 127 additions & 105 deletions

File tree

app/views/layouts/application.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838

3939
<%= render "layouts/header" %>
4040

41+
<%= yield :before_container %>
42+
4143
<div class="nhsuk-width-container">
4244
<%= yield :before_main %>
4345

Lines changed: 112 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,120 @@
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" %>
27

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>
712

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|
2872
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),
3276
)
33-
end
34-
35-
if @session.psd_enabled?
77+
3678
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),
4082
)
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+
44114
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),
48118
)
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 %>

app/views/sessions/consent/show.html.erb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
<% content_for :before_main do %>
2-
<%= render AppBreadcrumbComponent.new(items: [
3-
{ text: t("dashboard.index.title"), href: dashboard_path },
4-
{ text: t("sessions.index.title"), href: sessions_path },
5-
{ text: @session.location.name, href: session_path(@session) },
6-
]) %>
7-
<% end %>
8-
91
<%= render "sessions/header" %>
102

113
<div class="nhsuk-grid-row">

app/views/sessions/manage_consent_reminders/show.html.erb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<% content_for :before_main do %>
2-
<%= render AppBreadcrumbComponent.new(items: [
3-
{ text: t("dashboard.index.title"), href: dashboard_path },
4-
{ text: t("sessions.index.title"), href: sessions_path },
5-
{ text: @session.location.name, href: session_path(@session) },
6-
]) %>
2+
<% unless Flipper.enabled?(:schools_and_sessions) %>
3+
<%= render AppBreadcrumbComponent.new(items: [
4+
{ text: t("dashboard.index.title"), href: dashboard_path },
5+
{ text: t("sessions.index.title"), href: sessions_path },
6+
{ text: @session.location.name, href: session_path(@session) },
7+
]) %>
8+
<% end %>
79
<% end %>
810

911
<%= h1 t(".title") %>

app/views/sessions/patient_specific_directions/show.html.erb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
<% content_for :before_main do %>
2-
<%= render AppBreadcrumbComponent.new(items: [
3-
{ text: t("dashboard.index.title"), href: dashboard_path },
4-
{ text: t("sessions.index.title"), href: sessions_path },
5-
{ text: @session.location.name, href: session_path(@session) },
6-
]) %>
7-
<% end %>
8-
91
<%= render "sessions/header" %>
102

113
<div class="nhsuk-grid-row">

app/views/sessions/patients/show.html.erb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
<% content_for :before_main do %>
2-
<%= render AppBreadcrumbComponent.new(items: [
3-
{ text: t("dashboard.index.title"), href: dashboard_path },
4-
{ text: t("sessions.index.title"), href: sessions_path },
5-
{ text: @session.location.name, href: session_path(@session) },
6-
]) %>
7-
<% end %>
8-
91
<%= render "sessions/header" %>
102

113
<div class="nhsuk-grid-row">

app/views/sessions/record/show.html.erb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
<% content_for :before_main do %>
2-
<%= render AppBreadcrumbComponent.new(items: [
3-
{ text: t("dashboard.index.title"), href: dashboard_path },
4-
{ text: t("sessions.index.title"), href: sessions_path },
5-
{ text: @session.location.name, href: session_path(@session) },
6-
]) %>
7-
<% end %>
8-
91
<%= render "sessions/header" %>
102

113
<% if @session.today? %>

app/views/sessions/register/show.html.erb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
<% content_for :before_main do %>
2-
<%= render AppBreadcrumbComponent.new(items: [
3-
{ text: t("dashboard.index.title"), href: dashboard_path },
4-
{ text: t("sessions.index.title"), href: sessions_path },
5-
{ text: @session.location.name, href: session_path(@session) },
6-
]) %>
7-
<% end %>
8-
91
<%= render "sessions/header" %>
102

113
<% if @session.today? %>

app/views/sessions/show.html.erb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<% content_for :before_main do %>
2-
<%= render AppBreadcrumbComponent.new(items: [
3-
{ text: t("dashboard.index.title"), href: dashboard_path },
4-
{ text: t("sessions.index.title"), href: sessions_path },
5-
]) %>
2+
<% unless Flipper.enabled?(:schools_and_sessions) %>
3+
<%= render AppBreadcrumbComponent.new(items: [
4+
{ text: t("dashboard.index.title"), href: dashboard_path },
5+
{ text: t("sessions.index.title"), href: sessions_path },
6+
]) %>
7+
<% end %>
68
<% end %>
79

810
<%= render "header" %>

app/views/sessions/triage/show.html.erb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
<% content_for :before_main do %>
2-
<%= render AppBreadcrumbComponent.new(items: [
3-
{ text: t("dashboard.index.title"), href: dashboard_path },
4-
{ text: t("sessions.index.title"), href: sessions_path },
5-
{ text: @session.location.name, href: session_path(@session) },
6-
]) %>
7-
<% end %>
8-
91
<%= render "sessions/header" %>
102

113
<div class="nhsuk-grid-row">

0 commit comments

Comments
 (0)