Show part lots on part's info page.

This commit is contained in:
Jan Böhmer 2019-08-16 22:54:23 +02:00
parent c2b43f2cfa
commit 7517d83f55
7 changed files with 312 additions and 44 deletions

View file

@ -24,10 +24,10 @@
<span class="text-muted">{{ part.storelocation.fullPath ?? "-"}}</span>
</h6> #}
<h6><i class="fas fa-shapes fa-fw"></i>
<span class="text-muted"> {#
<span title="{% trans %}instock.label{% endtrans %}">{{ part.instock }}</span> #}
<span class="text-muted">
<span title="{% trans %}instock.label{% endtrans %}">{{ part.amountSum }}</span>
/
<span title="{% trans %}mininstock.label{% endtrans %}">{{ part.mininstock }}</span>
<span title="{% trans %}mininstock.label{% endtrans %}">{{ part.minAmount }}</span>
</span>
</h6>
<h6 class="" title="{% trans %}footprint.label{% endtrans %}">

View file

@ -0,0 +1,55 @@
<table class="table table-striped table-hover">
<thead>
<tr>
<th>{% trans %}part_lots.description{% endtrans %}</th>
<th>{% trans %}part_lots.storage_location{% endtrans %}</th>
<th>{% trans %}part_lots.amount{% endtrans %}</th>
<th></th> {# Tags row #}
<th></th>
</tr>
</thead>
<tbody>
{% for lot in part.partLots %}
<tr>
<td>{{ lot.description }}</td>
<td>
{{ lot.storageLocation.fullPath }}
</td>
<td>
{% if lot.instockUnknown %}
<span class="badge badge-pill badge-warning">
<i class="fas fa-question-circle fa-fw"></i> {% trans %}part_lots.instock_unknown{% endtrans %}
</span>
{% else %}
{{ lot.amount }}
{% endif %}
</td>
<td>
<h6>
{% if lot.expirationDate %}
<span class="badge badge-info" title="{% trans %}part_lots.expiration_date{% endtrans %}">
<i class="fas fa-calendar-alt fa-fw"></i> {{ lot.expirationDate | localizeddate }}
</span>
{% endif %}
{% if lot.expired %}
<br>
<span class="badge badge-warning">
<i class="fas fa-exclamation-circle fa-fw"></i>
{% trans %}part_lots.is_expired{% endtrans %}
</span>
{% endif %}
{% if lot.needsRefill %}
<br>
<span class="badge badge-warning">
<i class="fas fa-dolly fa-fw"></i>
{% trans %}part_lots.need_refill{% endtrans %}
</span>
{% endif %}
</h6>
</td>
</tr>
{% endfor %}
</tbody>
</table>

View file

@ -28,9 +28,19 @@
<div class="">
<div class="">
<ul class="nav nav-tabs" id="partTab" role="tablist">
{% if part.partLots %}
<li class="nav-item">
<a class="nav-link active" id="part_lots-tab" data-toggle="tab"
href="#part_lots" role="tab">
<i class="fas fa-box fa-fw"></i>
{% trans %}part.part_lots.label{% endtrans %}
</a>
</li>
{% endif %}
{% if part.comment is not empty %}
<li class="nav-item">
<a class="nav-link active" id="comment-tab" data-toggle="tab"
<a class="nav-link" id="comment-tab" data-toggle="tab"
href="#comment" role="tab">
<i class="fas fa-comment-alt fa-fw"></i>
{% trans %}comment.label{% endtrans %}
@ -38,7 +48,7 @@
</li>
{% endif %}
<li class="nav-item">
<a class="nav-link {% if part.comment is empty%} active{% endif %}" id="attachment-tab" data-toggle="tab"
<a class="nav-link" id="attachment-tab" data-toggle="tab"
href="#attachments" role="tab">
<i class="fas fa-paperclip fa-fw"></i>
{% trans %}attachment.labelp{% endtrans %}
@ -78,25 +88,30 @@
</div>
</div>
{% endif %}
<div class="tab-pane fade {% if part.comment is empty %} show active{% endif %}" id="attachments" role="tabpanel" aria-labelledby="profile-tab">
<div class="tab-pane fade show active" id="part_lots" role="tabpanel" aria-labelledby="part_lots-tab">
{% include "Parts/info/_part_lots.html.twig" %}
</div>
<div class="tab-pane fade" id="attachments" role="tabpanel" aria-labelledby="attachment-tab">
{% include "Parts/info/_attachments_info.html.twig" %}
</div>
<div class="tab-pane fade" id="suppliers" role="tabpanel" aria-labelledby="profile-tab">
<div class="tab-pane fade" id="suppliers" role="tabpanel" aria-labelledby="supplier-tab">
{% include "Parts/info/_order_infos.html.twig" %}
</div>
<div class="tab-pane fade" id="history" role="tabpanel" aria-labelledby="profile-tab">
<div class="tab-pane fade" id="history" role="tabpanel" aria-labelledby="history-tab">
TODO
</div>
<div class="tab-pane fade" id="tools" role="tabpanel" aria-labelledby="contact-tab">
<div class="tab-pane fade" id="tools" role="tabpanel" aria-labelledby="tools-tab">
{% include "Parts/info/_tools.html.twig" %}
</div>
<div class="tab-pane fade" id="extended_info" role="tabpanel" aria-labelledby="contact-tab">
<div class="tab-pane fade" id="extended_info" role="tabpanel" aria-labelledby="extended_info-tab">
{% include "Parts/info/_extended_infos.html.twig" %}