14 changes: 9 additions & 5 deletions nautobot/extras/forms/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,12 @@ class ConfigContextSchemaFilterForm(BootstrapMixin, forms.Form):
)


class CustomFieldDescriptionField(CommentField):
@property
def default_helptext(self):
return "Also used as the help text when editing models using this custom field.<br>" + super().default_helptext


class CustomFieldForm(BootstrapMixin, forms.ModelForm):
label = forms.CharField(required=True, max_length=50, help_text="Name of the field as displayed to users.")
key = SlugField(
Expand All @@ -376,11 +382,9 @@ class CustomFieldForm(BootstrapMixin, forms.ModelForm):
slug_source="label",
help_text="Internal name of this field. Please use underscores rather than dashes.",
)
description = forms.CharField(
description = CustomFieldDescriptionField(
label="Description",
required=False,
help_text="Also used as the help text when editing models using this custom field.<br>"
'<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank">'
"Markdown</a> syntax is supported.",
)
content_types = MultipleContentTypeField(
feature="custom_fields", help_text="The object(s) to which this field applies."
Expand Down Expand Up @@ -1098,7 +1102,7 @@ class JobButtonFilterForm(BootstrapMixin, forms.Form):


class NoteForm(BootstrapMixin, forms.ModelForm):
note = CommentField
note = CommentField()

class Meta:
model = Note
Expand Down
5 changes: 4 additions & 1 deletion nautobot/extras/models/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ class Job(PrimaryModel):
help_text="Human-readable name of this job",
unique=True,
)
description = models.TextField(blank=True, help_text="Markdown formatting is supported")
description = models.TextField(
blank=True,
help_text="Markdown formatting and a limited subset of HTML are supported",
)

# Control flags
installed = models.BooleanField(
Expand Down
38 changes: 32 additions & 6 deletions poetry.lock
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ netaddr = "~0.8.0"
# Note: netutils is limited in scope, dependencies, and observes semver, as such
# we permit a looser (^) version constraint here.
netutils = "^1.6.0"
# HTML sanitization
nh3 = "~0.2.15"
# Handling of version numbers
packaging = ">=23.1"
# Image processing library
Expand Down