{% extends "part/part_app_base.html" %} {% load static %} {% load i18n %} {% load inventree_extras %} {% block content %} {% if part.is_template %}
{% trans "This part is a template part." %}
{% trans "It is not a real part, but real parts can be based on this template." %}
{% endif %} {% if part.variant_of %}
{% trans "This part is a variant of" %} {{ part.variant_of.full_name }}
{% endif %}
{% include "part/part_thumb.html" %}

{{ part.full_name }} {% if not part.active %}
{% trans 'Inactive' %}
{% endif %}

{{ part.description }}

{% if part.is_template == False %} {% include "qr_button.html" %} {% if part.active %} {% if not part.virtual %} {% endif %} {% if part.purchaseable %} {% endif %} {% endif %} {% endif %} {% if not part.active %} {% endif %}

{% if part.IPN %} {% endif %} {% if part.link %} {% endif %}
{% trans "IPN" %} {{ part.IPN }}
{% trans "External Link" %} {{ part.link }}
{% if not part.is_template %} {% if part.allocation_count > 0 %} {% endif %} {% if part.on_order > 0 %} {% endif %} {% endif %} {% if not part.is_template %} {% if part.assembly %} {% if part.quantity_being_built > 0 %} {% endif %} {% endif %} {% endif %}

{% trans "Available Stock" %}

{% decimal part.available_stock %} {{ part.units }}

{% trans "In Stock" %} {% include "part/stock_count.html" %}
{% trans "Allocated" %} {% decimal part.allocation_count %}
{% trans "On Order" %} {% decimal part.on_order %}
{% trans "Build Status" %}
{% trans "Can Build" %} {% decimal part.can_build %}
{% trans "Underway" %} {% decimal part.quantity_being_built %}

{% block details %} {% endblock %}
{% endblock %} {% block js_ready %} {{ block.super }} enableDragAndDrop( '#part-thumb', "{% url 'part-image-upload' part.id %}", { label: 'image', success: function(data, status, xhr) { location.reload(); } } ); $("#show-qr-code").click(function() { launchModalForm( "{% url 'part-qr' part.id %}", { no_post: true, } ); }); $("#part-count").click(function() { launchModalForm("/stock/adjust/", { data: { action: "count", part: {{ part.id }}, }, reload: true, }); }); $("#price-button").click(function() { launchModalForm( "{% url 'part-pricing' part.id %}", { submit_text: 'Calculate', } ); }); $("#toggle-starred").click(function() { toggleStar({ part: {{ part.id }}, user: {{ user.id }}, button: '#part-star-icon' }); }); $("#part-image-upload").click(function() { launchModalForm("{% url 'part-image-upload' part.id %}", { reload: true } ); }); function onSelectImage(response) { // Callback when the image-selection modal form is displayed // Populate the form with image data (requested via AJAX) $("#modal-form").find("#image-select-table").bootstrapTable({ pagination: true, pageSize: 25, url: "{% url 'api-part-thumbs' %}", showHeader: false, clickToSelect: true, singleSelect: true, columns: [ { checkbox: true, }, { field: 'image', title: 'Image', formatter: function(value, row, index, field) { return "" } } ], onCheck: function(row, element) { // Update the selected image in the form var ipt = $("#modal-form").find("#image-input"); ipt.val(row.image); } }); } $("#part-image-select").click(function() { launchModalForm("{% url 'part-image-select' part.id %}", { reload: true, after_render: onSelectImage }); }); $("#part-edit").click(function() { launchModalForm( "{% url 'part-edit' part.id %}", { reload: true, } ); }); $("#part-order").click(function() { launchModalForm("{% url 'order-parts' %}", { data: { part: {{ part.id }}, }, reload: true, }); }); $("#part-duplicate").click(function() { launchModalForm( "{% url 'part-duplicate' part.id %}", { follow: true, } ); }); {% if not part.active %} $("#part-delete").click(function() { launchModalForm( "{% url 'part-delete' part.id %}", { redirect: {% if part.category %}"{% url 'category-detail' part.category.id %}"{% else %}"{% url 'part-index' %}"{% endif %} } ); }); {% endif %} {% endblock %}