9045 remove fields from forms and tables

This commit is contained in:
Arthur 2022-09-27 10:41:11 -07:00 committed by jeremystretch
parent 827fa76d61
commit d0b3930f9a
3 changed files with 4 additions and 51 deletions

View File

@ -20,10 +20,6 @@ __all__ = (
class ProviderBulkEditForm(NetBoxModelBulkEditForm):
asn = forms.IntegerField(
required=False,
label='ASN (legacy)'
)
asns = DynamicModelMultipleChoiceField(
queryset=ASN.objects.all(),
label=_('ASNs'),
@ -34,20 +30,6 @@ class ProviderBulkEditForm(NetBoxModelBulkEditForm):
required=False,
label='Account number'
)
portal_url = forms.URLField(
required=False,
label='Portal'
)
noc_contact = forms.CharField(
required=False,
widget=SmallTextarea,
label='NOC contact'
)
admin_contact = forms.CharField(
required=False,
widget=SmallTextarea,
label='Admin contact'
)
comments = CommentField(
widget=SmallTextarea,
label='Comments'
@ -55,10 +37,10 @@ class ProviderBulkEditForm(NetBoxModelBulkEditForm):
model = Provider
fieldsets = (
(None, ('asn', 'asns', 'account', 'portal_url', 'noc_contact', 'admin_contact')),
(None, ('asns', 'account', )),
)
nullable_fields = (
'asn', 'asns', 'account', 'portal_url', 'noc_contact', 'admin_contact', 'comments',
'asns', 'account', 'comments',
)

View File

@ -41,10 +41,10 @@ class ProviderTable(NetBoxTable):
class Meta(NetBoxTable.Meta):
model = Provider
fields = (
'pk', 'id', 'name', 'asn', 'asns', 'account', 'portal_url', 'noc_contact', 'admin_contact', 'asn_count',
'pk', 'id', 'name', 'asns', 'account', 'asn_count',
'circuit_count', 'comments', 'contacts', 'tags', 'created', 'last_updated',
)
default_columns = ('pk', 'name', 'asn', 'account', 'circuit_count')
default_columns = ('pk', 'name', 'account', 'circuit_count')
class ProviderNetworkTable(NetBoxTable):

View File

@ -19,17 +19,6 @@
<h5 class="card-header">Provider</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">ASN</th>
<td>
{% if object.asn %}
<div class="float-end text-warning">
<i class="mdi mdi-alert" title="This field will be removed in a future release. Please migrate this data to ASN objects."></i>
</div>
{% endif %}
{{ object.asn|placeholder }}
</td>
</tr>
<tr>
<th scope="row">ASNs</th>
<td>
@ -44,24 +33,6 @@
<th scope="row">Account</th>
<td>{{ object.account|placeholder }}</td>
</tr>
<tr>
<th scope="row">Customer Portal</th>
<td>
{% if object.portal_url %}
<a href="{{ object.portal_url }}">{{ object.portal_url }}</a>
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
<tr>
<th scope="row">NOC Contact</th>
<td>{{ object.noc_contact|markdown|placeholder }}</td>
</tr>
<tr>
<th scope="row">Admin Contact</th>
<td>{{ object.admin_contact|markdown|placeholder }}</td>
</tr>
<tr>
<th scope="row">Circuits</th>
<td>