Update supplier part detail page

- Consolidated buttons into dropdown
- Make look like other pages
This commit is contained in:
Oliver 2018-05-09 00:12:21 +10:00
parent 2c953c73fa
commit 233f093093

View File

@ -2,13 +2,32 @@
{% load static %} {% load static %}
{% block content %} {% block content %}
<h3>Supplier part information</h3> <div class='row'>
<div class='col-sm-6'>
<h3>Supplier Part</h3>
<p>{{ part.SKU }} - <a href="{% url 'company-detail' part.supplier.id %}">{{ part.supplier.name }}</a></p>
</div>
<div class='col-sm-6'>
<h3>
<div class="dropdown" style="float: right;">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Options
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#" id='edit-part' title='Edit supplier part'>Edit</a></li>
<li><a href="#" id='delete-part' title='Delete supplier part'>Delete</a></li>
</ul>
</div>
</h3>
</div>
</div>
<table class="table"> <hr>
<tr><td>SKU</td><td>{{ part.SKU }}</tr></tr>
<table class="table table-striped table-condensed">
<tr><td>Supplier</td><td><a href="{% url 'company-detail-parts' part.supplier.id %}">{{ part.supplier.name }}</a></td></tr> <tr><td>Supplier</td><td><a href="{% url 'company-detail-parts' part.supplier.id %}">{{ part.supplier.name }}</a></td></tr>
<tr><td>SKU</td><td>{{ part.SKU }}</tr></tr>
<tr> <tr>
<td>Parent Part</td> <td>Internal Part</td>
<td> <td>
{% if part.part %} {% if part.part %}
<a href="{% url 'part-suppliers' part.part.id %}">{{ part.part.name }}</a> <a href="{% url 'part-suppliers' part.part.id %}">{{ part.part.name }}</a>
@ -29,18 +48,13 @@
<br> <br>
<div class='container-fluid'>
<button class="btn btn-info" id='part-edit'>Edit supplier part</button>
<button class="btn btn-danger" id='part-delete'>Delete supplier part</button>
</div>
{% include 'modals.html' %} {% include 'modals.html' %}
{% endblock %} {% endblock %}
{% block js_ready %} {% block js_ready %}
{{ block.super }} {{ block.super }}
$('#part-edit').click(function () { $('#edit-part').click(function () {
launchModalForm( launchModalForm(
"{% url 'supplier-part-edit' part.id %}", "{% url 'supplier-part-edit' part.id %}",
{ {
@ -49,7 +63,7 @@
); );
}); });
$('#part-delete').click(function() { $('#delete-part').click(function() {
launchDeleteForm( launchDeleteForm(
"{% url 'supplier-part-delete' part.id %}", "{% url 'supplier-part-delete' part.id %}",
{ {