Highlight amount sum in part tables and part info page, when amount is less than minAmount

This commit is contained in:
Jan Böhmer 2023-04-03 23:15:29 +02:00
parent 69fdc85c99
commit 5330476dbe
4 changed files with 29 additions and 5 deletions

View file

@ -41,11 +41,14 @@
<span class="text-muted">{{ helper.structural_entity_link(part.category) }}</span>
</h6>
<h6><i class="fas fa-shapes fa-fw"></i>
<span class="text-muted">
<span title="{% trans %}instock.label{% endtrans %}">{{ part.amountSum | format_amount(part.partUnit) }}</span>
/
<span title="{% trans %}mininstock.label{% endtrans %}">{{ part.minAmount | format_amount(part.partUnit) }}</span>
</span>
<span class="{% if part.notEnoughInstock %}text-danger font-weight-bold{% else %}text-muted{% endif %}">
<span title="{% trans %}instock.label{% endtrans %}">{{ part.amountSum | format_amount(part.partUnit) }}</span>
/
<span title="{% trans %}mininstock.label{% endtrans %}">{{ part.minAmount | format_amount(part.partUnit) }}</span>
</span>
{% if part.notEnoughInstock %}
<span class="badge badge-warning bg-warning rounded-pill"><i class="fa-solid fa-less-than-equal"></i>&nbsp;{% trans %}part.info.amount.less_than_desired{% endtrans %}</span>
{% endif %}
</h6>
<h6 class="">
<i class="fas fa-microchip fa-fw" title="{% trans %}footprint.label{% endtrans %}"></i>