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
elif self.field.help is not None:
if isinstance(self.field.help, str):
return _(self.field.help)
return ('info_minor', _(self.field.help))
else:
return self.field.help
else:
@ -304,6 +304,10 @@ class FormField(abc.ABC):
def __init__(self, caption=None, help=None):
self.caption = caption
# Allows styling at instantiation
if isinstance(help, str):
self.help = ('info_minor', help)
else:
self.help = help
self.index = FormField.next_index
FormField.next_index += 1