diff --git a/InvenTree/InvenTree/urls.py b/InvenTree/InvenTree/urls.py index 61ca4afbc9..2cdf6cf598 100644 --- a/InvenTree/InvenTree/urls.py +++ b/InvenTree/InvenTree/urls.py @@ -77,6 +77,7 @@ settings_urls = [ dynamic_javascript_urls = [ url(r'^part.js', DynamicJsView.as_view(template_name='js/part.js'), name='part.js'), url(r'^stock.js', DynamicJsView.as_view(template_name='js/stock.js'), name='stock.js'), + url(r'^build.js', DynamicJsView.as_view(template_name='js/build.js'), name='build.js'), ] urlpatterns = [ diff --git a/InvenTree/templates/base.html b/InvenTree/templates/base.html index f812376e67..ab872d9684 100644 --- a/InvenTree/templates/base.html +++ b/InvenTree/templates/base.html @@ -105,7 +105,6 @@ InvenTree - @@ -114,6 +113,7 @@ InvenTree + diff --git a/InvenTree/InvenTree/static/script/inventree/build.js b/InvenTree/templates/js/build.js similarity index 83% rename from InvenTree/InvenTree/static/script/inventree/build.js rename to InvenTree/templates/js/build.js index bb2de7fb81..b48e6a2a09 100644 --- a/InvenTree/InvenTree/static/script/inventree/build.js +++ b/InvenTree/templates/js/build.js @@ -1,3 +1,5 @@ +{% load i18n %} + function loadBuildTable(table, options) { // Display a table of Build objects @@ -14,7 +16,7 @@ function loadBuildTable(table, options) { table.inventreeTable({ method: 'get', formatNoMatches: function() { - return "No builds matching query"; + return "{% trans "No builds matching query" %}"; }, url: options.url, queryParams: filters, @@ -28,7 +30,7 @@ function loadBuildTable(table, options) { }, { field: 'title', - title: 'Build', + title: '{% trans "Build" %}', sortable: true, formatter: function(value, row, index, field) { return renderLink(value, '/build/' + row.pk + '/'); @@ -36,7 +38,7 @@ function loadBuildTable(table, options) { }, { field: 'part', - title: 'Part', + title: '{% trans "Part" %}', sortable: true, formatter: function(value, row, index, field) { @@ -47,12 +49,12 @@ function loadBuildTable(table, options) { }, { field: 'quantity', - title: 'Quantity', + title: '{% trans "Quantity" %}', sortable: true, }, { field: 'status', - title: 'Status', + title: '{% trans "Status" %}', sortable: true, formatter: function(value, row, index, field) { return buildStatusDisplay(value); @@ -60,12 +62,12 @@ function loadBuildTable(table, options) { }, { field: 'creation_date', - title: 'Created', + title: '{% trans "Created" %}', sortable: true, }, { field: 'completion_date', - title: 'Completed', + title: '{% trans "Completed" %}', sortable: true, }, ], @@ -97,30 +99,30 @@ function loadAllocationTable(table, part_id, part, url, required, button) { table.bootstrapTable({ url: url, sortable: false, - formatNoMatches: function() { return 'No parts allocated for ' + part; }, + formatNoMatches: function() { return '{% trans "No parts allocated for" %} ' + part; }, columns: [ { field: 'stock_item_detail', - title: 'Stock Item', + title: '{% trans "Stock Item" %}', formatter: function(value, row, index, field) { return '' + parseFloat(value.quantity) + ' x ' + value.part_name + ' @ ' + value.location_name; } }, { field: 'stock_item_detail.quantity', - title: 'Available', + title: '{% trans "Available" %}', formatter: function(value, row, index, field) { return parseFloat(value); } }, { field: 'quantity', - title: 'Allocated', + title: '{% trans "Allocated" %}', formatter: function(value, row, index, field) { var html = parseFloat(value); - var bEdit = ""; - var bDel = ""; + var bEdit = ""; + var bDel = ""; html += "
" + bEdit + bDel + "
";