Add some pretty buttons to the purchase order detail table

This commit is contained in:
Oliver Walters 2019-06-13 21:44:09 +10:00
parent a37a2120fa
commit d860336060
3 changed files with 31 additions and 3 deletions

View File

@ -79,20 +79,40 @@ InvenTree | {{ order }}
<th data-field='sku'>Order Code</th>
<th data-field='reference'>Reference</th>
<th data-field='quantity'>Quantity</th>
{% if not order.status == OrderStatus.PENDING %}
<th data-field='received'>Received</th>
{% endif %}
<th data-field='buttons'></th>
</tr>
{% for line in order.lines.all %}
<tr>
<td>{{ forloop.counter }}</td>
<td>
{{ forloop.counter }}
</td>
{% if line.part %}
<td><a href="{% url 'part-detail' line.part.part.id %}">{{ line.part.part.full_name }}</a></td>
<td>
{% include "hover_image.html" with image=line.part.part.image hover=True %}
<a href="{% url 'part-detail' line.part.part.id %}">{{ line.part.part.full_name }}</a>
</td>
<td><a href="{% url 'supplier-part-detail' line.part.id %}">{{ line.part.SKU }}</a></td>
{% else %}
<td colspan='2'><strong>Warning: Part has been deleted.</strong></td>
{% endif %}
<td>{{ line.reference }}</td>
<td>{{ line.quantity }}</td>
{% if not order.status == OrderStatus.PENDING %}
<td>{{ line.received }}</td>
{% endif %}
<td>
<div class='btn-group'>
<button class='btn btn-default btn-edit' id='edit-line-item-{{ line.id }}' line='{{ line.id }}' title='Edit line item' onclick='editPurchaseOrderLineItem'>
<span class='glyphicon glyphicon-small glyphicon-edit'></span>
</button>
<button class='btn btn-default btn-remove' id='remove-line-item-{{ line.id }' title='Remove line item' type='button' onclick='removePurchaseOrderLineItem'>
<span class='glyphicon glyphicon-small glyphicon-remove'></span>
</button>
</div>
</td>
</tr>
{% endfor %}
</table>

View File

@ -299,6 +299,14 @@
color: #1A1;
}
.btn-edit {
padding: 3px;
padding: 3px;
padding-left: 5px;
padding-right: 5px;
color: #55E;
}
.button-toolbar {
padding-left: 0px;
}

View File

@ -5,7 +5,7 @@
<a class='hover-icon'>
{% endif %}
<img class='hover-img-thumb' {% if image %}src='{{ image.url }}'{% else %}src='{% static "img/blank_image.png" %}'{% endif %}>
{% if hover %}
{% if hover and image %}
<img class='hover-img-large' {% if image %}src='{{ image.url }}'{% else %}src='{% static "img/blank_image.png" %}'{% endif %}>
</a>
{% endif %}