Skip to content

Commit

Permalink
Allow Crown copyright notice to be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobertlloyd authored and colinrotherham committed Jan 18, 2024
1 parent 39c0a23 commit 9c73615
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ params:
required: false
description: If `text` is set, this is not required. If `html` is provided, the `text` option will be ignored. If neither are provided, the text for the Open Government Licence is used. The content licence is inside a `<span>` element, so you can only add [phrasing content](https://html.spec.whatwg.org/#phrasing-content) to it.
- name: copyright
type: object
type: object | boolean
required: false
description: The copyright information in the footer component, this defaults to `"© Crown copyright"`.
description: Crown copyright notice that links to a page on [The National Archives](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/). Setting this to `false` removes this notice and the royal coat of arms.
params:
- name: text
type: string
Expand Down Expand Up @@ -158,6 +158,11 @@ examples:
copyright:
text: '© Hawlfraint y Goron'

- name: with copyright notice removed
description: Crown copyright notice removed
options:
copyright: false

- name: with meta
description: Secondary navigation with meta information relating to the site
options:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,16 @@
{% endif %}
</span>
</div>
{%- if params.copyright != false -%}
<div class="govuk-footer__meta-item">
<a
class="govuk-footer__link govuk-footer__copyright-logo"
href="https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/"
>
{%- if params.copyright.html or params.copyright.text -%}
{{ params.copyright.html | safe if params.copyright.html else params.copyright.text }}
{%- else -%}
© Crown copyright
{%- endif -%}
{{ (params.copyright.html | safe if params.copyright.html else params.copyright.text) | default("© Crown copyright", true) }}
</a>
</div>
{%- endif -%}
</div>
</div>
</footer>
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,13 @@ describe('footer', () => {
expect($copyrightMessage.text()).toContain('© Crown copyright')
})

it('can be removed', () => {
const $ = render('footer', examples['with copyright notice removed'])

const $copyrightMessage = $('.govuk-footer__copyright-logo')
expect($copyrightMessage.length).toBeFalsy()
})

it('can be customised with `text` parameter', () => {
const $ = render(
'footer',
Expand Down

0 comments on commit 9c73615

Please sign in to comment.