From a1808a54a492f5cb710bbcfe75b57ffa7e387b9a Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Mon, 28 Mar 2022 09:13:15 -0400 Subject: [PATCH] Fixes #8974: Use monospace font for text areas in config revision form --- docs/release-notes/version-3.1.md | 4 ++++ netbox/extras/admin.py | 3 +++ netbox/netbox/config/parameters.py | 26 +++++++++++++++++++++----- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/docs/release-notes/version-3.1.md b/docs/release-notes/version-3.1.md index df9c9c7bb..13e2161b4 100644 --- a/docs/release-notes/version-3.1.md +++ b/docs/release-notes/version-3.1.md @@ -2,6 +2,10 @@ ## v3.1.11 (FUTURE) +### Enhancements + +* [#8974](https://github.com/netbox-community/netbox/issues/8974) - Use monospace font for text areas in config revision form + --- ## v3.1.10 (2022-03-25) diff --git a/netbox/extras/admin.py b/netbox/extras/admin.py index b6ee01db9..047f723ad 100644 --- a/netbox/extras/admin.py +++ b/netbox/extras/admin.py @@ -23,15 +23,18 @@ class ConfigRevisionAdmin(admin.ModelAdmin): }), ('Banners', { 'fields': ('BANNER_LOGIN', 'BANNER_TOP', 'BANNER_BOTTOM'), + 'classes': ('monospace',), }), ('Pagination', { 'fields': ('PAGINATE_COUNT', 'MAX_PAGE_SIZE'), }), ('Validation', { 'fields': ('CUSTOM_VALIDATORS',), + 'classes': ('monospace',), }), ('NAPALM', { 'fields': ('NAPALM_USERNAME', 'NAPALM_PASSWORD', 'NAPALM_TIMEOUT', 'NAPALM_ARGS'), + 'classes': ('monospace',), }), ('Miscellaneous', { 'fields': ('MAINTENANCE_MODE', 'GRAPHQL_ENABLED', 'CHANGELOG_RETENTION', 'MAPS_URL'), diff --git a/netbox/netbox/config/parameters.py b/netbox/netbox/config/parameters.py index 22dbac143..7da40e063 100644 --- a/netbox/netbox/config/parameters.py +++ b/netbox/netbox/config/parameters.py @@ -22,7 +22,9 @@ PARAMS = ( default='', description="Additional content to display on the login page", field_kwargs={ - 'widget': forms.Textarea(), + 'widget': forms.Textarea( + attrs={'class': 'vLargeTextField'} + ), }, ), ConfigParam( @@ -31,7 +33,9 @@ PARAMS = ( default='', description="Additional content to display at the top of every page", field_kwargs={ - 'widget': forms.Textarea(), + 'widget': forms.Textarea( + attrs={'class': 'vLargeTextField'} + ), }, ), ConfigParam( @@ -40,7 +44,9 @@ PARAMS = ( default='', description="Additional content to display at the bottom of every page", field_kwargs={ - 'widget': forms.Textarea(), + 'widget': forms.Textarea( + attrs={'class': 'vLargeTextField'} + ), }, ), @@ -109,7 +115,12 @@ PARAMS = ( label='Custom validators', default={}, description="Custom validation rules (JSON)", - field=forms.JSONField + field=forms.JSONField, + field_kwargs={ + 'widget': forms.Textarea( + attrs={'class': 'vLargeTextField'} + ), + }, ), # NAPALM @@ -137,7 +148,12 @@ PARAMS = ( label='NAPALM arguments', default={}, description="Additional arguments to pass when invoking a NAPALM driver (as JSON data)", - field=forms.JSONField + field=forms.JSONField, + field_kwargs={ + 'widget': forms.Textarea( + attrs={'class': 'vLargeTextField'} + ), + }, ), # Miscellaneous