Files
centurion_erp/app/itam/templates/itam/device_index.html.j2
Jon 95a08b2d2c refactor: adjust template block names
renamed so they make sense

!20
2024-06-07 20:01:56 +09:30

66 lines
2.0 KiB
Django/Jinja

{% extends 'base.html.j2' %}
{% block title %}Devices{% endblock %}
{% block content_header_icon %}{% endblock %}
{% block content %}
<input type="button" value="New Device" onclick="window.location='{% url 'ITAM:_device_add' %}';">
<table class="data">
<tr>
<th>Name</th>
<th>Device Type</th>
<th>Manufacturer</th>
<th>Model</th>
<th>Organization</th>
<th>&nbsp;</th>
</tr>
{% for device in devices %}
<tr>
<td><a href="{% url 'ITAM:_device_view' pk=device.id %}">{{ device.name }}</a></td>
<td>
{% if device.device_type %}
{{ device.device_type }}
{% else %}
-
{% endif %}
</td>
<td>
{% if device.device_model.manufacturer %}
<a href="{% url 'Settings:_manufacturer_view' pk=device.device_model.manufacturer.id %}">{{ device.device_model.manufacturer }}</a>
{% else %}
-
{% endif %}
</td>
<td>
{% if device.device_model.name %}
<a href="{% url 'Settings:_device_model_view' pk=device.device_model.id %}">{{ device.device_model.name }}</a>
{% else %}
-
{% endif %}
</td>
<td>{% if software.is_global %}Global{% else %}{{ device.organization }}{% endif %}</td>
<td>&nbsp;</td>
</tr>
{% endfor %}
</table>
<div class="pagination">
<span class="step-links">
{% if page_obj.has_previous %}
<a href="?page=1">&laquo; first</a>
<a href="?page={{ page_obj.previous_page_number }}">previous</a>
{% endif %}
<span class="current">
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
</span>
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}">next</a>
<a href="?page={{ page_obj.paginator.num_pages }}">last &raquo;</a>
{% endif %}
</span>
</div>
{% endblock %}