Show MPN and manufacturer link on part info page.

This commit is contained in:
Jan Böhmer 2019-09-02 18:53:31 +02:00
parent d22f9da1f0
commit 59c981ad0d
2 changed files with 11 additions and 2 deletions

View file

@ -232,6 +232,7 @@ class Part extends AttachmentContainingDBElement
/** /**
* @var string * @var string
* @ORM\Column(type="string") * @ORM\Column(type="string")
* @Assert\Url()
* @ColumnSecurity(prefix="manufacturer", type="string", placeholder="") * @ColumnSecurity(prefix="manufacturer", type="string", placeholder="")
*/ */
protected $manufacturer_product_url = ''; protected $manufacturer_product_url = '';

View file

@ -7,7 +7,15 @@
{% endif %} {% endif %}
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
<h5 class="text-muted pt-2" title="{% trans %}manufacturer.label{% endtrans %}">{{ part.manufacturer.name ?? ""}}</h5> <h5 class="text-muted pt-2" title="{% trans %}manufacturer.label{% endtrans %}">{{ part.manufacturer.name ?? ""}}
{% if part.manufacturerProductUrl %}
<small>
<a class="link-external" href="{{ part.manufacturerProductUrl }}" target="_blank">{{ part.manufacturerProductNumber }}</a>
</small>
{% else %}
<small>{{ part.manufacturerProductNumber }}</small>
{% endif %}
</h5>
<h3>{{ part.name }} <h3>{{ part.name }}
{# You need edit permission to use the edit button #} {# You need edit permission to use the edit button #}
{% if is_granted('edit', part) %} {% if is_granted('edit', part) %}
@ -47,7 +55,7 @@
{% if min_order_amount < max_order_amount %} {% if min_order_amount < max_order_amount %}
<span> - </span> <span> - </span>
<span title="{% trans %}part.avg_price.label{% endtrans %} {{ min_order_amount | amountFormat(part.partUnit) }}">{{pricedetail_helper.calculateAvgPrice(part, min_order_amount) | moneyFormat }}</span> <span title="{% trans %}part.avg_price.label{% endtrans %} {{ min_order_amount | amountFormat(part.partUnit) }}">{{pricedetail_helper.calculateAvgPrice(part, min_order_amount) | moneyFormat }}</span>
{% endif %} {% endif %}
{% endif %} {% endif %}
</span> </span>