Skip to content

Commit 9dc3b4a

Browse files
committed
Merge branch 'feature' into search-index
2 parents b29ffc3 + ad0472d commit 9dc3b4a

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

netbox_custom_objects/templates/netbox_custom_objects/custom_object_list.html

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,15 @@
66
<div class="btn-list">
77
{% plugin_list_buttons model %}
88
{% block extra_controls %}{% endblock %}
9-
{% if 'add' in actions %}
10-
{% custom_object_add_button model custom_object_type %}
11-
{% endif %}
12-
{% if 'bulk_import' in actions %}
13-
{% custom_object_import_button model %}
14-
{% endif %}
15-
{% if 'export' in actions %}
16-
{% custom_object_export_button model %}
17-
{% endif %}
9+
{% custom_object_add_button model custom_object_type %}
10+
{% custom_object_import_button model %}
11+
{% custom_object_export_button model %}
1812
</div>
1913
{% endblock controls %}
2014

2115
{% block bulk_buttons %}
2216
<div class="bulk-action-buttons">
23-
{% if 'bulk_edit' in actions %}
24-
{% custom_object_bulk_edit_button model custom_object_type query_params=request.GET %}
25-
{% endif %}
26-
{% if 'bulk_delete' in actions %}
27-
{% custom_object_bulk_delete_button model custom_object_type query_params=request.GET %}
28-
{% endif %}
17+
{% custom_object_bulk_edit_button model custom_object_type query_params=request.GET %}
18+
{% custom_object_bulk_delete_button model custom_object_type query_params=request.GET %}
2919
</div>
3020
{% endblock %}

netbox_custom_objects/templatetags/custom_object_buttons.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def custom_object_sync_button(instance):
176176
url = reverse(viewname, kwargs={"pk": instance.pk})
177177

178178
return {
179+
"label": "Sync",
179180
"url": url,
180181
}
181182

@@ -196,6 +197,7 @@ def custom_object_add_button(model, custom_object_type, action="add"):
196197
url = None
197198

198199
return {
200+
"label": "Add",
199201
"url": url,
200202
}
201203

@@ -208,6 +210,7 @@ def custom_object_import_button(model, action="bulk_import"):
208210
url = None
209211

210212
return {
213+
"label": "Import",
211214
"url": url,
212215
}
213216

@@ -226,6 +229,7 @@ def custom_object_export_button(context, model):
226229
)
227230

228231
return {
232+
"label": "Export",
229233
"perms": context["perms"],
230234
"object_type": object_type,
231235
"url_params": (
@@ -252,6 +256,7 @@ def custom_object_bulk_edit_button(
252256
url = None
253257

254258
return {
259+
"label": "Bulk Edit",
255260
"htmx_navigation": context.get("htmx_navigation"),
256261
"url": url,
257262
}
@@ -272,6 +277,7 @@ def custom_object_bulk_delete_button(
272277
url = None
273278

274279
return {
280+
"label": "Bulk Delete",
275281
"htmx_navigation": context.get("htmx_navigation"),
276282
"url": url,
277283
}

0 commit comments

Comments
 (0)