+
+
+ {% trans "Part Manufacturers" %}
+
+
+
+
+
+{% endblock %}
+
{% block js_load %}
{{ block.super }}
{% endblock %}
@@ -90,6 +118,49 @@
}
);
- linkButtonsToSelection($("#supplier-table"), ['#supplier-part-options'])
+ linkButtonsToSelection($("#supplier-table"), ['#supplier-part-options']);
+
+ loadManufacturerPartTable(
+ '#manufacturer-table',
+ "{% url 'api-manufacturer-part-list' %}",
+ {
+ params: {
+ part: {{ part.id }},
+ part_detail: true,
+ manufacturer_detail: true,
+ },
+ }
+ );
+
+ linkButtonsToSelection($("#manufacturer-table"), ['#manufacturer-part-options']);
+
+ $("#manufacturer-part-delete").click(function() {
+
+ var selections = $("#manufacturer-table").bootstrapTable("getSelections");
+
+ deleteManufacturerParts(selections, {
+ onSuccess: function() {
+ $("#manufacturer-table").bootstrapTable("refresh");
+ }
+ });
+ });
+
+ $('#manufacturer-create').click(function () {
+ launchModalForm(
+ "{% url 'manufacturer-part-create' %}",
+ {
+ reload: true,
+ data: {
+ part: {{ part.id }}
+ },
+ secondary: [
+ {
+ field: 'manufacturer',
+ label: '{% trans "New Manufacturer" %}',
+ title: '{% trans "Create new manufacturer" %}',
+ }
+ ]
+ });
+ });
{% endblock %}
\ No newline at end of file