mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-04 13:41:38 -04:00
1134 - Changing all instances of the word "brackets" to "parenthesis"
This commit is contained in:
@@ -14,7 +14,7 @@ from notifications_utils.insensitive_dict import InsensitiveDict
|
||||
|
||||
class Placeholder:
|
||||
def __init__(self, body):
|
||||
# body shouldn’t include leading/trailing brackets, like (( and ))
|
||||
# body shouldn’t include leading/trailing parenthesis, like (( and ))
|
||||
self.body = body.lstrip("(").rstrip(")")
|
||||
|
||||
@classmethod
|
||||
@@ -70,14 +70,16 @@ class Field:
|
||||
conditional_placeholder_tag = (
|
||||
"<span class='placeholder-conditional'>(({}??</span>{}))"
|
||||
)
|
||||
placeholder_tag_no_brackets = "<span class='placeholder-no-brackets'>{}</span>"
|
||||
placeholder_tag_no_parenthesis = (
|
||||
"<span class='placeholder-no-parenthesis'>{}</span>"
|
||||
)
|
||||
placeholder_tag_redacted = "<span class='placeholder-redacted'>hidden</span>"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
content,
|
||||
values=None,
|
||||
with_brackets=True,
|
||||
with_parenthesis=True,
|
||||
html="strip",
|
||||
markdown_lists=False,
|
||||
redact_missing_personalisation=False,
|
||||
@@ -85,8 +87,8 @@ class Field:
|
||||
self.content = content
|
||||
self.values = values
|
||||
self.markdown_lists = markdown_lists
|
||||
if not with_brackets:
|
||||
self.placeholder_tag = self.placeholder_tag_no_brackets
|
||||
if not with_parenthesis:
|
||||
self.placeholder_tag = self.placeholder_tag_no_parenthesis
|
||||
self.sanitizer = {
|
||||
"strip": strip_html,
|
||||
"escape": escape_html,
|
||||
@@ -198,7 +200,7 @@ class PlainTextField(Field):
|
||||
|
||||
placeholder_tag = "(({}))"
|
||||
conditional_placeholder_tag = "(({}??{}))"
|
||||
placeholder_tag_no_brackets = "{}"
|
||||
placeholder_tag_no_parenthesis = "{}"
|
||||
placeholder_tag_redacted = "[hidden]"
|
||||
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
border-radius: 1.05em;
|
||||
}
|
||||
|
||||
.placeholder-no-brackets {
|
||||
.placeholder-no-parenthesis {
|
||||
display: inline;
|
||||
background: #FD0;
|
||||
color: #000;
|
||||
|
||||
@@ -68,7 +68,7 @@ class SanitiseText:
|
||||
if decomposed != "" and "<" not in decomposed:
|
||||
# decomposition lists the unicode code points a character is made up of, if it's made up of multiple
|
||||
# points. For example the á character returns '0061 0301', as in, the character a, followed by a combining
|
||||
# acute accent. The decomposition might, however, also contain a decomposition mapping in angle brackets.
|
||||
# acute accent. The decomposition might, however, also contain a decomposition mapping in angle parenthesis.
|
||||
# For a full list of the types, see here: https://www.compart.com/en/unicode/decomposition.
|
||||
# If it's got a mapping, we're not sure how best to downgrade it, so just see if it's in the
|
||||
# REPLACEMENT_CHARACTERS map. If not, then it's probably a letter with a modifier, eg á
|
||||
|
||||
@@ -376,7 +376,7 @@ class SMSPreviewTemplate(BaseSMSTemplate):
|
||||
"recipient": Field(
|
||||
"((phone number))",
|
||||
self.values,
|
||||
with_brackets=False,
|
||||
with_parenthesis=False,
|
||||
html="escape",
|
||||
),
|
||||
"show_recipient": self.show_recipient,
|
||||
@@ -691,7 +691,7 @@ class EmailPreviewTemplate(BaseEmailTemplate):
|
||||
"from_address": self.from_address,
|
||||
"reply_to": self.reply_to,
|
||||
"recipient": Field(
|
||||
"((email address))", self.values, with_brackets=False
|
||||
"((email address))", self.values, with_parenthesis=False
|
||||
),
|
||||
"show_recipient": self.show_recipient,
|
||||
}
|
||||
@@ -779,7 +779,7 @@ class BaseLetterTemplate(SubjectMixin, Template):
|
||||
self.address_block,
|
||||
self.values,
|
||||
html="escape",
|
||||
with_brackets=False,
|
||||
with_parenthesis=False,
|
||||
).splitlines()
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user