mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-02 01:04:41 +02:00
97 lines
No EOL
4.8 KiB
Twig
97 lines
No EOL
4.8 KiB
Twig
{% import "helper.twig" as helper %}
|
|
{% import "LabelSystem/dropdown_macro.html.twig" as dropdown %}
|
|
|
|
{% include "Parts/info/_withdraw_modal.html.twig" %}
|
|
|
|
<div class="table-responsive">
|
|
<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>
|
|
<th></th> {# Button row #}
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
{% for lot in part.partLots %}
|
|
<tr>
|
|
<td>{{ lot.description }}</td>
|
|
<td>
|
|
{% if lot.storageLocation %}
|
|
{{ helper.structural_entity_link(lot.storageLocation) }}
|
|
{% else %}
|
|
<span class="badge rounded-pill bg-warning">
|
|
<i class="fas fa-question-circle fa-fw"></i> {% trans %}part_lots.location_unknown{% endtrans %}
|
|
</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if lot.instockUnknown %}
|
|
<span class="badge rounded-pill bg-warning">
|
|
<i class="fas fa-question-circle fa-fw"></i> {% trans %}part_lots.instock_unknown{% endtrans %}
|
|
</span>
|
|
{% else %}
|
|
{{ lot.amount | format_amount(part.partUnit, {'decimals': 5}) }}
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<h6>
|
|
{% if lot.expirationDate %}
|
|
<span class="badge bg-info" title="{% trans %}part_lots.expiration_date{% endtrans %}">
|
|
<i class="fas fa-calendar-alt fa-fw"></i> {{ lot.expirationDate | format_date() }}
|
|
</span>
|
|
{% endif %}
|
|
{% if lot.expired %}
|
|
<br>
|
|
<span class="badge bg-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 bg-warning">
|
|
<i class="fas fa-dolly fa-fw"></i>
|
|
{% trans %}part_lots.need_refill{% endtrans %}
|
|
</span>
|
|
{% endif %}
|
|
</h6>
|
|
</td>
|
|
<td>
|
|
<div class="btn-group" role="group">
|
|
<button type="button" class="btn btn-outline-primary" data-bs-toggle="modal" data-bs-target="#withdraw-modal"
|
|
data-action="withdraw" data-lot-id="{{ lot.id }}" data-lot-amount="{{ lot.amount }}"
|
|
title="{% trans %}part.info.withdraw_modal.title.withdraw{% endtrans %}"
|
|
{% if not is_granted('withdraw', lot) or not withdraw_add_helper.canWithdraw(lot) %}disabled{% endif %}
|
|
>
|
|
<i class="fa-solid fa-minus fa-fw"></i>
|
|
</button>
|
|
<button type="button" class="btn btn-outline-primary" data-bs-toggle="modal" data-bs-target="#withdraw-modal"
|
|
data-action="add" data-lot-id="{{ lot.id }}" data-lot-amount="{{ lot.amount }}"
|
|
title="{% trans %}part.info.withdraw_modal.title.add{% endtrans %}"
|
|
{% if not is_granted('add', lot) or not withdraw_add_helper.canAdd(lot) %}disabled{% endif %}
|
|
>
|
|
<i class="fa-solid fa-plus fa-fw"></i>
|
|
</button>
|
|
<button type="button" class="btn btn-outline-primary" data-bs-toggle="modal" data-bs-target="#withdraw-modal"
|
|
data-action="move" data-lot-id="{{ lot.id }}" data-lot-amount="{{ lot.amount }}"
|
|
title="{% trans %}part.info.withdraw_modal.title.move{% endtrans %}"
|
|
{% if not is_granted('move', lot) or not withdraw_add_helper.canWithdraw(lot) or part.partLots.count == 1 %}disabled{% endif %}
|
|
>
|
|
<i class="fa-solid fa-right-left fa-fw"></i>
|
|
</button>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
{{ dropdown.profile_dropdown('part_lot', lot.id, false) }}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
|
|
</table>
|
|
</div> |