Moved some templates around and added styling

This commit is contained in:
Harry Bridge
2018-07-16 00:28:42 +01:00
parent 116b228de3
commit 44d84f10c9
3 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
{% extends 'base.html' %}
{% block main %}
<h1>Asset Detail</h1>
{{ object.description }}
<br>
{{ object.category.name }}
<br>
{{ object.status.name }}
<br>
{{ object.purchased_from.name }}
<br>
<a href="{% url 'asset_update' object.pk %}">Edit</a>
<br>
<a href="{% url 'asset_delete' object.pk %}">Delete</a>
{% endblock %}

15
templates/asset_form.html Normal file
View File

@@ -0,0 +1,15 @@
{% extends 'base.html' %}
{% block main %}
<h1>Asset {{ form_header|default:'Create' }}</h1>
<form method="post">
{{ form }}
{% csrf_token %}
<button type="submit">Submit</button>
</form>
{% endblock %}

34
templates/asset_list.html Normal file
View File

@@ -0,0 +1,34 @@
{% extends 'base.html' %}
{% block main %}
<h1>Asset List</h1>
<table>
<thead>
<tr>
<th>Asset ID</th>
<th>Description</th>
<th>Category</th>
<th>Status</th>
<th>Quick Links</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
{# <li><a href="{% url 'asset_detail' item.pk %}">{{ item.asset_id }} - {{ item.description }}</a></li>#}
<tr>
<td><a href="{% url 'asset_detail' item.pk %}">{{ item.asset_id }}</a></td>
<td>{{ item.description }}</td>
<td>{{ item.category }}</td>
<td>{{ item.status }}</td>
<td>
<a href="{% url 'asset_detail' item.asset_id %}"><i class="material-icons">visibility</i></a>
<a href="{% url 'asset_update' item.asset_id %}"><i class="material-icons">edit</i></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}