From 5806aeda9fc7e2a48d27d7064815483adcdb60ea Mon Sep 17 00:00:00 2001 From: Marc Lebreuil Date: Mon, 12 Aug 2024 19:55:50 +0000 Subject: [PATCH] Close issue 148 Changes to be committed: modified: src/netbox_contract/tables.py modified: src/netbox_contract/templates/contract_assignments_bottom.html deleted: src/netbox_contract/templates/contract_assignments_bottom_old.html modified: src/netbox_contract/templates/netbox_contract/contract.html --- src/netbox_contract/tables.py | 5 ++-- .../contract_assignments_bottom.html | 20 ++++++++-------- .../contract_assignments_bottom_old.html | 23 ------------------- .../templates/netbox_contract/contract.html | 16 +++++++------ 4 files changed, 23 insertions(+), 41 deletions(-) delete mode 100644 src/netbox_contract/templates/contract_assignments_bottom_old.html diff --git a/src/netbox_contract/tables.py b/src/netbox_contract/tables.py index 95ea92b..acbfe06 100644 --- a/src/netbox_contract/tables.py +++ b/src/netbox_contract/tables.py @@ -42,14 +42,15 @@ class Meta(NetBoxTable.Meta): class ContractAssignmentObjectTable(NetBoxTable): contract = tables.Column(linkify=True) actions = columns.ActionsColumn(actions=('edit', 'delete')) - contract__external_partie_object = tables.Column(linkify=True) + contract__external_partie_object = tables.Column( + verbose_name='Partner', linkify=True + ) class Meta(NetBoxTable.Meta): model = ContractAssignment fields = ( 'pk', 'contract', - 'contract__external_partie_object_type', 'contract__external_partie_object', 'contract__status', 'contract__start_date', diff --git a/src/netbox_contract/templates/contract_assignments_bottom.html b/src/netbox_contract/templates/contract_assignments_bottom.html index a03fcc6..b919c19 100644 --- a/src/netbox_contract/templates/contract_assignments_bottom.html +++ b/src/netbox_contract/templates/contract_assignments_bottom.html @@ -3,18 +3,20 @@
-
Contracts Assignments
+
+ Contracts Assignments + {% if perms.netbox_contract.add_contractassignment %} + + {% endif %} +
{% if assignments_table %} {% render_table assignments_table %} {% endif %} - {% if perms.netbox_contract.add_contractassignment %} - - {% endif %}
diff --git a/src/netbox_contract/templates/contract_assignments_bottom_old.html b/src/netbox_contract/templates/contract_assignments_bottom_old.html deleted file mode 100644 index e103047..0000000 --- a/src/netbox_contract/templates/contract_assignments_bottom_old.html +++ /dev/null @@ -1,23 +0,0 @@ -{% load render_table from django_tables2 %} -{% if perms.netbox_contract.view_contract %} -
-
-
-
Contracts Assignments
- {% if assignments_table %} -
- {% render_table assignments_table %} -
- {% endif %} - {% if perms.netbox_contract.add_contractassignment %} - - {% endif %} -
-
-
-{% endif %} \ No newline at end of file diff --git a/src/netbox_contract/templates/netbox_contract/contract.html b/src/netbox_contract/templates/netbox_contract/contract.html index 05a7adc..a53c2b3 100644 --- a/src/netbox_contract/templates/netbox_contract/contract.html +++ b/src/netbox_contract/templates/netbox_contract/contract.html @@ -142,16 +142,18 @@
childs
-
Invoices
- {% render_table invoices_table %} - {% if perms.netbox_contract.add_invoice %} - + {% endif %} + + {% render_table invoices_table %}