{% extends "part/part_base.html" %}
{% load static %}
{% block details %}
{% include 'part/tabs.html' with tab='detail' %}
Buildable |
{% include "yesnolabel.html" with value=part.buildable %} |
Consumable |
{% include "yesnolabel.html" with value=part.consumable %} |
Trackable |
{% include "yesnolabel.html" with value=part.trackable %} |
Purchaseable |
{% include "yesnolabel.html" with value=part.purchaseable %} |
Salable |
{% include "yesnolabel.html" with value=part.salable %} |
{% if part.minimum_stock > 0 %}
Minimum Stock |
{{ part.minimum_stock }} |
{% endif %}
{% if part.notes %}
{% endif %}
{% endblock %}
{% block js_load %}
{{ block.super }}
{% endblock %}
{% block js_ready %}
{{ block.super }}
$("#duplicate-part").click(function() {
launchModalForm(
"{% url 'part-duplicate' part.id %}",
{
follow: true,
}
);
});
$("#edit-part").click(function() {
launchModalForm(
"{% url 'part-edit' part.id %}",
{
reload: true,
});
});
$('#activate-part').click(function() {
showQuestionDialog(
'Activate Part?',
'Are you sure you wish to reactivate {{ part.full_name }}?',
{
accept_text: 'Activate',
accept: function() {
inventreePut(
"{% url 'api-part-detail' part.id %}",
{
active: true,
},
{
method: 'PATCH',
reloadOnSuccess: true,
}
);
}
},
);
});
$('#deactivate-part').click(function() {
showQuestionDialog(
'Deactivate Part?',
`Are you sure you wish to deactivate {{ part.full_name }}?
`,
{
accept_text: 'Deactivate',
accept: function() {
inventreePut(
"{% url 'api-part-detail' part.id %}",
{
active: false,
},
{
method: 'PATCH',
reloadOnSuccess: true,
}
);
}
}
);
});
$('#delete-part').click(function() {
launchModalForm(
"{% url 'part-delete' part.id %}",
{
redirect: {% if part.category %}"{% url 'category-detail' part.category.id %}"{% else %}"{% url 'part-index' %}"{% endif %}
});
});
{% endblock %}