mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Translation layer for company.js
This commit is contained in:
parent
2c9b76575e
commit
6c3dc2a25d
@ -79,6 +79,7 @@ dynamic_javascript_urls = [
|
|||||||
url(r'^stock.js', DynamicJsView.as_view(template_name='js/stock.js'), name='stock.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'),
|
url(r'^build.js', DynamicJsView.as_view(template_name='js/build.js'), name='build.js'),
|
||||||
url(r'^order.js', DynamicJsView.as_view(template_name='js/order.js'), name='order.js'),
|
url(r'^order.js', DynamicJsView.as_view(template_name='js/order.js'), name='order.js'),
|
||||||
|
url(r'^company.js', DynamicJsView.as_view(template_name='js/company.js'), name='company.js'),
|
||||||
]
|
]
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
@ -102,14 +102,14 @@ InvenTree
|
|||||||
|
|
||||||
<script type='text/javascript' src="{% static 'script/inventree/inventree.js' %}"></script>
|
<script type='text/javascript' src="{% static 'script/inventree/inventree.js' %}"></script>
|
||||||
<script type='text/javascript' src="{% static 'script/inventree/api.js' %}"></script>
|
<script type='text/javascript' src="{% static 'script/inventree/api.js' %}"></script>
|
||||||
<script type='text/javascript' src="{% static 'script/inventree/bom.js' %}"></script>
|
|
||||||
<script type='text/javascript' src="{% static 'script/inventree/filters.js' %}"></script>
|
<script type='text/javascript' src="{% static 'script/inventree/filters.js' %}"></script>
|
||||||
<script type='text/javascript' src="{% static 'script/inventree/tables.js' %}"></script>
|
<script type='text/javascript' src="{% static 'script/inventree/tables.js' %}"></script>
|
||||||
<script type='text/javascript' src="{% static 'script/inventree/modals.js' %}"></script>
|
<script type='text/javascript' src="{% static 'script/inventree/modals.js' %}"></script>
|
||||||
<script type='text/javascript' src="{% static 'script/inventree/company.js' %}"></script>
|
<script type='text/javascript' src="{% static 'script/inventree/bom.js' %}"></script>
|
||||||
<script type='text/javascript' src="{% static 'script/inventree/notification.js' %}"></script>
|
<script type='text/javascript' src="{% static 'script/inventree/notification.js' %}"></script>
|
||||||
<script type='text/javascript' src="{% static 'script/inventree/sidenav.js' %}"></script>
|
<script type='text/javascript' src="{% static 'script/inventree/sidenav.js' %}"></script>
|
||||||
|
|
||||||
|
<script type='text/javascript' src="{% url 'company.js' %}"></script>
|
||||||
<script type='text/javascript' src="{% url 'part.js' %}"></script>
|
<script type='text/javascript' src="{% url 'part.js' %}"></script>
|
||||||
<script type='text/javascript' src="{% url 'stock.js' %}"></script>
|
<script type='text/javascript' src="{% url 'stock.js' %}"></script>
|
||||||
<script type='text/javascript' src="{% url 'build.js' %}"></script>
|
<script type='text/javascript' src="{% url 'build.js' %}"></script>
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
|
||||||
function loadCompanyTable(table, url, options={}) {
|
function loadCompanyTable(table, url, options={}) {
|
||||||
/*
|
/*
|
||||||
@ -25,7 +26,7 @@ function loadCompanyTable(table, url, options={}) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
queryParams: filters,
|
queryParams: filters,
|
||||||
groupBy: false,
|
groupBy: false,
|
||||||
formatNoMatches: function() { return "No company information found"; },
|
formatNoMatches: function() { return "{% trans "No company information found" %}"; },
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
field: 'pk',
|
field: 'pk',
|
||||||
@ -34,21 +35,21 @@ function loadCompanyTable(table, url, options={}) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'name',
|
field: 'name',
|
||||||
title: 'Company',
|
title: '{% trans "Company" %}',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
var html = imageHoverIcon(row.image) + renderLink(value, row.url);
|
var html = imageHoverIcon(row.image) + renderLink(value, row.url);
|
||||||
|
|
||||||
if (row.is_customer) {
|
if (row.is_customer) {
|
||||||
html += `<span title='Customer' class='fas fa-user-tie label-right'></span>`;
|
html += `<span title='{% trans "Customer" %}' class='fas fa-user-tie label-right'></span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row.is_manufacturer) {
|
if (row.is_manufacturer) {
|
||||||
html += `<span title='Manufacturer' class='fas fa-industry label-right'></span>`;
|
html += `<span title='{% trans "Manufacturer" %}' class='fas fa-industry label-right'></span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row.is_supplier) {
|
if (row.is_supplier) {
|
||||||
html += `<span title='Supplier' class='fas fa-building label-right'></span>`;
|
html += `<span title='{% trans "Supplier" %}' class='fas fa-building label-right'></span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
@ -56,12 +57,12 @@ function loadCompanyTable(table, url, options={}) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'description',
|
field: 'description',
|
||||||
title: 'Description',
|
title: '{% trans "Description" %}',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'website',
|
field: 'website',
|
||||||
title: 'Website',
|
title: '{% trans "Website" %}',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
if (value) {
|
if (value) {
|
||||||
return renderLink(value, value);
|
return renderLink(value, value);
|
||||||
@ -97,7 +98,7 @@ function loadSupplierPartTable(table, url, options) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
queryParams: filters,
|
queryParams: filters,
|
||||||
groupBy: false,
|
groupBy: false,
|
||||||
formatNoMatches: function() { return "No supplier parts found"; },
|
formatNoMatches: function() { return "{% trans "No supplier parts found" %}"; },
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
checkbox: true,
|
checkbox: true,
|
||||||
@ -105,7 +106,7 @@ function loadSupplierPartTable(table, url, options) {
|
|||||||
{
|
{
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: 'part_detail.full_name',
|
field: 'part_detail.full_name',
|
||||||
title: 'Part',
|
title: '{% trans "Part" %}',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
|
|
||||||
var url = `/part/${row.part}/`;
|
var url = `/part/${row.part}/`;
|
||||||
@ -113,15 +114,15 @@ function loadSupplierPartTable(table, url, options) {
|
|||||||
var html = imageHoverIcon(row.part_detail.thumbnail) + renderLink(value, url);
|
var html = imageHoverIcon(row.part_detail.thumbnail) + renderLink(value, url);
|
||||||
|
|
||||||
if (row.part_detail.is_template) {
|
if (row.part_detail.is_template) {
|
||||||
html += `<span class='fas fa-clone label-right' title='Template part'></span>`;
|
html += `<span class='fas fa-clone label-right' title='{% trans "Template part" %}'></span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row.part_detail.assembly) {
|
if (row.part_detail.assembly) {
|
||||||
html += `<span class='fas fa-tools label-right' title='Assembled part'></span>`;
|
html += `<span class='fas fa-tools label-right' title='{% trans "Assembled part" %}'></span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!row.part_detail.active) {
|
if (!row.part_detail.active) {
|
||||||
html += `<span class='label label-warning label-right'>INACTIVE</span>`;
|
html += `<span class='label label-warning label-right'>{% trans "Inactive" %}</span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
@ -130,7 +131,7 @@ function loadSupplierPartTable(table, url, options) {
|
|||||||
{
|
{
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: 'supplier',
|
field: 'supplier',
|
||||||
title: "Supplier",
|
title: "{% trans "Supplier" %}",
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
if (value) {
|
if (value) {
|
||||||
var name = row.supplier_detail.name;
|
var name = row.supplier_detail.name;
|
||||||
@ -146,7 +147,7 @@ function loadSupplierPartTable(table, url, options) {
|
|||||||
{
|
{
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: 'SKU',
|
field: 'SKU',
|
||||||
title: "Supplier Part",
|
title: "{% trans "Supplier Part" %}",
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
return renderLink(value, `/supplier-part/${row.pk}/`);
|
return renderLink(value, `/supplier-part/${row.pk}/`);
|
||||||
}
|
}
|
||||||
@ -154,7 +155,7 @@ function loadSupplierPartTable(table, url, options) {
|
|||||||
{
|
{
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: 'manufacturer',
|
field: 'manufacturer',
|
||||||
title: 'Manufacturer',
|
title: '{% trans "Manufacturer" %}',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
if (value) {
|
if (value) {
|
||||||
var name = row.manufacturer_detail.name;
|
var name = row.manufacturer_detail.name;
|
||||||
@ -170,11 +171,11 @@ function loadSupplierPartTable(table, url, options) {
|
|||||||
{
|
{
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: 'MPN',
|
field: 'MPN',
|
||||||
title: 'MPN',
|
title: '{% trans "MPN" %}',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'link',
|
field: 'link',
|
||||||
title: 'Link',
|
title: '{% trans "Link" %}',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
if (value) {
|
if (value) {
|
||||||
return renderLink(value, value);
|
return renderLink(value, value);
|
Loading…
Reference in New Issue
Block a user