From a527e0e527208cd98e1b3d665fa82ea7a4e88892 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 16 May 2016 16:29:08 -0400 Subject: [PATCH] Consolidated to utilities/obj_table.html --- netbox/templates/circuits/circuit_list.html | 2 +- .../templates/circuits/circuittype_list.html | 2 +- .../templates/circuits/inc/circuit_table.html | 22 --------------- .../circuits/inc/circuittype_table.html | 14 ---------- .../circuits/inc/provider_table.html | 22 --------------- netbox/templates/circuits/provider_list.html | 2 +- netbox/templates/dcim/device_list.html | 2 +- netbox/templates/dcim/devicerole_list.html | 2 +- netbox/templates/dcim/devicetype_list.html | 2 +- netbox/templates/dcim/inc/device_table.html | 28 ------------------- .../templates/dcim/inc/devicerole_table.html | 14 ---------- .../templates/dcim/inc/devicetype_table.html | 22 --------------- .../dcim/inc/manufacturer_table.html | 14 ---------- netbox/templates/dcim/inc/platform_table.html | 14 ---------- netbox/templates/dcim/inc/rack_table.html | 22 --------------- .../templates/dcim/inc/rackgroup_table.html | 14 ---------- netbox/templates/dcim/manufacturer_list.html | 2 +- netbox/templates/dcim/platform_list.html | 2 +- netbox/templates/dcim/rack_list.html | 2 +- netbox/templates/dcim/rackgroup_list.html | 2 +- .../templates/secrets/inc/secret_table.html | 22 --------------- .../secrets/inc/secretrole_table.html | 14 ---------- netbox/templates/secrets/secret_list.html | 2 +- netbox/templates/secrets/secretrole_list.html | 2 +- 24 files changed, 12 insertions(+), 234 deletions(-) delete mode 100644 netbox/templates/circuits/inc/circuit_table.html delete mode 100644 netbox/templates/circuits/inc/circuittype_table.html delete mode 100644 netbox/templates/circuits/inc/provider_table.html delete mode 100644 netbox/templates/dcim/inc/device_table.html delete mode 100644 netbox/templates/dcim/inc/devicerole_table.html delete mode 100644 netbox/templates/dcim/inc/devicetype_table.html delete mode 100644 netbox/templates/dcim/inc/manufacturer_table.html delete mode 100644 netbox/templates/dcim/inc/platform_table.html delete mode 100644 netbox/templates/dcim/inc/rack_table.html delete mode 100644 netbox/templates/dcim/inc/rackgroup_table.html delete mode 100644 netbox/templates/secrets/inc/secret_table.html delete mode 100644 netbox/templates/secrets/inc/secretrole_table.html diff --git a/netbox/templates/circuits/circuit_list.html b/netbox/templates/circuits/circuit_list.html index bf0369086..388efa609 100644 --- a/netbox/templates/circuits/circuit_list.html +++ b/netbox/templates/circuits/circuit_list.html @@ -28,7 +28,7 @@

Circuits

- {% include 'circuits/inc/circuit_table.html' %} + {% include 'utilities/obj_table.html' with bulk_edit_url='circuits:circuit_bulk_edit' bulk_delete_url='circuits:circuit_bulk_delete' %}
diff --git a/netbox/templates/circuits/circuittype_list.html b/netbox/templates/circuits/circuittype_list.html index 160acc464..68bdb1552 100644 --- a/netbox/templates/circuits/circuittype_list.html +++ b/netbox/templates/circuits/circuittype_list.html @@ -15,7 +15,7 @@

Circuit Types

- {% include 'circuits/inc/circuittype_table.html' %} + {% include 'utilities/obj_table.html' with bulk_delete_url='circuits:circuittype_bulk_delete' %}
{% endblock %} diff --git a/netbox/templates/circuits/inc/circuit_table.html b/netbox/templates/circuits/inc/circuit_table.html deleted file mode 100644 index 273b355ad..000000000 --- a/netbox/templates/circuits/inc/circuit_table.html +++ /dev/null @@ -1,22 +0,0 @@ -{% load render_table from django_tables2 %} -{% if perms.circuits.change_circuit or perms.circuits.delete_circuit %} -
- {% csrf_token %} - - {% render_table table table_template|default:'table.html' %} - {% if perms.circuits.change_circuit %} - - {% endif %} - {% if perms.circuits.delete_circuit %} - - {% endif %} -
-{% else %} - {% render_table table table_template|default:'table.html' %} -{% endif %} diff --git a/netbox/templates/circuits/inc/circuittype_table.html b/netbox/templates/circuits/inc/circuittype_table.html deleted file mode 100644 index b20f31da5..000000000 --- a/netbox/templates/circuits/inc/circuittype_table.html +++ /dev/null @@ -1,14 +0,0 @@ -{% load render_table from django_tables2 %} -{% if perms.circuits.delete_circuittype %} -
- {% csrf_token %} - - {% render_table table table_template|default:'table.html' %} - -
-{% else %} - {% render_table table table_template|default:'table.html' %} -{% endif %} diff --git a/netbox/templates/circuits/inc/provider_table.html b/netbox/templates/circuits/inc/provider_table.html deleted file mode 100644 index c24e6dbda..000000000 --- a/netbox/templates/circuits/inc/provider_table.html +++ /dev/null @@ -1,22 +0,0 @@ -{% load render_table from django_tables2 %} -{% if perms.circuits.change_provider or perms.circuits.delete_provider %} -
- {% csrf_token %} - - {% render_table table table_template|default:'table.html' %} - {% if perms.circuits.change_provider %} - - {% endif %} - {% if perms.circuits.delete_provider %} - - {% endif %} -
-{% else %} - {% render_table table table_template|default:'table.html' %} -{% endif %} diff --git a/netbox/templates/circuits/provider_list.html b/netbox/templates/circuits/provider_list.html index 65ecce153..7f96033fb 100644 --- a/netbox/templates/circuits/provider_list.html +++ b/netbox/templates/circuits/provider_list.html @@ -27,7 +27,7 @@

Providers

- {% include 'circuits/inc/provider_table.html' %} + {% include 'utilities/obj_table.html' with bulk_edit_url='circuits:provider_bulk_edit' bulk_delete_url='circuits:provider_bulk_delete' %}
{% endblock %} diff --git a/netbox/templates/dcim/device_list.html b/netbox/templates/dcim/device_list.html index ee629e7af..60b294eba 100644 --- a/netbox/templates/dcim/device_list.html +++ b/netbox/templates/dcim/device_list.html @@ -32,7 +32,7 @@

Devices

- {% include 'dcim/inc/device_table.html' %} + {% include 'utilities/obj_table.html' with bulk_edit_url='dcim:device_bulk_edit' bulk_delete_url='dcim:device_bulk_delete' %}
diff --git a/netbox/templates/dcim/devicerole_list.html b/netbox/templates/dcim/devicerole_list.html index 350ef258d..bf29d5cb3 100644 --- a/netbox/templates/dcim/devicerole_list.html +++ b/netbox/templates/dcim/devicerole_list.html @@ -15,7 +15,7 @@

Device Roles

- {% include 'dcim/inc/devicerole_table.html' %} + {% include 'utilities/obj_table.html' with bulk_delete_url='dcim:devicerole_bulk_delete' %}
{% endblock %} diff --git a/netbox/templates/dcim/devicetype_list.html b/netbox/templates/dcim/devicetype_list.html index e3253a81d..a379dd3ad 100644 --- a/netbox/templates/dcim/devicetype_list.html +++ b/netbox/templates/dcim/devicetype_list.html @@ -15,7 +15,7 @@

Device Types

- {% include 'dcim/inc/devicetype_table.html' %} + {% include 'utilities/obj_table.html' with bulk_edit_url='dcim:devicetype_bulk_edit' bulk_delete_url='dcim:devicetype_bulk_delete' %}
{% include 'inc/filter_panel.html' %} diff --git a/netbox/templates/dcim/inc/device_table.html b/netbox/templates/dcim/inc/device_table.html deleted file mode 100644 index 99ee199b2..000000000 --- a/netbox/templates/dcim/inc/device_table.html +++ /dev/null @@ -1,28 +0,0 @@ -{% load render_table from django_tables2 %} -{% if perms.dcim.add_interface or perms.dcim.change_device or perms.dcim.delete_device %} -
- {% csrf_token %} - - {% render_table table table_template|default:'table.html' %} - {% if perms.dcim.add_interface %} - - {% endif %} - {% if perms.dcim.change_device %} - - {% endif %} - {% if perms.dcim.delete_device %} - - {% endif %} -
-{% else %} - {% render_table table table_template|default:'table.html' %} -{% endif %} diff --git a/netbox/templates/dcim/inc/devicerole_table.html b/netbox/templates/dcim/inc/devicerole_table.html deleted file mode 100644 index 54f8c3547..000000000 --- a/netbox/templates/dcim/inc/devicerole_table.html +++ /dev/null @@ -1,14 +0,0 @@ -{% load render_table from django_tables2 %} -{% if perms.dcim.delete_devicerole %} -
- {% csrf_token %} - - {% render_table table table_template|default:'table.html' %} - -
-{% else %} - {% render_table table table_template|default:'table.html' %} -{% endif %} diff --git a/netbox/templates/dcim/inc/devicetype_table.html b/netbox/templates/dcim/inc/devicetype_table.html deleted file mode 100644 index 23fbf7627..000000000 --- a/netbox/templates/dcim/inc/devicetype_table.html +++ /dev/null @@ -1,22 +0,0 @@ -{% load render_table from django_tables2 %} -{% if perms.dcim.change_devicetype or perms.dcim.delete_devicetype %} -
- {% csrf_token %} - - {% render_table table table_template|default:'table.html' %} - {% if perms.dcim.change_devicetype %} - - {% endif %} - {% if perms.dcim.delete_devicetype %} - - {% endif %} -
-{% else %} - {% render_table table table_template|default:'table.html' %} -{% endif %} diff --git a/netbox/templates/dcim/inc/manufacturer_table.html b/netbox/templates/dcim/inc/manufacturer_table.html deleted file mode 100644 index a2d8ce2ac..000000000 --- a/netbox/templates/dcim/inc/manufacturer_table.html +++ /dev/null @@ -1,14 +0,0 @@ -{% load render_table from django_tables2 %} -{% if perms.dcim.delete_manufacturer %} -
- {% csrf_token %} - - {% render_table table table_template|default:'table.html' %} - -
-{% else %} - {% render_table table table_template|default:'table.html' %} -{% endif %} diff --git a/netbox/templates/dcim/inc/platform_table.html b/netbox/templates/dcim/inc/platform_table.html deleted file mode 100644 index 503f8c34b..000000000 --- a/netbox/templates/dcim/inc/platform_table.html +++ /dev/null @@ -1,14 +0,0 @@ -{% load render_table from django_tables2 %} -{% if perms.dcim.delete_platform %} -
- {% csrf_token %} - - {% render_table table table_template|default:'table.html' %} - -
-{% else %} - {% render_table table table_template|default:'table.html' %} -{% endif %} diff --git a/netbox/templates/dcim/inc/rack_table.html b/netbox/templates/dcim/inc/rack_table.html deleted file mode 100644 index b0818d1f7..000000000 --- a/netbox/templates/dcim/inc/rack_table.html +++ /dev/null @@ -1,22 +0,0 @@ -{% load render_table from django_tables2 %} -{% if perms.dcim.change_rack or perms.dcim.delete_rack %} -
- {% csrf_token %} - - {% render_table table table_template|default:'table.html' %} - {% if perms.dcim.change_rack %} - - {% endif %} - {% if perms.dcim.delete_rack %} - - {% endif %} -
-{% else %} - {% render_table table table_template|default:'table.html' %} -{% endif %} diff --git a/netbox/templates/dcim/inc/rackgroup_table.html b/netbox/templates/dcim/inc/rackgroup_table.html deleted file mode 100644 index 0995221eb..000000000 --- a/netbox/templates/dcim/inc/rackgroup_table.html +++ /dev/null @@ -1,14 +0,0 @@ -{% load render_table from django_tables2 %} -{% if perms.dcim.delete_rackgroup %} -
- {% csrf_token %} - - {% render_table table table_template|default:'table.html' %} - -
-{% else %} - {% render_table table table_template|default:'table.html' %} -{% endif %} diff --git a/netbox/templates/dcim/manufacturer_list.html b/netbox/templates/dcim/manufacturer_list.html index 6cbe1092f..9a6f15427 100644 --- a/netbox/templates/dcim/manufacturer_list.html +++ b/netbox/templates/dcim/manufacturer_list.html @@ -15,7 +15,7 @@

Manufacturers

- {% include 'dcim/inc/manufacturer_table.html' %} + {% include 'utilities/obj_table.html' with bulk_delete_url='dcim:manufacturer_bulk_delete' %}
{% endblock %} diff --git a/netbox/templates/dcim/platform_list.html b/netbox/templates/dcim/platform_list.html index 498ab7a97..8f5f40ad9 100644 --- a/netbox/templates/dcim/platform_list.html +++ b/netbox/templates/dcim/platform_list.html @@ -15,7 +15,7 @@

Platforms

- {% include 'dcim/inc/platform_table.html' %} + {% include 'utilities/obj_table.html' with bulk_delete_url='dcim:platform_bulk_delete' %}
{% endblock %} diff --git a/netbox/templates/dcim/rack_list.html b/netbox/templates/dcim/rack_list.html index a80e40fd2..393d686e8 100644 --- a/netbox/templates/dcim/rack_list.html +++ b/netbox/templates/dcim/rack_list.html @@ -32,7 +32,7 @@

Racks

- {% include 'dcim/inc/rack_table.html' %} + {% include 'utilities/obj_table.html' with bulk_edit_url='dcim:rack_bulk_edit' bulk_delete_url='dcim:rack_bulk_delete' %}
diff --git a/netbox/templates/dcim/rackgroup_list.html b/netbox/templates/dcim/rackgroup_list.html index 32373e289..e0a1e59f3 100644 --- a/netbox/templates/dcim/rackgroup_list.html +++ b/netbox/templates/dcim/rackgroup_list.html @@ -15,7 +15,7 @@

Rack Groups

- {% include 'dcim/inc/rackgroup_table.html' %} + {% include 'utilities/obj_table.html' with bulk_delete_url='dcim:rackgroup_bulk_delete' %}
{% include 'inc/filter_panel.html' %} diff --git a/netbox/templates/secrets/inc/secret_table.html b/netbox/templates/secrets/inc/secret_table.html deleted file mode 100644 index ce97aa6d2..000000000 --- a/netbox/templates/secrets/inc/secret_table.html +++ /dev/null @@ -1,22 +0,0 @@ -{% load render_table from django_tables2 %} -{% if perms.secrets.change_secret or perms.secrets.delete_secret %} -
- {% csrf_token %} - - {% render_table table table_template|default:'table.html' %} - {% if perms.secret.change_secret %} - - {% endif %} - {% if perms.secret.delete_secret %} - - {% endif %} -
-{% else %} - {% render_table table table_template|default:'table.html' %} -{% endif %} diff --git a/netbox/templates/secrets/inc/secretrole_table.html b/netbox/templates/secrets/inc/secretrole_table.html deleted file mode 100644 index 6e110bda7..000000000 --- a/netbox/templates/secrets/inc/secretrole_table.html +++ /dev/null @@ -1,14 +0,0 @@ -{% load render_table from django_tables2 %} -{% if perms.secrets.delete_secretrole %} -
- {% csrf_token %} - - {% render_table table table_template|default:'table.html' %} - -
-{% else %} - {% render_table table table_template|default:'table.html' %} -{% endif %} diff --git a/netbox/templates/secrets/secret_list.html b/netbox/templates/secrets/secret_list.html index 9a0182a8c..c9a785084 100644 --- a/netbox/templates/secrets/secret_list.html +++ b/netbox/templates/secrets/secret_list.html @@ -15,7 +15,7 @@

Secrets

- {% include 'secrets/inc/secret_table.html' %} + {% include 'utilities/obj_table.html' with bulk_edit_url='secrets:secret_bulk_edit' bulk_delete_url='secrets:secret_bulk_delete' %}
{% include 'inc/filter_panel.html' %} diff --git a/netbox/templates/secrets/secretrole_list.html b/netbox/templates/secrets/secretrole_list.html index 62941fde0..2ad708248 100644 --- a/netbox/templates/secrets/secretrole_list.html +++ b/netbox/templates/secrets/secretrole_list.html @@ -15,7 +15,7 @@

Device Roles

- {% include 'secrets/inc/secretrole_table.html' %} + {% include 'utilities/obj_table.html' with bulk_delete_url='secrets:secretrole_bulk_delete' %}
{% endblock %}