mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-21 02:58:43 -06:00
* Initial work on #19735 * Work in progress * Remove ClusterRemoveDevicesView (anti-pattern) * Misc cleanup * Fix has_bulk_actions * Fix has_bulk_actions for ObjectChildrenView * Restore clone button * Misc cleanup * Clean up custom bulk actions * Rename individual object actions * Collapse into a single template tag * Fix support for legacy action dicts * Rename bulk attr to multi * clone_button tag should fail silently if view name is invalid * Clean up action buttons * Fix export button label * Replace clone_button with an ObjectAction * Create object actions for adding device/VM components * Move core_sync.html to core app * Remove extra_bulk_buttons from template doc
This commit is contained in:
@@ -14,12 +14,13 @@ from jinja2.exceptions import TemplateError
|
||||
|
||||
from core.choices import ManagedFileRootPathChoices
|
||||
from core.models import Job
|
||||
from core.object_actions import BulkSync
|
||||
from dcim.models import Device, DeviceRole, Platform
|
||||
from extras.choices import LogLevelChoices
|
||||
from extras.dashboard.forms import DashboardWidgetAddForm, DashboardWidgetForm
|
||||
from extras.dashboard.utils import get_widget_class
|
||||
from extras.utils import SharedObjectViewMixin
|
||||
from netbox.constants import DEFAULT_ACTION_PERMISSIONS
|
||||
from netbox.object_actions import *
|
||||
from netbox.views import generic
|
||||
from netbox.views.generic.mixins import TableMixin
|
||||
from utilities.forms import ConfirmationForm, get_field_value
|
||||
@@ -232,11 +233,7 @@ class ExportTemplateListView(generic.ObjectListView):
|
||||
filterset = filtersets.ExportTemplateFilterSet
|
||||
filterset_form = forms.ExportTemplateFilterForm
|
||||
table = tables.ExportTemplateTable
|
||||
template_name = 'extras/exporttemplate_list.html'
|
||||
actions = {
|
||||
**DEFAULT_ACTION_PERMISSIONS,
|
||||
'bulk_sync': {'sync'},
|
||||
}
|
||||
actions = (AddObject, BulkImport, BulkSync, BulkEdit, BulkExport, BulkDelete)
|
||||
|
||||
|
||||
@register_model_view(ExportTemplate)
|
||||
@@ -347,9 +344,7 @@ class TableConfigListView(SharedObjectViewMixin, generic.ObjectListView):
|
||||
filterset = filtersets.TableConfigFilterSet
|
||||
filterset_form = forms.TableConfigFilterForm
|
||||
table = tables.TableConfigTable
|
||||
actions = {
|
||||
'export': {'view'},
|
||||
}
|
||||
actions = (BulkExport,)
|
||||
|
||||
|
||||
@register_model_view(TableConfig)
|
||||
@@ -758,13 +753,7 @@ class ConfigContextListView(generic.ObjectListView):
|
||||
filterset = filtersets.ConfigContextFilterSet
|
||||
filterset_form = forms.ConfigContextFilterForm
|
||||
table = tables.ConfigContextTable
|
||||
template_name = 'extras/configcontext_list.html'
|
||||
actions = {
|
||||
'add': {'add'},
|
||||
'bulk_edit': {'change'},
|
||||
'bulk_delete': {'delete'},
|
||||
'bulk_sync': {'sync'},
|
||||
}
|
||||
actions = (AddObject, BulkSync, BulkEdit, BulkDelete)
|
||||
|
||||
|
||||
@register_model_view(ConfigContext)
|
||||
@@ -877,11 +866,7 @@ class ConfigTemplateListView(generic.ObjectListView):
|
||||
filterset = filtersets.ConfigTemplateFilterSet
|
||||
filterset_form = forms.ConfigTemplateFilterForm
|
||||
table = tables.ConfigTemplateTable
|
||||
template_name = 'extras/configtemplate_list.html'
|
||||
actions = {
|
||||
**DEFAULT_ACTION_PERMISSIONS,
|
||||
'bulk_sync': {'sync'},
|
||||
}
|
||||
actions = (AddObject, BulkImport, BulkSync, BulkEdit, BulkExport, BulkDelete)
|
||||
|
||||
|
||||
@register_model_view(ConfigTemplate)
|
||||
@@ -992,9 +977,7 @@ class ImageAttachmentListView(generic.ObjectListView):
|
||||
filterset = filtersets.ImageAttachmentFilterSet
|
||||
filterset_form = forms.ImageAttachmentFilterForm
|
||||
table = tables.ImageAttachmentTable
|
||||
actions = {
|
||||
'export': {'view'},
|
||||
}
|
||||
actions = (BulkExport,)
|
||||
|
||||
|
||||
@register_model_view(ImageAttachment, 'add', detail=False)
|
||||
@@ -1038,12 +1021,7 @@ class JournalEntryListView(generic.ObjectListView):
|
||||
filterset = filtersets.JournalEntryFilterSet
|
||||
filterset_form = forms.JournalEntryFilterForm
|
||||
table = tables.JournalEntryTable
|
||||
actions = {
|
||||
'export': {'view'},
|
||||
'bulk_import': {'add'},
|
||||
'bulk_edit': {'change'},
|
||||
'bulk_delete': {'delete'},
|
||||
}
|
||||
actions = (BulkImport, BulkEdit, BulkDelete)
|
||||
|
||||
|
||||
@register_model_view(JournalEntry)
|
||||
|
||||
Reference in New Issue
Block a user