1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #3514: Label TextVar fields when rendering custom script forms

This commit is contained in:
Jeremy Stretch
2019-09-18 15:39:26 -04:00
parent 84208d5429
commit a0545568cd
7 changed files with 18 additions and 9 deletions

View File

@ -14,6 +14,7 @@ v2.6.4 (FUTURE)
* [#3501](https://github.com/netbox-community/netbox/issues/3501) - Fix rendering of checkboxes on custom script forms
* [#3511](https://github.com/netbox-community/netbox/issues/3511) - Correct API URL for nested device bays
* [#3513](https://github.com/netbox-community/netbox/issues/3513) - Fix assignment of tags when creating front/rear ports
* [#3514](https://github.com/netbox-community/netbox/issues/3514) - Label TextVar fields when rendering custom script forms
v2.6.3 (2019-09-04)

View File

@ -809,6 +809,7 @@ class DeviceTypeForm(BootstrapMixin, CustomFieldForm):
slug = SlugField(
slug_source='model'
)
comments = CommentField()
tags = TagField(
required=False
)
@ -1358,7 +1359,10 @@ class DeviceForm(BootstrapMixin, TenancyForm, CustomFieldForm):
)
comments = CommentField()
tags = TagField(required=False)
local_context_data = JSONField(required=False)
local_context_data = JSONField(
required=False,
label=''
)
class Meta:
model = Device

View File

@ -241,7 +241,9 @@ class TagBulkEditForm(BootstrapMixin, BulkEditForm):
#
class ConfigContextForm(BootstrapMixin, forms.ModelForm):
data = JSONField()
data = JSONField(
label=''
)
class Meta:
model = ConfigContext

View File

@ -199,6 +199,9 @@ class UserKeyForm(BootstrapMixin, forms.ModelForm):
'public_key': "Enter your public RSA key. Keep the private one with you; you'll need it for decryption. "
"Please note that passphrase-protected keys are not supported.",
}
labels = {
'public_key': ''
}
def clean_public_key(self):
key = self.cleaned_data['public_key']

View File

@ -24,7 +24,7 @@
</ul>
{% endif %}
</div>
{% elif field|widget_type == 'textarea' %}
{% elif field|widget_type == 'textarea' and not field.label %}
<div class="col-md-12">
{{ field }}
{% if bulk_nullable %}

View File

@ -384,7 +384,7 @@ class CSVDataField(forms.CharField):
self.strip = False
if not self.label:
self.label = 'CSV Data'
self.label = ''
if not self.initial:
self.initial = ','.join(required_fields) + '\n'
if not self.help_text:
@ -484,7 +484,7 @@ class CommentField(forms.CharField):
A textarea with support for GitHub-Flavored Markdown. Exists mostly just to add a standard help_text.
"""
widget = forms.Textarea
default_label = 'Comments'
default_label = ''
# TODO: Port GFM syntax cheat sheet to internal documentation
default_helptext = '<i class="fa fa-info-circle"></i> '\
'<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank">'\

View File

@ -79,9 +79,7 @@ class ClusterGroupCSVForm(forms.ModelForm):
#
class ClusterForm(BootstrapMixin, CustomFieldForm):
comments = CommentField(
widget=SmallTextarea()
)
comments = CommentField()
tags = TagField(
required=False
)
@ -331,7 +329,8 @@ class VirtualMachineForm(BootstrapMixin, TenancyForm, CustomFieldForm):
required=False
)
local_context_data = JSONField(
required=False
required=False,
label=''
)
class Meta: