mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-31 09:01:35 +00:00
133 lines
3.9 KiB
HTML
133 lines
3.9 KiB
HTML
{% extends "two_column.html" %}
|
|
{% load static %}
|
|
{% load i18n %}
|
|
|
|
{% block page_title %}
|
|
InvenTree | {% trans "Manufacturer Part" %}
|
|
{% endblock %}
|
|
|
|
{% block thumbnail %}
|
|
<img class='part-thumb'
|
|
{% if part.part.image %}
|
|
src='{{ part.part.image.url }}'
|
|
{% else %}
|
|
src="{% static 'img/blank_image.png' %}"
|
|
{% endif %}/>
|
|
{% endblock %}
|
|
|
|
{% block page_data %}
|
|
<h3>{% trans "Manufacturer Part" %}</h3>
|
|
<hr>
|
|
<h4>
|
|
{{ part.part.full_name }}
|
|
{% if user.is_staff and perms.company.change_company %}
|
|
<a href="{% url 'admin:company_supplierpart_change' part.pk %}">
|
|
<span title='{% trans "Admin view" %}' class='fas fa-user-shield'></span>
|
|
</a>
|
|
{% endif %}
|
|
</h4>
|
|
<p>{{ part.manufacturer.name }} - {{ part.MPN }}</p>
|
|
|
|
{% if roles.purchase_order.change %}
|
|
<div class='btn-row'>
|
|
<div class='btn-group action-buttons' role='group'>
|
|
{% comment "for later" %}
|
|
{% if roles.purchase_order.add %}
|
|
<button type='button' class='btn btn-default btn-glyph' id='order-part' title='{% trans "Order part" %}'>
|
|
<span class='fas fa-shopping-cart'></span>
|
|
</button>
|
|
{% endif %}
|
|
{% endcomment %}
|
|
<button type='button' class='btn btn-default btn-glyph' id='edit-part' title='{% trans "Edit manufacturer part" %}'>
|
|
<span class='fas fa-edit icon-green'/>
|
|
</button>
|
|
{% if roles.purchase_order.delete %}
|
|
<button type='button' class='btn btn-default btn-glyph' id='delete-part' title='{% trans "Delete manufacturer part" %}'>
|
|
<span class='fas fa-trash-alt icon-red'/>
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|
|
|
|
{% block page_details %}
|
|
|
|
<h4>{% trans "Manufacturer Part Details" %}</h4>
|
|
<table class="table table-striped table-condensed">
|
|
<col width='25'>
|
|
<tr>
|
|
<td><span class='fas fa-shapes'></span></td>
|
|
<td>{% trans "Internal Part" %}</td>
|
|
<td>
|
|
{% if part.part %}
|
|
<a href="{% url 'part-manufacturers' part.part.id %}">{{ part.part.full_name }}</a>{% include "clip.html"%}
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% if part.description %}
|
|
<tr>
|
|
<td></td>
|
|
<td>{% trans "Description" %}</td>
|
|
<td>{{ part.description }}{% include "clip.html"%}</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if part.link %}
|
|
<tr>
|
|
<td><span class='fas fa-link'></span></td>
|
|
<td>{% trans "External Link" %}</td>
|
|
<td><a href="{{ part.link }}">{{ part.link }}</a>{% include "clip.html"%}</td>
|
|
</tr>
|
|
{% endif %}
|
|
<tr>
|
|
<td><span class='fas fa-industry'></span></td>
|
|
<td>{% trans "Manufacturer" %}</td>
|
|
<td><a href="{% url 'company-detail-manufacturer-parts' part.manufacturer.id %}">{{ part.manufacturer.name }}</a>{% include "clip.html"%}</td></tr>
|
|
<tr>
|
|
<td><span class='fas fa-hashtag'></span></td>
|
|
<td>{% trans "MPN" %}</td>
|
|
<td>{{ part.MPN }}{% include "clip.html"%}</td>
|
|
</tr>
|
|
</table>
|
|
{% endblock %}
|
|
|
|
{% block js_ready %}
|
|
{{ block.super }}
|
|
|
|
enableNavbar({
|
|
label: 'manufacturer-part',
|
|
toggleId: '#manufacturer-part-menu-toggle'
|
|
})
|
|
|
|
$('#order-part, #order-part2').click(function() {
|
|
launchModalForm(
|
|
"{% url 'order-parts' %}",
|
|
{
|
|
data: {
|
|
part: {{ part.part.id }},
|
|
},
|
|
reload: true,
|
|
},
|
|
);
|
|
});
|
|
|
|
$('#edit-part').click(function () {
|
|
launchModalForm(
|
|
"{% url 'manufacturer-part-edit' part.id %}",
|
|
{
|
|
reload: true
|
|
}
|
|
);
|
|
});
|
|
|
|
$('#delete-part').click(function() {
|
|
launchModalForm(
|
|
"{% url 'manufacturer-part-delete' %}?part={{ part.id }}",
|
|
{
|
|
redirect: "{% url 'company-detail-manufacturer-parts' part.manufacturer.id %}"
|
|
}
|
|
);
|
|
});
|
|
|
|
{% endblock %} |