mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-16 12:38:17 -06:00
Revert "Fixes #8398: Add ConfigParam.size to enlarge specific config fields"
This reverts commit 05e8fff458
.
This commit is contained in:
parent
05e8fff458
commit
4f2a82916a
@ -25,8 +25,6 @@ class FormMetaclass(forms.models.ModelFormMetaclass):
|
||||
}
|
||||
field_kwargs.update(**param.field_kwargs)
|
||||
param_fields[param.name] = param.field(**field_kwargs)
|
||||
if param.size:
|
||||
param_fields[param.name].widget.attrs["size"] = param.size
|
||||
attrs.update(param_fields)
|
||||
|
||||
return super().__new__(mcs, name, bases, attrs)
|
||||
|
@ -4,14 +4,13 @@ from django.contrib.postgres.forms import SimpleArrayField
|
||||
|
||||
class ConfigParam:
|
||||
|
||||
def __init__(self, name, label, default, description='', field=None, field_kwargs=None, size=None):
|
||||
def __init__(self, name, label, default, description='', field=None, field_kwargs=None):
|
||||
self.name = name
|
||||
self.label = label
|
||||
self.default = default
|
||||
self.field = field or forms.CharField
|
||||
self.description = description
|
||||
self.field_kwargs = field_kwargs or {}
|
||||
self.size = size
|
||||
|
||||
|
||||
PARAMS = (
|
||||
@ -21,22 +20,19 @@ PARAMS = (
|
||||
name='BANNER_LOGIN',
|
||||
label='Login banner',
|
||||
default='',
|
||||
description="Additional content to display on the login page",
|
||||
size="80",
|
||||
description="Additional content to display on the login page"
|
||||
),
|
||||
ConfigParam(
|
||||
name='BANNER_TOP',
|
||||
label='Top banner',
|
||||
default='',
|
||||
description="Additional content to display at the top of every page",
|
||||
size="80",
|
||||
description="Additional content to display at the top of every page"
|
||||
),
|
||||
ConfigParam(
|
||||
name='BANNER_BOTTOM',
|
||||
label='Bottom banner',
|
||||
default='',
|
||||
description="Additional content to display at the bottom of every page",
|
||||
size="80",
|
||||
description="Additional content to display at the bottom of every page"
|
||||
),
|
||||
|
||||
# IPAM
|
||||
@ -81,8 +77,7 @@ PARAMS = (
|
||||
),
|
||||
description="Permitted schemes for URLs in user-provided content",
|
||||
field=SimpleArrayField,
|
||||
field_kwargs={'base_field': forms.CharField()},
|
||||
size="80",
|
||||
field_kwargs={'base_field': forms.CharField()}
|
||||
),
|
||||
|
||||
# Pagination
|
||||
@ -162,8 +157,7 @@ PARAMS = (
|
||||
name='MAPS_URL',
|
||||
label='Maps URL',
|
||||
default='https://maps.google.com/?q=',
|
||||
description="Base URL for mapping geographic locations",
|
||||
size="80",
|
||||
description="Base URL for mapping geographic locations"
|
||||
),
|
||||
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user