Files
notifications-admin/app/templates/components/api-key.html
Tom Byers aff584b933 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.
2020-08-28 13:07:38 +01:00

14 lines
505 B
HTML

{% macro api_key(key, name, thing="API key") %}
{% 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|lower != thing|lower %}<span class="govuk-visually-hidden">{{ thing }}: </span>{% endif %}{{ key }}
</span>
<span class="api-key__notice" aria-live="assertive"></span>
</div>
{% endmacro %}