Fix model detail view listing of linked objects (#56)

Closes #55

Signed-off-by: wkoot <3715211+wkoot@users.noreply.github.com>
This commit is contained in:
wkoot
2025-02-12 23:30:55 +01:00
committed by GitHub
parent 87fdeb1c24
commit c3ed952b5f
5 changed files with 104 additions and 36 deletions
+4
View File
@@ -12,6 +12,10 @@
* Support NetBox v4.2.3 (#51) * 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 ## [1.7.0](https://github.com/ICTU/netbox_slm/releases/tag/1.7.0) - 2024-07-09
### Changed ### Changed
@@ -42,11 +42,11 @@
</tr> </tr>
<tr> <tr>
<th scope="row">Software Product</th> <th scope="row">Software Product</th>
<td>{{ object.software_product }}</td> <td>{{ object.software_product|linkify }}</td>
</tr> </tr>
<tr> <tr>
<th scope="row">Version</th> <th scope="row">Version</th>
<td>{{ object.version }}</td> <td>{{ object.version|linkify }}</td>
</tr> </tr>
<tr> <tr>
<th scope="row">Support</th> <th scope="row">Support</th>
@@ -58,7 +58,7 @@
</tr> </tr>
<tr> <tr>
<th scope="row">Installation</th> <th scope="row">Installation</th>
<td>{{ object.installation }}</td> <td>{{ object.installation|linkify }}</td>
</tr> </tr>
</table> </table>
</div> </div>
@@ -22,17 +22,41 @@
</tr> </tr>
<tr> <tr>
<th scope="row">Manufacturer</th> <th scope="row">Manufacturer</th>
<td>{{ object.manufacturer }}</td> <td>{{ object.manufacturer|linkify }}</td>
</tr> </tr>
<tr> <tr>
<th scope="row">Versions</th> <th scope="row">Versions</th>
<td> <td>
{% for version in object.softwareproduct_versions.all %} {% for version in object.softwareproductversion_set.all %}
<a href="{% url 'plugins:netbox_slm:softwareproductversion' pk=version.pk %}"> <a href="{% url 'plugins:netbox_slm:softwareproductversion' pk=version.pk %}" class="btn btn-sm">
<span class="badge" style="color: #ffffff; background-color: #9e9e9e">{{ version }}</span> {{ version }}
</a> </a>
{% empty %} {% empty %}
n/a None
{% endfor %}
</td>
</tr>
<tr>
<th scope="row">Installations</th>
<td>
{% for installation in object.softwareproductinstallation_set.all %}
<a href="{% url 'plugins:netbox_slm:softwareproductinstallation' pk=installation.pk %}" class="btn btn-sm">
{{ installation }}
</a>
{% empty %}
None
{% endfor %}
</td>
</tr>
<tr>
<th scope="row">Licenses</th>
<td>
{% for license in object.softwarelicense_set.all %}
<a href="{% url 'plugins:netbox_slm:softwarelicense' pk=license.pk %}" class="btn btn-sm">
{{ license }}
</a>
{% empty %}
None
{% endfor %} {% endfor %}
</td> </td>
</tr> </tr>
@@ -15,26 +15,38 @@
{% if object.device %} {% if object.device %}
<tr> <tr>
<th scope="row">Device</th> <th scope="row">Device</th>
<td>{{ object.device }}</td> <td>{{ object.device|linkify }}</td>
</tr> </tr>
{% elif object.virtualmachine %} {% elif object.virtualmachine %}
<tr> <tr>
<th scope="row">Virtualmachine</th> <th scope="row">Virtualmachine</th>
<td>{{ object.virtualmachine }}</td> <td>{{ object.virtualmachine|linkify }}</td>
</tr> </tr>
{% else %} {% else %}
<tr> <tr>
<th scope="row">Cluster</th> <th scope="row">Cluster</th>
<td>{{ object.cluster }}</td> <td>{{ object.cluster|linkify }}</td>
</tr> </tr>
{% endif %} {% endif %}
<tr> <tr>
<th scope="row">Software Product</th> <th scope="row">Software Product</th>
<td>{{ object.software_product }}</td> <td>{{ object.software_product|linkify }}</td>
</tr> </tr>
<tr> <tr>
<th scope="row">Version</th> <th scope="row">Version</th>
<td>{{ object.version }}</td> <td>{{ object.version|linkify }}</td>
</tr>
<tr>
<th scope="row">Licenses</th>
<td>
{% for license in object.softwarelicense_set.all %}
<a href="{% url 'plugins:netbox_slm:softwarelicense' pk=license.pk %}" class="btn btn-sm">
{{ license }}
</a>
{% empty %}
None
{% endfor %}
</td>
</tr> </tr>
</table> </table>
</div> </div>
@@ -16,6 +16,14 @@
<th scope="row">Name</th> <th scope="row">Name</th>
<td>{{ object.name }}</td> <td>{{ object.name }}</td>
</tr> </tr>
<tr>
<th scope="row">Software Product</th>
<td>{{ object.software_product|linkify }}</td>
</tr>
<tr>
<th scope="row">Manufacturer</th>
<td>{{ object.software_product.manufacturer|linkify }}</td>
</tr>
<tr> <tr>
<th scope="row">Release date</th> <th scope="row">Release date</th>
<td>{{ object.release_date }}</td> <td>{{ object.release_date }}</td>
@@ -50,7 +58,27 @@
</tr> </tr>
<tr> <tr>
<th scope="row">Installations</th> <th scope="row">Installations</th>
<td>{{ object.get_installation_count }}</td> <td>
{% for installation in object.softwareproductinstallation_set.all %}
<a href="{% url 'plugins:netbox_slm:softwareproductinstallation' pk=installation.pk %}" class="btn btn-sm">
{{ installation }}
</a>
{% empty %}
None
{% endfor %}
</td>
</tr>
<tr>
<th scope="row">Licenses</th>
<td>
{% for license in object.softwarelicense_set.all %}
<a href="{% url 'plugins:netbox_slm:softwarelicense' pk=license.pk %}" class="btn btn-sm">
{{ license }}
</a>
{% empty %}
None
{% endfor %}
</td>
</tr> </tr>
</table> </table>
</div> </div>