Merge pull request #1394 from CarlosNihelton/style-help-gray

Defaults help text style to gray
This commit is contained in:
Michael Hudson-Doyle 2022-08-30 11:34:42 +12:00 committed by GitHub
commit 60953951fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -249,7 +249,7 @@ class BoundFormField(object):
return self._help return self._help
elif self.field.help is not None: elif self.field.help is not None:
if isinstance(self.field.help, str): if isinstance(self.field.help, str):
return _(self.field.help) return ('info_minor', _(self.field.help))
else: else:
return self.field.help return self.field.help
else: else:
@ -304,7 +304,11 @@ class FormField(abc.ABC):
def __init__(self, caption=None, help=None): def __init__(self, caption=None, help=None):
self.caption = caption self.caption = caption
self.help = help # Allows styling at instantiation
if isinstance(help, str):
self.help = ('info_minor', help)
else:
self.help = help
self.index = FormField.next_index self.index = FormField.next_index
FormField.next_index += 1 FormField.next_index += 1