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

Release PR #2866

Merged
merged 40 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
af20b27
dont add current page to breadcrumb
davidu1975 Jan 24, 2024
e80d7c4
wip
davidu1975 Jan 24, 2024
e52852d
revert recaptcha
davidu1975 Jan 24, 2024
e3825b3
compile requirements
davidu1975 Jan 24, 2024
b67a7d5
revert formtools
davidu1975 Jan 24, 2024
ea68927
add migration
davidu1975 Jan 25, 2024
f5a671a
remove Breadcrumbs current page param
davidu1975 Jan 25, 2024
f44c32c
remove bit param
davidu1975 Jan 25, 2024
0ac6efe
fix tests and use component_tags
davidu1975 Jan 25, 2024
2666aae
wip
davidu1975 Jan 26, 2024
f4fec92
Merge branch 'develop' into feature/KLS-1882-Breadcrumbs-Update
davidu1975 Jan 26, 2024
f201c38
wip
davidu1975 Jan 26, 2024
bac83e6
wip
davidu1975 Jan 26, 2024
6437fd0
update black
davidu1975 Jan 26, 2024
217e979
black pre-commit hook
davidu1975 Jan 26, 2024
b2d0001
timings issue
davidu1975 Jan 26, 2024
110abb7
modify class great-breadcrumbs
davidu1975 Jan 28, 2024
1722978
stupid timing test
davidu1975 Jan 28, 2024
ed67a03
add important
davidu1975 Jan 29, 2024
3495b69
use mobile-size instead of tablet-size;change breadcrumbs text to Home
davidu1975 Jan 29, 2024
7706eb6
use mobile-size instead of tablet-size;change breadcrumbs text to Home
davidu1975 Jan 29, 2024
e7ab510
change great.gov.uk to Home
davidu1975 Jan 29, 2024
4feb6aa
hard coded great.gov.uk
davidu1975 Jan 29, 2024
66068ca
Merge branch 'develop' into feature/KLS-1882-Breadcrumps-Update
davidu1975 Jan 29, 2024
5125708
merged develop
davidu1975 Jan 29, 2024
4613b54
fixed conflicts
davidu1975 Jan 29, 2024
89620d2
Merge remote-tracking branch 'refs/remotes/origin/feature/KLS-1882-Br…
davidu1975 Jan 30, 2024
7b69125
resolve conflicts
davidu1975 Jan 30, 2024
deb4ff1
update black
davidu1975 Jan 30, 2024
6a87b89
update black
davidu1975 Jan 30, 2024
e4b5951
change test timings
davidu1975 Jan 30, 2024
86907be
change test timings
davidu1975 Jan 30, 2024
cda51f1
remove code not for this branch
davidu1975 Jan 30, 2024
9d9e678
Merge branch 'develop' into feature/KLS-1882-Breadcrumbs-Update
davidu1975 Jan 30, 2024
bbb5f87
Merge pull request #2858 from uktrade/feature/KLS-1882-Breadcrumbs-Up…
davidu1975 Jan 30, 2024
122a3af
missed breadcrumb change
davidu1975 Jan 30, 2024
55612f8
Merge pull request #2867 from uktrade/fix/fix-missed-breadcrumb
davidu1975 Jan 30, 2024
7e99944
KLS-1908 : Fix bug on CTA
divyaparameswaran Jan 30, 2024
3919229
KLS-1908 : Fix bug on CTA
divyaparameswaran Jan 30, 2024
5ce963d
Merge pull request #2863 from uktrade/KLS-1908
divyaparameswaran Jan 30, 2024
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ jobs:
command: |
python3 -m venv .venv
. .venv/bin/activate
pip install black==23.12.1
pip install black==24.1.0
black ./ --check

workflows:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
exclude: ^react-components/dist/
repos:
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.1.0
hooks:
- id: black
# Config for black lives in pyproject.toml
- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.11.0]
additional_dependencies: [black==24.1.0]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions contact/templates/domestic/contact/guidance.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
{% endblock %}
{% block content %}
<div class="great-bg-light-blue">
{% breadcrumbs 'Guidance' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'contact:contact-us-routing-form' step='location' %}">Contact us</a>
{% endbreadcrumbs %}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{% endblock %}
{% block content %}
{% block breadcrumbs %}
{% breadcrumbs 'Contact' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'contact:contact-us-routing-form' step='location' %}">Contact us</a>
{% endbreadcrumbs %}
{% endblock %}
Expand Down
4 changes: 2 additions & 2 deletions contact/templates/domestic/contact/office-finder.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
type="text/css" />
{% endblock %}
{% block content %}
{% breadcrumbs 'Find trade office' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'contact:contact-us-routing-form' step='location' %}">Contact us</a>
{% endbreadcrumbs %}
<div class="container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
{% endblock %}
{% block content %}
<section class="help-pages">
{% breadcrumbs 'Local export support form' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
{% endbreadcrumbs %}
<div id="request-export-support-form-content"
class="page-main-content-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{% endblock %}
{% block head_title %}E-commerce advice{{ block.super }}{% endblock %}
{% block content %}
{% breadcrumbs 'Local Export Support Success' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
{% endbreadcrumbs %}
<div class="container">
<div class="grid-row">
Expand Down
4 changes: 2 additions & 2 deletions contact/templates/domestic/contact/soo/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
type="text/css" />
{% endblock %}
{% block breadcrumbs %}
{% breadcrumbs market_name %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
{% comment %} services_urls comes from great_components.context_processors.urls_processor {% endcomment %}
<a href="{{ services_urls.soo }}">Selling Online Overseas</a>
{% endbreadcrumbs %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load breadcrumbs message_box from component_tags %}
{% breadcrumbs 'Submitted' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'contact:contact-us-routing-form' step='location' %}">Contact us</a>
{% endbreadcrumbs %}
<section>
Expand Down
4 changes: 2 additions & 2 deletions contact/templates/domestic/contact/wizard-domestic.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
{% block content %}
{% block breadcrumbs %}
{% get_contact_breadcrumb_details as dep_breadcrumbs %}
{% breadcrumbs 'Contact' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
{% if features.FEATURE_DIGITAL_POINT_OF_ENTRY %}
<a href="{{ dep_breadcrumbs.url }}">{{ dep_breadcrumbs.text }}</a>
{% else %}
Expand Down
24 changes: 24 additions & 0 deletions core/migrations/0131_alter_rendition_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 4.2.7 on 2024-01-30 09:41

import wagtail.images.models
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('core', '0130_ukeacta_detailpage_call_to_action_eventorderable'),
]

operations = [
migrations.AlterField(
model_name='rendition',
name='file',
field=wagtail.images.models.WagtailImageField(
height_field='height',
storage=wagtail.images.models.get_rendition_storage,
upload_to=wagtail.images.models.get_rendition_upload_to,
width_field='width',
),
),
]
8 changes: 4 additions & 4 deletions core/templates/components/breadcrumbs_cms.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{% load breadcrumbs from component_tags %}
{% with current_page=page.specific.get_breadcrumbs|last %}
{% if hide_breadcrumbs %}
{% breadcrumbs current_page.title %}
<a href="{{ BREADCRUMBS_ROOT_URL }}">great.gov.uk</a>
{% breadcrumbs %}
<a href="{{ BREADCRUMBS_ROOT_URL }}">Home</a>
{% endbreadcrumbs %}
{% else %}
{% breadcrumbs current_page.title %}
<a href="{{ BREADCRUMBS_ROOT_URL }}">great.gov.uk</a>
{% breadcrumbs %}
<a href="{{ BREADCRUMBS_ROOT_URL }}">Home</a>
{% for crumb in page.get_breadcrumbs %}
{% if not forloop.last %}<a href="{{ crumb.url }}">{{ crumb.title }}</a>{% endif %}
{% endfor %}
Expand Down
4 changes: 2 additions & 2 deletions core/templates/core/article.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% extends 'core/base.html' %}
{% load breadcrumbs from great_components %}
{% load breadcrumbs from component_tags %}
{% load url_map %}
{% block content %}
<div id="great-hero" class="container p-s">
<h2 class="h-m">Welcome {{ request.user.first_name|default:request.user.email }}</h2>
{% breadcrumbs article_name %}
{% breadcrumbs %}
<a href="{% url_map 'DASHBOARD_URL' %}" id="breadcrumbs-dashboard">Home</a>
<a href="https://www.example.com"
id="breadcrumbs-{{ topic_name|slugify }}">{{ topic_name }}</a>
Expand Down
2 changes: 1 addition & 1 deletion core/templates/core/personalised_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% load url_map %}
{% block content %}
<div id="great-hero" class="p-s">
{% breadcrumbs page.title %}
{% breadcrumbs %}
<a href="{% url_map 'DASHBOARD_URL' %}">Home</a>
{% endbreadcrumbs %}
</div>
Expand Down
2 changes: 1 addition & 1 deletion core/templates/microsites/includes/microsite_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
{% endif %}
<p>
Get support for UK export or investment at
<a href="/">great.gov.uk</a>
<a href="/">Home</a>
</p>
</div>
4 changes: 2 additions & 2 deletions domestic/templates/domestic/cookie-preferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{% block head_title %}Cookies on great.gov.uk{% endblock %}
{% block content %}
{% block breadcrumbs %}
{% breadcrumbs 'Cookies' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
{% endbreadcrumbs %}
{% endblock %}
<div class="container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
{% endblock %}
{% block content %}
<section>
{% breadcrumbs 'Contact Us' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'domestic:get-finance' %}">UKEF</a>
<a href="{% slugurl 'trade-finance' %}">Trade Finance</a>
{% endbreadcrumbs %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{% endblock %}
{% block head_title %}UK Export Finance - We have received your details{% endblock %}
{% block content %}
{% breadcrumbs 'Contact Us' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'domestic:get-finance' %}">UKEF</a>
<a href="{% slugurl 'trade-finance' %}">Trade Finance</a>
{% endbreadcrumbs %}
Expand Down
4 changes: 2 additions & 2 deletions domestic/templates/domestic/finance/trade_finance.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
{% image page.hero_image original as hero_image_rendition %}
<section id="get-finance-hero">
{% include 'components/hero.html' with hero_title="Trade finance for UK exporters" hero_text="When it comes to exporting, having a great product or service is only half the story. Putting the right finance and insurance in place can make the difference, helping you to win contracts, fulfil orders and get paid." image_url=hero_image_rendition.url %}
{% breadcrumbs page.breadcrumbs_label %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'domestic:get-finance' %}">UKEF</a>
{% endbreadcrumbs %}
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
{% block content %}
{% static 'images/report-a-trade-barrier-header.png' as xlarge_hero %}
{% include 'components/hero.html' with image_url=xlarge_hero hero_title='Check or report a trade barrier' %}
{% breadcrumbs 'Report a trade barrier' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'domestic:market-access' %}">Trade barriers</a>
{% endbreadcrumbs %}
<section class="great" id="report-a-trade-barrier">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
{% block sharing_metadata %}{% endblock %}
{% block content %}
<section>
{% breadcrumbs 'Report a trade barrier' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'domestic:market-access' %}">Trade barriers</a>
{% endbreadcrumbs %}
<div class="container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
{% endblock %}
{% block head_title %}Report a trade barrier{{ block.super }}{% endblock %}
{% block content %}
{% breadcrumbs 'Report a trade barrier' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'domestic:market-access' %}">Trade barriers</a>
{% endbreadcrumbs %}
<section>
Expand Down
4 changes: 2 additions & 2 deletions domestic/templates/domestic/ukef/contact_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
{% endblock %}
{% block content %}
<div class="container">
{% breadcrumbs 'Get in touch' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'domestic:get-finance' %}">UKEF</a>
<a href="{% url 'domestic:project-finance' %}">Project Finance</a>
{% endbreadcrumbs %}
Expand Down
4 changes: 2 additions & 2 deletions domestic/templates/domestic/ukef/contact_form_success.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
{% endblock %}
{% block css_layout_class %}uk-export-contact-form-success{% endblock %}
{% block content %}
{% breadcrumbs 'What happens next' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'domestic:get-finance' %}">UKEF</a>
<a href="{% url 'domestic:project-finance' %}">Project Finance</a>
<a href="{% url 'domestic:uk-export-contact' %}">Get in touch</a>
Expand Down
4 changes: 2 additions & 2 deletions domestic/templates/domestic/ukef/country_cover.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
{% block content %}
{% static 'images/UKEF-check-our-country-cover-header.png' as finance_export_hero_image %}
{% include 'components/hero.html' with image_url=finance_export_hero_image hero_title='Check our country cover' hero_text='Information on our market risk appetite and the countries we cover.' %}
{% breadcrumbs 'Check our country cover' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'domestic:get-finance' %}">UKEF</a>
<a href="{% url 'domestic:project-finance' %}">Project Finance</a>
{% endbreadcrumbs %}
Expand Down
2 changes: 1 addition & 1 deletion domestic/templates/domestic/ukef/home_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% block content %}
{% static 'images/UKEF-Home-header.png' as hero_xlarge %}
{% include 'components/hero.html' with image_url=hero_xlarge hero_title='UK Export Finance' hero_text='Get the right finance and insurance in place to help you win contracts, fulfil orders and get paid' %}
{% breadcrumbs 'UKEF' %}<a href="/">great.gov.uk</a>{% endbreadcrumbs %}
{% breadcrumbs %}<a href="/">Home</a>{% endbreadcrumbs %}
<section id="list-teaser-section"
class="list-teaser-section padding-top-30 padding-bottom-60">
<div class="container">
Expand Down
4 changes: 2 additions & 2 deletions domestic/templates/domestic/ukef/how_we_assess.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
article-detail-page ukef-article-detail-page
{% endblock css_layout_class %}
{% block content %}
{% breadcrumbs 'How we assess your project' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'domestic:get-finance' %}">UKEF</a>
<a href="{% url 'domestic:project-finance' %}">Project Finance</a>
{% endbreadcrumbs %}
Expand Down
4 changes: 2 additions & 2 deletions domestic/templates/domestic/ukef/project_finance.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
{% block content %}
{% static 'images/UKEF-finance-for-international-projects-header.png' as project_finance_hero_image %}
{% include 'components/hero.html' with image_url=project_finance_hero_image hero_title='The UK’s export credit agency' hero_text='Find the support available to buyers of your goods and service exports' %}
{% breadcrumbs 'Project Finance' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'domestic:get-finance' %}">UKEF</a>
{% endbreadcrumbs %}
<section id="teaser-section" class="teaser-section padding-vertical-60">
Expand Down
4 changes: 2 additions & 2 deletions domestic/templates/domestic/ukef/what_we_offer.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
article-detail-page ukef-article-detail-page
{% endblock css_layout_class %}
{% block content %}
{% breadcrumbs 'What we offer you' %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% url 'domestic:get-finance' %}">UKEF</a>
<a href="{% url 'domestic:project-finance' %}">Project Finance</a>
{% endbreadcrumbs %}
Expand Down
14 changes: 3 additions & 11 deletions domestic/templatetags/component_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
def breadcrumbs(parser, token):
nodelist = parser.parse(('endbreadcrumbs',))
parser.delete_first_token()
try:
bit = token.split_contents()[1]
except IndexError:
raise ValueError('Please specify the label of the current page')
return Breadcrumbs(nodelist, bit)
return Breadcrumbs(nodelist)


class Breadcrumbs(template.Node):
Expand All @@ -28,13 +24,12 @@ class Breadcrumbs(template.Node):
</nav>
"""

def __init__(self, nodelist, bit):
def __init__(self, nodelist):
self.nodelist = nodelist
self.bit = bit

def render(self, context):
try:
class_style = self.token.split_contents()[2]
class_style = self.token.split_contents()[1]
except IndexError:
class_style = 'breadcrumbs'
html = self.nodelist.render(context)
Expand All @@ -51,9 +46,6 @@ def render(self, context):
element.append(link)
output_soup.find('ol').append(element)

# adding the current page
current = template.Variable(self.bit).resolve(context)
output_soup.find('ol').append(f'<li aria-current="page"><span>{current}</span></li>')
return output_soup.decode(formatter=None)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</div>
{% endwith %}
{% endblock %}
{% breadcrumbs current_page_breadcrumb %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="{% pageurl landing_page %}">UK Export Academy</a>
{% endbreadcrumbs %}
<div class="great">
Expand Down
4 changes: 2 additions & 2 deletions export_academy/templates/export_academy/course_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
{% block head_title %}{{ page.title }} – UK Export Academy – great.gov.uk{% endblock %}
{% block breadcrumbs_block %}
<div id="breadcrumbs" class="great-bg-light-blue">
{% breadcrumbs page.page_heading %}
<a href="/">great.gov.uk</a>
{% breadcrumbs %}
<a href="/">Home</a>
<a href="../">UK Export Academy</a>
{% endbreadcrumbs %}
</div>
Expand Down
Loading
Loading