Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRTLV-332 replace notification banner with Design System notification banner component #3709

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@
/ 'dist'
/ 'components'
/ 'notification-banner',
ROOT_DIR
/ 'node_modules'
/ '@uktrade'
/ 'great-design-system'
/ 'dist'
/ 'components'
/ 'notification-banner',
],
'APP_DIRS': True,
'OPTIONS': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,7 @@
<p class="govuk-body govuk-!-margin-top-4">{{ step_text }}</p>
{% block content_top %}{% endblock %}
{% if confirmation %}
<div class="govuk-notification-banner govuk-notification-banner--success">
<div class="govuk-notification-banner__header">
<h2 class="govuk-heading-xl govuk-notification-banner__title">{{ heading_text }}</h2>
</div>
<div class="govuk-notification-banner__content">
<p class="govuk-body govuk-notification-banner__heading">{{ strapline_text }}</p>
</div>
</div>
{% include '_notification-banner.html' with type='success' titleText=heading_text text=strapline_text %}
{% else %}
<h1 class="govuk-heading-xl govuk-!-margin-bottom-6">{{ heading_text }}</h1>
<p class="govuk-body govuk-!-margin-bottom-7">
Expand Down
73 changes: 19 additions & 54 deletions export_academy/templates/export_academy/booking_success.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,66 +19,31 @@
</div>
{% endwith %}
{% endblock %}
<div class="great">
<section class="govuk-!-padding-top-3 govuk-!-padding-bottom-3 background-white clearfix">
<div class="container">
<div class="govuk-grid-column-two-thirds">
<div class="govuk-notification-banner govuk-notification-banner--success govuk-!-margin-top-7"
role="alert"
aria-labelledby="govuk-notification-banner-title"
data-module="govuk-notification-banner">
<div class="govuk-notification-banner__header">
<h2 class="great-text-white">{{ heading }} confirmed</h2>
</div>
<div class="govuk-notification-banner__content">
{% if editing_registration %}
<p class="great-font-size-desktop-24 padding-top-30-l padding-bottom-30-l">
Your registration details have been successfully updated.
</p>
{% else %}
<p class="great-font-size-desktop-24">Event details:</p>
<div class="informative-banner govuk-!-margin-bottom-4">
<p class="great-font-size-desktop-24 govuk-!-font-weight-bold">{{ event.name }}</p>
<br>
<p class="great-font-size-desktop-24">
On {{ event.start_date|date:"D, j M" }} at {{ event.start_date|date:"g:iA"|lower }}
</p>
</div>
<span class="great-break-word">
<p class="great-font-size-mobile-18 govuk-!-margin-right-7">
We've emailed a
{% if booking.status == 'Confirmed' %}
booking
{% else %}
cancellation
{% endif %}
confirmation to {{ booking.registration.email }}
</p>
</span>
{% if booking.status == 'Confirmed' %}
{% event_list_buttons event %}
{% endif %}
{% endif %}
</div>
<div class="great">
<section class="govuk-!-padding-top-3 govuk-!-padding-bottom-3 background-white clearfix">
<div class="container">
<div class="govuk-grid-column-two-thirds">
{% include '_notification-banner.html' with type='success' titleText=heading|add:' confirmed' html=notification_html %}
{% if just_registered %}
<h4 class="govuk-!-margin-bottom-3">What happens next</h4>
<p class="great-font-size-mobile-18">
You are now able to book a place on any of our Export Academy events,
watch recordings of past events you’ve booked and cancel any events you can no longer attend.
</p>
{% endif %}
<a href="{{ return_url }}"
class="link block margin-top-30 margin-bottom-60">{{ return_msg }}</a>
</div>
{% if just_registered %}
<h4 class="govuk-!-margin-bottom-3">What happens next</h4>
<p class="great-font-size-mobile-18">
You are now able to book a place on any of our Export Academy events,
watch recordings of past events you’ve booked and cancel any events you can no longer attend.
</p>
{% endif %}
<a href="{{ return_url }}"
class="link block margin-top-30 margin-bottom-60">{{ return_msg }}</a>
</div>
</div>
</section>
</section>
<div class="great-border-thin-top-lighter-blue">
<section class="govuk-!-padding-bottom-6 background-white clearfix">
<div class="container">{% include 'core/includes/hcsat.html' with hcsat_form=hcsat_form hcsat_stage=hcsat_form_stage%}</div>
<div class="container">
{% include 'core/includes/hcsat.html' with hcsat_form=hcsat_form hcsat_stage=hcsat_form_stage %}
</div>
</section>
</div>
</div>
</div>
{% endblock content %}
{% block feedback_reporter %}
{% endblock feedback_reporter %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{% load event_list_buttons %}
{% if editing_registration %}
<p class="great-font-size-desktop-24 padding-top-30-l padding-bottom-30-l">
Your registration details have been successfully updated.
</p>
{% else %}
<p class="great-font-size-desktop-24">Event details:</p>
<div class="informative-banner govuk-!-margin-bottom-4">
<p class="great-font-size-desktop-24 govuk-!-font-weight-bold">{{ event.name }}</p>
<br>
<p class="great-font-size-desktop-24">
On {{ event.start_date|date:"D, j M" }} at {{ event.start_date|date:"g:iA"|lower }}
</p>
</div>
<span class="great-break-word">
<p class="great-font-size-mobile-18 govuk-!-margin-right-7">
We've emailed a
{% if booking.status == 'Confirmed' %}
booking
{% else %}
cancellation
{% endif %}
confirmation to {{ booking.registration.email }}
</p>
</span>
{% if booking.status == 'Confirmed' %}
{% event_list_buttons event %}
{% endif %}
{% endif %}
12 changes: 12 additions & 0 deletions export_academy/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
JsonResponse,
)
from django.shortcuts import get_list_or_404, get_object_or_404, redirect
from django.template.loader import render_to_string
from django.urls import reverse, reverse_lazy
from django.utils.decorators import method_decorator
from django.utils.text import get_valid_filename
Expand Down Expand Up @@ -217,6 +218,17 @@ def get_context_data(self, **kwargs):
if 'form' in kwargs: # pass back errors from form_invalid
ctx['hcsat_form'] = kwargs['form']

# Create notification context with all required variables
notification_context = {
'editing_registration': ctx.get('editing_registration'),
'event': ctx.get('event'),
'booking': ctx.get('booking'),
'heading_text': ctx.get('heading'),
'text': render_to_string('export_academy/includes/booking_success_content.html', ctx, request=self.request),
}

ctx.update(notification_context) # Update the context directly

return ctx

def post(self, request, *args, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,7 @@
{% if request.GET.signup %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<div class="govuk-notification-banner govuk-notification-banner--success"
role="alert"
aria-labelledby="govuk-notification-banner-title"
data-module="govuk-notification-banner">
<div class="govuk-notification-banner__header">
<h2 class="govuk-notification-banner__title"
id="govuk-notification-banner-title">Success</h2>
</div>
<div class="govuk-notification-banner__content">
<h3 class="govuk-notification-banner__heading">Your email address has been confirmed</h3>
<p class="govuk-body">Keep your details safe in case you need to sign back in.</p>
</div>
</div>
{% include '_notification-banner.html' with type='success' titleText='Success' html='<h3 class="govuk-notification-banner__heading">Your email address has been confirmed</h3><p class="govuk-body">Keep your details safe in case you need to sign back in.</p>' %}
</div>
</div>
{% endif %}
Expand Down
14 changes: 1 addition & 13 deletions international_online_offer/templates/eyb/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,7 @@
<div class="great-container">
<div class="govuk-grid-row">
<div class="govuk-grid-column-full govuk-grid-column-two-thirds-from-desktop">
<div class="govuk-notification-banner govuk-notification-banner--success govuk-!-width"
role="alert"
aria-labelledby="govuk-notification-banner-title"
data-module="govuk-notification-banner">
<div class="govuk-notification-banner__header">
<h2 class="govuk-notification-banner__title"
id="govuk-notification-banner-title">Success</h2>
</div>
<div class="govuk-notification-banner__content">
<h3 class="govuk-notification-banner__heading">You've signed back in</h3>
<p class="govuk-body">Continue telling us about your business.</p>
</div>
</div>
{% include '_notification-banner.html' with type='success' titleText='Success' html='<h3 class="govuk-notification-banner__heading">You\'ve signed back in</h3><p class="govuk-body">Continue telling us about your business.</p>' %}
</div>
</div>
</div>
Expand Down
28 changes: 9 additions & 19 deletions international_online_offer/templates/eyb/guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,16 @@
{% block content %}
<div class="great-container">
{% if request.GET.signup %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-full govuk-grid-column-two-thirds-from-desktop">
<div class="govuk-notification-banner govuk-notification-banner--success"
role="alert"
aria-labelledby="govuk-notification-banner-title"
data-module="govuk-notification-banner">
<div class="govuk-notification-banner__header">
<h2 class="govuk-notification-banner__title"
id="govuk-notification-banner-title">Success</h2>
</div>
<div class="govuk-notification-banner__content">
<h3 class="govuk-notification-banner__heading">Here's your guide to expanding your business in the UK</h3>
<p class="govuk-body">
We've created your guide from everything you've told us about your business in our <strong>{{ triage_data.sector|get_sector_display }}</strong> sector. If anything changes, you can <a class="govuk-notification-banner__link"
href="{% url 'international_online_offer:change-your-answers' %}">update your details</a>
</p>
</div>
</div>
</div>
<div class="govuk-grid-row">
<div class="govuk-grid-column-full govuk-grid-column-two-thirds-from-desktop">
{% with notification_content=triage_data.sector|get_sector_display %}
{% url 'international_online_offer:change-your-answers' as change_url %}
{% with banner_html='<h3 class="govuk-notification-banner__heading">Here\'s your guide to expanding your business in the UK</h3><p class="govuk-body">We\'ve created your guide from everything you\'ve told us about your business in our <strong>'|add:notification_content|add:'</strong> sector. If anything changes, you can <a class="govuk-notification-banner__link" href="'|add:change_url|add:'">update your details</a></p>' %}
{% include '_notification-banner.html' with type='success' titleText='Success' html=banner_html %}
{% endwith %}
{% endwith %}
</div>
</div>
{% endif %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
Expand Down

This file was deleted.

Loading