mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-04 10:14:44 +02:00
74 lines
No EOL
4.1 KiB
Twig
74 lines
No EOL
4.1 KiB
Twig
{% import "helper.twig" as helper %}
|
|
|
|
<div class="row">
|
|
<div class="col-md-3 col-lg-4 col-3 mt-auto mb-auto">
|
|
{% include "Parts/info/_picture.html.twig" %}
|
|
</div>
|
|
<div class="col-md-9 col-lg-8 col-7">
|
|
<h5 class="text-muted pt-2" title="{% trans %}manufacturer.label{% endtrans %}">
|
|
{% if part.manufacturer %}
|
|
{% if part.manufacturer.id is not null %}
|
|
<a href="{{ entity_url(part.manufacturer, 'list_parts') }}">{{ part.manufacturer.name}}</a>
|
|
{% else %}
|
|
{{ part.manufacturer.name }}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if part.manufacturerProductUrl %}
|
|
<small>
|
|
<a class="link-external" href="{{ part.manufacturerProductUrl }}" rel="noopener" target="_blank">{{ part.manufacturerProductNumber }}</a>
|
|
</small>
|
|
{% else %}
|
|
<small>{{ part.manufacturerProductNumber }}</small>
|
|
{% endif %}
|
|
</h5>
|
|
<h3 class="w-fit" title="{% trans %}name.label{% endtrans %}">{{ part.name }}
|
|
{# You need edit permission to use the edit button #}
|
|
{% if timeTravel is not null %}
|
|
<a href="{{ entity_url(part, 'info') }}"><i title="{% trans %}part.back_to_info{% endtrans %}" class="fas fa-fw fa-arrow-circle-left"></i></a>
|
|
{% elseif is_granted('edit', part) %}
|
|
<a href="{{ entity_url(part, 'edit') }}"><i class="fas fa-fw fa-sm fa-edit"></i></a>
|
|
{% endif %}
|
|
</h3>
|
|
<h6 class="text-muted w-fit" title="{% trans %}description.label{% endtrans %}"><span>{{ part.description|format_markdown(true) }}</span></h6>
|
|
<h6 class="">
|
|
<i class="fas fa-tag fa-fw" title="{% trans %}category.label{% endtrans %}"></i>
|
|
<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>
|
|
</h6>
|
|
<h6 class="">
|
|
<i class="fas fa-microchip fa-fw" title="{% trans %}footprint.label{% endtrans %}"></i>
|
|
<span class="text-muted">{{ helper.structural_entity_link(part.footprint) }}</span>
|
|
</h6>
|
|
|
|
{% set min_order_amount = pricedetail_helper.minOrderAmount(part) %}
|
|
{% set max_order_amount = pricedetail_helper.maxDiscountAmount(part) %}
|
|
{% set max_order_price = pricedetail_helper.calculateAvgPrice(part, max_order_amount, app.user.currency ?? null) %}
|
|
{% if max_order_price is not null %}
|
|
<h6>
|
|
<i class="fas fa-money-bill-alt fa-fw"></i>
|
|
<span class="text-muted">
|
|
<span title="{% trans %}part.avg_price.label{% endtrans %} {{ max_order_amount | format_amount(part.partUnit) }}">{{ max_order_price | format_money(app.user.currency ?? null) }}</span>
|
|
{% if min_order_amount < max_order_amount %}
|
|
<span> - </span>
|
|
<span title="{% trans %}part.avg_price.label{% endtrans %} {{ min_order_amount | format_amount(part.partUnit) }}">{{pricedetail_helper.calculateAvgPrice(part, min_order_amount, app.user.currency ?? null ) | format_money(app.user.currency ?? null) }}</span>
|
|
{% endif %}
|
|
</span>
|
|
</h6>
|
|
{% endif %}
|
|
{#
|
|
{% if part.comment != "" %}
|
|
<h6 title="{% trans %}comment.label{% endtrans %}">
|
|
<i class="fas fa-comment-alt fa-fw"></i>
|
|
<div class="d-inline-flex">
|
|
<span class="text-muted">{{ part.comment|nl2br }}</span>
|
|
</div>
|
|
</h6>
|
|
{% endif %} #}
|
|
</div>
|
|
</div> |