diff --git a/internal/templatefn/fn.go b/internal/templatefn/fn.go
index 87659e4a70..2b15f31ddf 100644
--- a/internal/templatefn/fn.go
+++ b/internal/templatefn/fn.go
@@ -391,14 +391,16 @@ type notificationBannerData struct {
App page.AppData
Title string
Content template.HTML
+ Heading bool
Success bool
}
-func notificationBanner(app page.AppData, title string, content template.HTML, success bool) notificationBannerData {
+func notificationBanner(app page.AppData, title string, content template.HTML, options ...string) notificationBannerData {
return notificationBannerData{
App: app,
Title: title,
Content: content,
- Success: success,
+ Heading: slices.Contains(options, "heading"),
+ Success: slices.Contains(options, "success"),
}
}
diff --git a/internal/templatefn/fn_test.go b/internal/templatefn/fn_test.go
index f5a3e73131..16f957cc82 100644
--- a/internal/templatefn/fn_test.go
+++ b/internal/templatefn/fn_test.go
@@ -452,5 +452,12 @@ func TestNotificationBanner(t *testing.T) {
Title: "title",
Content: "content",
Success: true,
- }, notificationBanner(app, "title", "content", true))
+ Heading: true,
+ }, notificationBanner(app, "title", "content", "heading", "success"))
+
+ assert.Equal(t, notificationBannerData{
+ App: app,
+ Title: "title",
+ Content: "content",
+ }, notificationBanner(app, "title", "content"))
}
diff --git a/web/template/attorney/code_of_conduct.gohtml b/web/template/attorney/code_of_conduct.gohtml
index 080044b31c..c6bdf770d5 100644
--- a/web/template/attorney/code_of_conduct.gohtml
+++ b/web/template/attorney/code_of_conduct.gohtml
@@ -7,31 +7,23 @@
{{ define "main" }}
-
-
-
-
- {{ if .App.IsReplacementAttorney }}
- {{ if .App.IsTrustCorporation }}
- {{ tr .App "weHaveIdentifiedTheTrustCorporationsReplacementAttorneyReferenceNumber" }}
- {{ else }}
- {{ tr .App "weHaveIdentifiedYourReplacementAttorneyReferenceNumber" }}
- {{ end }}
- {{ else }}
- {{ if .App.IsTrustCorporation }}
- {{ tr .App "weHaveIdentifiedTheTrustCorporationsAttorneyReferenceNumber" }}
- {{ else }}
- {{ tr .App "weHaveIdentifiedYourAttorneyReferenceNumber" }}
- {{ end }}
- {{ end }}
-
-
-
+ {{ $notificationContent := "" }}
+ {{ if .App.IsReplacementAttorney }}
+ {{ if .App.IsTrustCorporation }}
+ {{ $notificationContent = "weHaveIdentifiedTheTrustCorporationsReplacementAttorneyReferenceNumber" }}
+ {{ else }}
+ {{ $notificationContent = "weHaveIdentifiedYourReplacementAttorneyReferenceNumber" }}
+ {{ end }}
+ {{ else }}
+ {{ if .App.IsTrustCorporation }}
+ {{ $notificationContent = "weHaveIdentifiedTheTrustCorporationsAttorneyReferenceNumber" }}
+ {{ else }}
+ {{ $notificationContent = "weHaveIdentifiedYourAttorneyReferenceNumber" }}
+ {{ end }}
+ {{ end }}
+ {{ template "notification-banner" (notificationBanner .App "success" (trHtml .App $notificationContent) "success" "heading") }}
+
{{ tr .App "actingAsAttorney" }}
{{ $content := "" }}
diff --git a/web/template/certificateprovider/who_is_eligible.gohtml b/web/template/certificateprovider/who_is_eligible.gohtml
index 65626668b8..2e1a3dca33 100644
--- a/web/template/certificateprovider/who_is_eligible.gohtml
+++ b/web/template/certificateprovider/who_is_eligible.gohtml
@@ -5,20 +5,7 @@
{{ define "main" }}
-
-
-
-
- {{ tr .App "weHaveIdentifiedYourCertificateProviderReferenceNumber" }}
-
-
-
+ {{ template "notification-banner" (notificationBanner .App "success" (trHtml .App "weHaveIdentifiedYourCertificateProviderReferenceNumber") "success" "heading") }}
{{ tr .App "whoIsEligibleToBeCertificateProvider" }}
diff --git a/web/template/donor/lpa_details_saved.gohtml b/web/template/donor/lpa_details_saved.gohtml
index f2d4b0b7b8..14364b9071 100644
--- a/web/template/donor/lpa_details_saved.gohtml
+++ b/web/template/donor/lpa_details_saved.gohtml
@@ -5,33 +5,22 @@
{{ define "main" }}
+ {{ $notificationContent := "" }}
+ {{ if .IsFirstCheck }}
+ {{ if .Donor.CertificateProvider.CarryOutBy.IsPaper }}
+ {{ $notificationContent = "lpaDetailsSavedContentOnFirstSubmissionCPCarryingOutRolePaper" }}
+ {{ else }}
+ {{ $notificationContent = "lpaDetailsSavedContentOnFirstSubmissionCPCarryingOutRoleOnline" }}
+ {{ end }}
+ {{ else }}
+ {{ if .Donor.CertificateProvider.CarryOutBy.IsPaper }}
+ {{ $notificationContent = "lpaDetailsSavedContentOnSubsequentSubmissionCPCarryingOutRolePaper" }}
+ {{ else }}
+ {{ $notificationContent = "lpaDetailsSavedContentOnSubsequentSubmissionCPCarryingOutRoleOnline" }}
+ {{ end }}
+ {{ end }}
-
-
-
-
- {{ if .IsFirstCheck }}
- {{ if .Donor.CertificateProvider.CarryOutBy.IsPaper }}
- {{ trFormat .App "lpaDetailsSavedContentOnFirstSubmissionCPCarryingOutRolePaper" "CertificateProviderFullName" .Donor.CertificateProvider.FullName }}
- {{ else }}
- {{ trFormat .App "lpaDetailsSavedContentOnFirstSubmissionCPCarryingOutRoleOnline" "CertificateProviderFullName" .Donor.CertificateProvider.FullName }}
- {{ end }}
- {{ else }}
- {{ if .Donor.CertificateProvider.CarryOutBy.IsPaper }}
- {{ trFormat .App "lpaDetailsSavedContentOnSubsequentSubmissionCPCarryingOutRolePaper" "CertificateProviderFullName" .Donor.CertificateProvider.FullName }}
- {{ else }}
- {{ trFormat .App "lpaDetailsSavedContentOnSubsequentSubmissionCPCarryingOutRoleOnline" "CertificateProviderFullName" .Donor.CertificateProvider.FullName }}
- {{ end }}
- {{ end }}
-
-
-
+ {{ template "notification-banner" (notificationBanner .App "lpaDetailsSaved" (trFormatHtml .App $notificationContent "CertificateProviderFullName" .Donor.CertificateProvider.FullName) "success") }}
{{ if .Donor.Tasks.PayForLpa.IsCompleted }}