{% extends "stock/item_base.html" %} {% load static %} {% load i18n %} {% block details %} {% include "stock/tabs.html" with tab='tests' %}

{% trans "Test Data" %}


{% endblock %} {% block js_ready %} {{ block.super }} loadStockTestResultsTable( $("#test-result-table"), { part: {{ item.part.id }}, stock_item: {{ item.id }}, } ); function reloadTable() { location.reload(); //$("#test-result-table").bootstrapTable("refresh"); } $("#add-test-result").click(function() { launchModalForm( "{% url 'stock-item-test-create' %}", { data: { stock_item: {{ item.id }}, }, success: reloadTable, } ); }); $("#test-result-table").on('click', '.button-test-add', function() { var button = $(this); var test_name = button.attr('pk'); launchModalForm( "{% url 'stock-item-test-create' %}", { data: { stock_item: {{ item.id }}, test: test_name }, success: reloadTable, } ); }); $("#test-result-table").on('click', '.button-test-edit', function() { var button = $(this); var url = `/stock/item/test/${button.attr('pk')}/edit/`; launchModalForm(url, { success: reloadTable, }); }); $("#test-result-table").on('click', '.button-test-delete', function() { var button = $(this); var url = `/stock/item/test/${button.attr('pk')}/delete/`; launchModalForm(url, { success: reloadTable, }); }); {% endblock %}