From 49d120805621c6775a4de59f58ce40de85226517 Mon Sep 17 00:00:00 2001
From: Leo Hemsted
Date: Thu, 2 Sep 2021 15:49:29 +0100
Subject: [PATCH] remove name from copy-to-clipboard invocations
name is designed for a human readable description of what the thing
you're copying belongs to. (while thing is supposed to describe what the
value represents.
For example on the reply-to email address page, thing="ID" because
you're copying a uuid, and name is the actual name of the email address.
So the talkback speech will read out "copy ID to clipboard for
my@email.com, button".
However, in our case, there's no need to add what the context is for
since each copyable item on the page is something different (a sort
code, a VAT number, etc).
Removing the name makes the talkback just read "Copy sort code to
clipboard", which is what we want. However the macro also only shows a
header if the name is present, so we have to add the header manually.
---
.../views/pricing/billing-details.html | 21 ++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/app/templates/views/pricing/billing-details.html b/app/templates/views/pricing/billing-details.html
index 63f8d693c..9482458d2 100644
--- a/app/templates/views/pricing/billing-details.html
+++ b/app/templates/views/pricing/billing-details.html
@@ -53,7 +53,6 @@
{{ copy_to_clipboard(
'GB 88 88 010 80',
- name=None,
thing='
VAT number',
) }}
@@ -79,34 +78,46 @@
Cabinet Office
+
+ Account number
+
+
{{ copy_to_clipboard(
billing_details['account_number'],
- name='Account number',
thing='account number',
) }}
+
+ Sort code
+
+
{{ copy_to_clipboard(
billing_details['sort_code'],
- name='Sort code',
thing='sort code',
) }}
+
+
+ IBAN
+
{{ copy_to_clipboard(
billing_details['IBAN'],
- name='IBAN',
thing='IBAN',
) }}
+
+ Swift code
+
+
{{ copy_to_clipboard(
billing_details['swift'],
- name='Swift code',
thing='Swift code',
) }}