diff --git a/CHANGELOG.md b/CHANGELOG.md index ab02a89..50deb18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * [142](https://github.com/mlebreuil/netbox-contract/issues/142) Gives the option to enter contract yearly recuring costs instead of only monthly recuring costs. Corresponding value is used to calculate the invoices amount without rounding approximations. +* [148](https://github.com/mlebreuil/netbox-contract/issues/148) Update tables format to match the new Netbox UI design. ### Version 2.2.0 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 %}