Consolidate visual style for "Part" tabs

This commit is contained in:
Oliver Walters 2019-06-19 07:58:14 +10:00
parent 3e6cdb15be
commit afcbd73026
8 changed files with 69 additions and 64 deletions

View File

@ -3,7 +3,7 @@
{% block form %} {% block form %}
<h4> <h4>
Step 1 of 2 - Select Parts Step 1 of 2 - Select Part Suppliers
</h4> </h4>
{% if parts|length > 0 %} {% if parts|length > 0 %}

View File

@ -5,25 +5,26 @@
{% include 'part/tabs.html' with tab='attachments' %} {% include 'part/tabs.html' with tab='attachments' %}
<div class='row'>
<div class='col-sm-6'>
<h4>Part Attachments</h4> <h4>Part Attachments</h4>
</div>
<div class='col-sm-6'>
<div class="btn-group" style="float: right;">
<button type='button' class='btn btn-success' id='new-attachment'>Add Attachment</button>
</div>
</div>
</div>
<hr> <hr>
<table class='table table-striped table-condensed' data-toolbar='#toolbar' id='attachment-table'> <div id='attachment-buttons'>
<div class="btn-group">
<button type='button' class='btn btn-success' id='new-attachment'>Add Attachment</button>
</div>
</div>
<table class='table table-striped table-condensed' data-toolbar='#attachment-buttons' id='attachment-table'>
<thead>
<tr> <tr>
<th>File</th> <th data-field='file' data-searchable='true'>File</th>
<th>Comment</th> <th data-field='comment' data-searchable='true'>Comment</th>
<th></th> <th></th>
</tr> </tr>
</thead>
<tbody>
{% for attachment in part.attachments.all %} {% for attachment in part.attachments.all %}
<tr> <tr>
<td><a href='/media/{{ attachment.attachment }}'>{{ attachment.basename }}</a></td> <td><a href='/media/{{ attachment.attachment }}'>{{ attachment.basename }}</a></td>
@ -36,6 +37,7 @@
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
{% if part.variant_of and part.variant_of.attachments.count > 0 %} {% if part.variant_of and part.variant_of.attachments.count > 0 %}
<tr> <tr>
<td colspan='3'> <td colspan='3'>
@ -83,4 +85,9 @@
}); });
}); });
$("#attachment-table").bootstrapTable({
search: true,
sortable: true,
});
{% endblock %} {% endblock %}

View File

@ -4,9 +4,12 @@
{% include 'part/tabs.html' with tab='detail' %} {% include 'part/tabs.html' with tab='detail' %}
<h4>Part Details</h4>
<hr>
<div class='row'> <div class='row'>
<div class='col-sm-6'> <div class='col-sm-6'>
<h4>Part Details</h4>
<table class='table table-striped'> <table class='table table-striped'>
<tr> <tr>
<td><b>Part name</b></td> <td><b>Part name</b></td>
@ -75,7 +78,6 @@
</table> </table>
</div> </div>
<div class='col-sm-6'> <div class='col-sm-6'>
<h4>Part Type</h4>
<table class='table table-striped'> <table class='table table-striped'>
<tr> <tr>
<td><b>Virtual</b></td> <td><b>Virtual</b></td>

View File

@ -5,15 +5,16 @@
{% include 'part/tabs.html' with tab='orders' %} {% include 'part/tabs.html' with tab='orders' %}
<div class='row'> <h4>Part Orders</h4>
<div class='col-sm-6'> <hr>
<h4>Open Part Orders</h4>
</div> <div id='button-bar'>
<div class='col-sm-6'> <div class='btn-group'>
<button class='btn btn-primary' type='button' id='part-order-2' title='Order part'>Order Part</button>
</div> </div>
</div> </div>
{% include "order/po_table.html" with orders=part.open_purchase_orders %} {% include "order/po_table.html" with orders=part.open_purchase_orders toolbar='#button-bar' %}
{% if part.closed_purchase_orders|length > 0 %} {% if part.closed_purchase_orders|length > 0 %}
<h4>Closed Orders</h4> <h4>Closed Orders</h4>
@ -21,3 +22,21 @@
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block js_ready %}
{{ block.super }}
$("#po-table").bootstrapTable({
search: true,
sortable: true,
});
$("#part-order-2").click(function() {
launchModalForm("/order/purchase-order/order-parts/", {
data: {
part: {{ part.id }},
},
});
});
{% endblock %}

View File

@ -4,13 +4,7 @@
{% include 'part/tabs.html' with tab='stock' %} {% include 'part/tabs.html' with tab='stock' %}
<div class='row'>
<div class='col-sm-6'>
<h4>Part Stock</h4> <h4>Part Stock</h4>
</div>
<div class='col-sm-6'>
</div>
</div>
<hr> <hr>
{% if part.is_template %} {% if part.is_template %}

View File

@ -4,14 +4,7 @@
{% include 'part/tabs.html' with tab='suppliers' %} {% include 'part/tabs.html' with tab='suppliers' %}
<div class='row'>
<div class='col-sm-6'>
<h4>Part Suppliers</h4> <h4>Part Suppliers</h4>
</div>
<div class='col-sm-6'>
</div>
</div>
<hr> <hr>
<div id='button-toolbar'> <div id='button-toolbar'>

View File

@ -49,5 +49,3 @@
<a href="{% url 'part-attachments' part.id %}">Attachments {% if part.attachment_count > 0 %}<span class="badge">{{ part.attachment_count }}</span>{% endif %}</a> <a href="{% url 'part-attachments' part.id %}">Attachments {% if part.attachment_count > 0 %}<span class="badge">{{ part.attachment_count }}</span>{% endif %}</a>
</li> </li>
</ul> </ul>
<br>

View File

@ -4,15 +4,7 @@
{% include 'part/tabs.html' with tab='used' %} {% include 'part/tabs.html' with tab='used' %}
<div class='row'> <h4>Assemblies</h4>
<div class='col-sm-6'>
<h4>Used to Build</h4>
</div>
<div class='col-sm-6'>
<div class="btn-group" style="float: right;">
</div>
</div>
</div>
<hr> <hr>