Added crud for suppliers

This commit is contained in:
Harry Bridge
2019-01-08 00:21:58 +00:00
parent 51aec6f597
commit f24a510a8e
7 changed files with 97 additions and 2 deletions

View File

@@ -0,0 +1,6 @@
{% extends 'base.html' %}
{% block title %}Detail{% endblock %}
{% block main %}
{{ object }}
{% endblock %}

View File

@@ -0,0 +1,29 @@
{% extends 'base.html' %}
{% block title %}List{% endblock %}
{% block main %}
<h4>Supplier List</h4>
<table class="striped">
<thead>
<tr>
<th>Supplier</th>
<th>Quick Links</th>
</tr>
</thead>
<tbody id="asset_table_body">
{% for item in object_list %}
<tr>
<td>{{ item.name }}</td>
<td>
<a href="{% url 'supplier_update' item.pk %}"><i class="material-icons">edit</i></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% include 'helpers/paginator.html' %}
{% endblock %}

View File

@@ -0,0 +1,24 @@
{% extends 'base.html' %}
{% block title %}Edit{% endblock %}
{% block main %}
<h4>
Supplier
{% if object %}
Edit | {{ object.name }}
{% else %}
Create
{% endif %}
</h4>
<div class="divider"></div>
<form method="post">
{% csrf_token %}
{{ form }}
<input type="submit" value="Save" class="btn">
</form>
{% endblock %}