From c3ed952b5fe3155e61c38a0ba4518a4867877535 Mon Sep 17 00:00:00 2001 From: wkoot <3715211+wkoot@users.noreply.github.com> Date: Wed, 12 Feb 2025 23:30:55 +0100 Subject: [PATCH] Fix model detail view listing of linked objects (#56) Closes #55 Signed-off-by: wkoot <3715211+wkoot@users.noreply.github.com> --- CHANGELOG.md | 4 ++ .../templates/netbox_slm/softwarelicense.html | 16 +++---- .../templates/netbox_slm/softwareproduct.html | 48 ++++++++++++++----- .../softwareproductinstallation.html | 32 +++++++++---- .../netbox_slm/softwareproductversion.html | 40 +++++++++++++--- 5 files changed, 104 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20503c9..6ea93ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ * Support NetBox v4.2.3 (#51) +### Fixed + +* Model detail view listing of linked objects (#55) + ## [1.7.0](https://github.com/ICTU/netbox_slm/releases/tag/1.7.0) - 2024-07-09 ### Changed diff --git a/netbox_slm/templates/netbox_slm/softwarelicense.html b/netbox_slm/templates/netbox_slm/softwarelicense.html index b70bf91..0170edb 100644 --- a/netbox_slm/templates/netbox_slm/softwarelicense.html +++ b/netbox_slm/templates/netbox_slm/softwarelicense.html @@ -42,11 +42,11 @@ Software Product - {{ object.software_product }} + {{ object.software_product|linkify }} Version - {{ object.version }} + {{ object.version|linkify }} Support @@ -58,19 +58,19 @@ Installation - {{ object.installation }} + {{ object.installation|linkify }} - {% include 'inc/panels/custom_fields.html' %} - {% include 'inc/panels/tags.html' %} - {% include 'inc/panels/comments.html' %} - {% plugin_left_page object %} +{% include 'inc/panels/custom_fields.html' %} +{% include 'inc/panels/tags.html' %} +{% include 'inc/panels/comments.html' %} +{% plugin_left_page object %}
- {% plugin_full_width_page object %} +{% plugin_full_width_page object %}
{% endblock %} diff --git a/netbox_slm/templates/netbox_slm/softwareproduct.html b/netbox_slm/templates/netbox_slm/softwareproduct.html index 65cc24a..0337c94 100644 --- a/netbox_slm/templates/netbox_slm/softwareproduct.html +++ b/netbox_slm/templates/netbox_slm/softwareproduct.html @@ -22,31 +22,55 @@ Manufacturer - {{ object.manufacturer }} + {{ object.manufacturer|linkify }} Versions - {% for version in object.softwareproduct_versions.all %} - - {{ version }} +{% for version in object.softwareproductversion_set.all %} + + {{ version }} - {% empty %} - n/a - {% endfor %} +{% empty %} + None +{% endfor %} + + + + Installations + +{% for installation in object.softwareproductinstallation_set.all %} + + {{ installation }} + +{% empty %} + None +{% endfor %} + + + + Licenses + +{% for license in object.softwarelicense_set.all %} + + {{ license }} + +{% empty %} + None +{% endfor %} - {% include 'inc/panels/custom_fields.html' %} - {% include 'inc/panels/tags.html' %} - {% include 'inc/panels/comments.html' %} - {% plugin_left_page object %} +{% include 'inc/panels/custom_fields.html' %} +{% include 'inc/panels/tags.html' %} +{% include 'inc/panels/comments.html' %} +{% plugin_left_page object %}
- {% plugin_full_width_page object %} +{% plugin_full_width_page object %}
{% endblock %} diff --git a/netbox_slm/templates/netbox_slm/softwareproductinstallation.html b/netbox_slm/templates/netbox_slm/softwareproductinstallation.html index 735e7f5..ddc35b8 100644 --- a/netbox_slm/templates/netbox_slm/softwareproductinstallation.html +++ b/netbox_slm/templates/netbox_slm/softwareproductinstallation.html @@ -15,38 +15,50 @@ {% if object.device %} Device - {{ object.device }} + {{ object.device|linkify }} {% elif object.virtualmachine %} Virtualmachine - {{ object.virtualmachine }} + {{ object.virtualmachine|linkify }} {% else %} Cluster - {{ object.cluster }} + {{ object.cluster|linkify }} {% endif %} Software Product - {{ object.software_product }} + {{ object.software_product|linkify }} Version - {{ object.version }} + {{ object.version|linkify }} + + + Licenses + +{% for license in object.softwarelicense_set.all %} + + {{ license }} + +{% empty %} + None +{% endfor %} + - {% include 'inc/panels/custom_fields.html' %} - {% include 'inc/panels/tags.html' %} - {% include 'inc/panels/comments.html' %} - {% plugin_left_page object %} +{% include 'inc/panels/custom_fields.html' %} +{% include 'inc/panels/tags.html' %} +{% include 'inc/panels/comments.html' %} +{% plugin_left_page object %}
- {% plugin_full_width_page object %} +{% plugin_full_width_page object %}
{% endblock %} diff --git a/netbox_slm/templates/netbox_slm/softwareproductversion.html b/netbox_slm/templates/netbox_slm/softwareproductversion.html index 5477351..3cc2ca1 100644 --- a/netbox_slm/templates/netbox_slm/softwareproductversion.html +++ b/netbox_slm/templates/netbox_slm/softwareproductversion.html @@ -16,6 +16,14 @@ Name {{ object.name }} + + Software Product + {{ object.software_product|linkify }} + + + Manufacturer + {{ object.software_product.manufacturer|linkify }} + Release date {{ object.release_date }} @@ -50,19 +58,39 @@ Installations - {{ object.get_installation_count }} + +{% for installation in object.softwareproductinstallation_set.all %} + + {{ installation }} + +{% empty %} + None +{% endfor %} + + + + Licenses + +{% for license in object.softwarelicense_set.all %} + + {{ license }} + +{% empty %} + None +{% endfor %} + - {% include 'inc/panels/custom_fields.html' %} - {% include 'inc/panels/tags.html' %} - {% include 'inc/panels/comments.html' %} - {% plugin_left_page object %} +{% include 'inc/panels/custom_fields.html' %} +{% include 'inc/panels/tags.html' %} +{% include 'inc/panels/comments.html' %} +{% plugin_left_page object %}
- {% plugin_full_width_page object %} +{% plugin_full_width_page object %}
{% endblock %}