Browse Source

CLDC-4365: Allow for two thirds notifications

CLDC-4365-reduce-size-of-soft-validation-success-box
samyou-softwire 1 week ago
parent
commit
d53f12a586
  1. 14
      app/helpers/application_helper.rb
  2. 20
      app/views/layouts/application.html.erb

14
app/helpers/application_helper.rb

@ -32,6 +32,20 @@ module ApplicationHelper
!request.path.match?(/\/notifications\/\d+$/) && (authenticated_user_has_notifications? || unauthenticated_user_has_notifications?)
end
def notification_banner
govuk_notification_banner(
title_text: "Success",
success: true, title_heading_level: 3,
title_id: "flash-notice",
role: "alert"
) do |notification_banner|
notification_banner.with_heading(text: flash.notice.html_safe)
if flash[:notification_banner_body]
tag.p flash[:notification_banner_body]&.html_safe
end
end
end
private
def paginated_title(title, pagy)

20
app/views/layouts/application.html.erb

@ -120,17 +120,15 @@
<main class="govuk-main-wrapper govuk-main-wrapper--auto-spacing" id="main-content" role="main">
<% if flash.notice && !flash.notice.include?("translation missing") %>
<%= govuk_notification_banner(
title_text: "Success",
success: true, title_heading_level: 3,
title_id: "flash-notice",
role: "alert"
) do |notification_banner|
notification_banner.with_heading(text: flash.notice.html_safe)
if flash[:notification_banner_body]
tag.p flash[:notification_banner_body]&.html_safe
end
end %>
<% if flash[:notification_banner_two_thirds] %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
<%= notification_banner %>
</div>
</div>
<% else %>
<%= notification_banner %>
<% end %>
<% end %>
<%= content_for?(:content) ? yield(:content) : yield %>
</main>

Loading…
Cancel
Save