reformat the computer list to a table instead of a list

This commit is contained in:
Andreas Zweili 2017-12-25 23:55:07 +01:00
parent 5f00b2de26
commit ffa545110b
2 changed files with 28 additions and 10 deletions

View File

@ -539,16 +539,25 @@ information.
{% extends "inventory/base.html" %}
{% block content %}
{% if device_list or computer_list %}
<h3>Device List</h3>
<ul>
{% for device in device_list %}
<li><a href="{% url 'device' device.id %}">{{ device.name }}</a></li>
{% endfor %}
{% for computer in computer_list %}
<li><a href="{% url 'computer' computer.id %}">{{ computer.name }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>No devices are available.</p>
<h3>Computer List</h3>
<table>
<tr>
<th>Hostname</th>
<th>IP</th>
</tr>
{% for computer in computer_list %}
<tr>
<td><a href="{% url 'computer' computer.id %}">{{ computer.name }}</a></td>
<td>{{ computer.ip }}</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% endblock %}
#+END_SRC

View File

@ -1,15 +1,24 @@
{% extends "inventory/base.html" %}
{% block content %}
{% if device_list or computer_list %}
<h3>Device List</h3>
<ul>
{% for device in device_list %}
<li><a href="{% url 'device' device.id %}">{{ device.name }}</a></li>
{% endfor %}
{% for computer in computer_list %}
<li><a href="{% url 'computer' computer.id %}">{{ computer.name }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>No devices are available.</p>
<h3>Computer List</h3>
<table>
<tr>
<th>Hostname</th>
<th>IP</th>
</tr>
{% for computer in computer_list %}
<tr>
<td><a href="{% url 'computer' computer.id %}">{{ computer.name }}</a></td>
<td>{{ computer.ip }}</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% endblock %}