Fix comparison in api_key component

We can't control the case of either 'name' or
'thing' so the comparison should make them both
the same.
This commit is contained in:
Tom Byers
2020-08-28 13:07:38 +01:00
parent d446a91a8e
commit aff584b933

View File

@@ -1,12 +1,12 @@
{% macro api_key(key, name, thing="API key") %}
{% if name == thing %}
{% if name|lower == thing|lower %}
<h2 class="api-key__name">
{{ name }}
</h2>
{% endif %}
<div data-module="api-key" data-key="{{ key }}" data-thing="{{ thing }}" data-name="{{ name }}">
<span class="api-key__key">
{% if name != thing %}<span class="govuk-visually-hidden">{{ thing }}: </span>{% endif %}{{ key }}
{% if name|lower != thing|lower %}<span class="govuk-visually-hidden">{{ thing }}: </span>{% endif %}{{ key }}
</span>
<span class="api-key__notice" aria-live="assertive"></span>
</div>