{% extends "part/part_base.html" %} {% load static %} {% block details %} {% include 'part/tabs.html' with tab='suppliers' %}

Part Suppliers

{% if part.supplier_count > 0 %}

{{ part.name }} is available from {{ part.supplier_count }} suppliers.

{% else %}

{{ part.name }} is not available from any suppliers.

{% endif %}
{% endblock %} {% block js_load %} {{ block.super }} {% endblock %} {% block js_ready %} {{ block.super }} $('#supplier-create').click(function () { launchModalForm("#modal-form", "{% url 'supplier-part-create' %}", { reload: true, data: {part: {{ part.id }} } }); }); $("#supplier-table").bootstrapTable({ sortable: true, search: true, queryParams: function(p) { return { part: {{ part.id }} } }, columns: [ { checkbox: true, }, { sortable: true, field: 'supplier', title: 'Supplier', formatter: function(value, row, index, field) { return renderLink(value.name, value.url); } }, { sortable: true, field: 'SKU', title: 'SKU', formatter: function(value, row, index, field) { return renderLink(value, row.url); } }, { sortable: true, field: 'manufacturer', title: 'Manufacturer', } ], url: "{% url 'api-part-supplier-list' %}" }); {% endblock %}