mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-16 20:48: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)
|
field_kwargs.update(**param.field_kwargs)
|
||||||
param_fields[param.name] = param.field(**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)
|
attrs.update(param_fields)
|
||||||
|
|
||||||
return super().__new__(mcs, name, bases, attrs)
|
return super().__new__(mcs, name, bases, attrs)
|
||||||
|
@ -4,14 +4,13 @@ from django.contrib.postgres.forms import SimpleArrayField
|
|||||||
|
|
||||||
class ConfigParam:
|
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.name = name
|
||||||
self.label = label
|
self.label = label
|
||||||
self.default = default
|
self.default = default
|
||||||
self.field = field or forms.CharField
|
self.field = field or forms.CharField
|
||||||
self.description = description
|
self.description = description
|
||||||
self.field_kwargs = field_kwargs or {}
|
self.field_kwargs = field_kwargs or {}
|
||||||
self.size = size
|
|
||||||
|
|
||||||
|
|
||||||
PARAMS = (
|
PARAMS = (
|
||||||
@ -21,22 +20,19 @@ PARAMS = (
|
|||||||
name='BANNER_LOGIN',
|
name='BANNER_LOGIN',
|
||||||
label='Login banner',
|
label='Login banner',
|
||||||
default='',
|
default='',
|
||||||
description="Additional content to display on the login page",
|
description="Additional content to display on the login page"
|
||||||
size="80",
|
|
||||||
),
|
),
|
||||||
ConfigParam(
|
ConfigParam(
|
||||||
name='BANNER_TOP',
|
name='BANNER_TOP',
|
||||||
label='Top banner',
|
label='Top banner',
|
||||||
default='',
|
default='',
|
||||||
description="Additional content to display at the top of every page",
|
description="Additional content to display at the top of every page"
|
||||||
size="80",
|
|
||||||
),
|
),
|
||||||
ConfigParam(
|
ConfigParam(
|
||||||
name='BANNER_BOTTOM',
|
name='BANNER_BOTTOM',
|
||||||
label='Bottom banner',
|
label='Bottom banner',
|
||||||
default='',
|
default='',
|
||||||
description="Additional content to display at the bottom of every page",
|
description="Additional content to display at the bottom of every page"
|
||||||
size="80",
|
|
||||||
),
|
),
|
||||||
|
|
||||||
# IPAM
|
# IPAM
|
||||||
@ -81,8 +77,7 @@ PARAMS = (
|
|||||||
),
|
),
|
||||||
description="Permitted schemes for URLs in user-provided content",
|
description="Permitted schemes for URLs in user-provided content",
|
||||||
field=SimpleArrayField,
|
field=SimpleArrayField,
|
||||||
field_kwargs={'base_field': forms.CharField()},
|
field_kwargs={'base_field': forms.CharField()}
|
||||||
size="80",
|
|
||||||
),
|
),
|
||||||
|
|
||||||
# Pagination
|
# Pagination
|
||||||
@ -162,8 +157,7 @@ PARAMS = (
|
|||||||
name='MAPS_URL',
|
name='MAPS_URL',
|
||||||
label='Maps URL',
|
label='Maps URL',
|
||||||
default='https://maps.google.com/?q=',
|
default='https://maps.google.com/?q=',
|
||||||
description="Base URL for mapping geographic locations",
|
description="Base URL for mapping geographic locations"
|
||||||
size="80",
|
|
||||||
),
|
),
|
||||||
|
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user