mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 20:22:53 -06:00
Clean up custom bulk actions
This commit is contained in:
parent
2be2cdb215
commit
60d80621ed
@ -753,7 +753,6 @@ class ConfigContextListView(generic.ObjectListView):
|
|||||||
filterset = filtersets.ConfigContextFilterSet
|
filterset = filtersets.ConfigContextFilterSet
|
||||||
filterset_form = forms.ConfigContextFilterForm
|
filterset_form = forms.ConfigContextFilterForm
|
||||||
table = tables.ConfigContextTable
|
table = tables.ConfigContextTable
|
||||||
template_name = 'extras/configcontext_list.html'
|
|
||||||
actions = (Add, BulkSync, BulkEdit, BulkDelete)
|
actions = (Add, BulkSync, BulkEdit, BulkDelete)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
{% extends 'generic/object_list.html' %}
|
{% extends 'generic/object_list.html' %}
|
||||||
{% load buttons %}
|
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block bulk_buttons %}
|
{% block extra_bulk_buttons %}
|
||||||
{% if perms.dcim.change_device %}
|
{% if perms.dcim.change_device %}
|
||||||
<div class="dropdown">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Components" %}
|
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Components" %}
|
||||||
</button>
|
</button>
|
||||||
@ -75,9 +74,4 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="bulk-action-buttons">
|
{% endblock extra_bulk_buttons %}
|
||||||
{% for name, action in actions.items %}
|
|
||||||
{% bulk_action_button action model %}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
{% extends 'generic/object_list.html' %}
|
|
||||||
{% load i18n %}
|
|
||||||
|
|
||||||
{% block bulk_buttons %}
|
|
||||||
{% if perms.extras.sync_configcontext %}
|
|
||||||
<button type="submit" name="_sync" {% formaction %}="{% url 'extras:configcontext_bulk_sync' %}" class="btn btn-primary">
|
|
||||||
<i class="mdi mdi-sync" aria-hidden="true"></i> {% trans "Sync Data" %}
|
|
||||||
</button>
|
|
||||||
{% endif %}
|
|
||||||
{{ block.super }}
|
|
||||||
{% endblock %}
|
|
@ -8,13 +8,14 @@
|
|||||||
|
|
||||||
{% comment %}
|
{% comment %}
|
||||||
Blocks:
|
Blocks:
|
||||||
- title: Page title
|
- title: Page title
|
||||||
- controls: Control elements displayed between the header and content
|
- controls: Control elements displayed between the header and content
|
||||||
- extra_controls: Any additional action buttons to display
|
- extra_controls: Any additional action buttons to display
|
||||||
- tabs: Page tabs
|
- tabs: Page tabs
|
||||||
- content: Primary page content
|
- content: Primary page content
|
||||||
- bulk_buttons: Additional bulk action buttons to display beneath the objects list
|
- bulk_buttons: Bulk action buttons to display beneath the objects list
|
||||||
- modals: Any pre-loaded modals
|
- extra_bulk_buttons: Addition bulk action buttons
|
||||||
|
- modals: Any pre-loaded modals
|
||||||
|
|
||||||
Context:
|
Context:
|
||||||
- model: The model class being listed
|
- model: The model class being listed
|
||||||
@ -117,6 +118,10 @@ Context:
|
|||||||
<div class="btn-list d-print-none">
|
<div class="btn-list d-print-none">
|
||||||
{% block bulk_buttons %}
|
{% block bulk_buttons %}
|
||||||
<div class="bulk-action-buttons">
|
<div class="bulk-action-buttons">
|
||||||
|
{# Extra bulk buttons #}
|
||||||
|
{% block extra_bulk_buttons %}{% endblock %}
|
||||||
|
|
||||||
|
{# Default bulk action buttons #}
|
||||||
{% for name, action in actions.items %}
|
{% for name, action in actions.items %}
|
||||||
{% bulk_action_button action model %}
|
{% bulk_action_button action model %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{% extends 'generic/object_list.html' %}
|
{% extends 'generic/object_list.html' %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block bulk_buttons %}
|
{% block extra_bulk_buttons %}
|
||||||
{% if perms.virtualization.change_virtualmachine %}
|
{% if perms.virtualization.change_virtualmachine %}
|
||||||
<div class="dropdown">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Components" %}
|
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> {% trans "Add Components" %}
|
||||||
</button>
|
</button>
|
||||||
@ -25,5 +25,4 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ block.super }}
|
{% endblock extra_bulk_buttons %}
|
||||||
{% endblock %}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user