mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Display proper printing target name in the label printing modal dialog (#4727)
Fix #4717
This commit is contained in:
parent
e5e1a09b45
commit
0b8feb2c4a
@ -471,6 +471,7 @@
|
|||||||
printLabels({
|
printLabels({
|
||||||
items: [{{ part.pk }}],
|
items: [{{ part.pk }}],
|
||||||
key: 'part',
|
key: 'part',
|
||||||
|
singular_name: '{% trans "part" %}',
|
||||||
url: '{% url "api-part-label-list" %}',
|
url: '{% url "api-part-label-list" %}',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -496,6 +496,7 @@ $("#stock-test-report").click(function() {
|
|||||||
$("#print-label").click(function() {
|
$("#print-label").click(function() {
|
||||||
printLabels({
|
printLabels({
|
||||||
items: [{{ item.pk }}],
|
items: [{{ item.pk }}],
|
||||||
|
singular_name: '{% trans "stock item" %}',
|
||||||
url: '{% url "api-stockitem-label-list" %}',
|
url: '{% url "api-stockitem-label-list" %}',
|
||||||
key: 'item',
|
key: 'item',
|
||||||
});
|
});
|
||||||
|
@ -284,6 +284,7 @@
|
|||||||
|
|
||||||
printLabels({
|
printLabels({
|
||||||
items: locs,
|
items: locs,
|
||||||
|
singular_name: '{% trans "stock location" %}',
|
||||||
key: 'location',
|
key: 'location',
|
||||||
url: '{% url "api-stocklocation-label-list" %}',
|
url: '{% url "api-stocklocation-label-list" %}',
|
||||||
});
|
});
|
||||||
|
@ -889,7 +889,9 @@ function loadBuildOutputTable(build_info, options={}) {
|
|||||||
labels: {
|
labels: {
|
||||||
url: '{% url "api-stockitem-label-list" %}',
|
url: '{% url "api-stockitem-label-list" %}',
|
||||||
key: 'item',
|
key: 'item',
|
||||||
}
|
},
|
||||||
|
singular_name: '{% trans "build output" %}',
|
||||||
|
plural_name: '{% trans "build outputs" %}',
|
||||||
});
|
});
|
||||||
|
|
||||||
function setupBuildOutputButtonCallbacks() {
|
function setupBuildOutputButtonCallbacks() {
|
||||||
|
@ -419,6 +419,8 @@ function setupFilterList(tableKey, table, target, options={}) {
|
|||||||
|
|
||||||
printLabels({
|
printLabels({
|
||||||
items: items,
|
items: items,
|
||||||
|
singular_name: options.singular_name,
|
||||||
|
plural_name: options.plural_name,
|
||||||
url: options.labels.url,
|
url: options.labels.url,
|
||||||
key: options.labels.key,
|
key: options.labels.key,
|
||||||
});
|
});
|
||||||
|
@ -96,10 +96,10 @@ function selectLabel(labels, items, options={}) {
|
|||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
if (items.length > 0) {
|
if (items.length > 0) {
|
||||||
|
name = items.length == 1 ? options.singular_name : options.plural_name;
|
||||||
html += `
|
html += `
|
||||||
<div class='alert alert-block alert-info'>
|
<div class='alert alert-block alert-info'>
|
||||||
${items.length} {% trans "stock items selected" %}
|
${items.length} ${name} {% trans "selected" %}
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +208,9 @@ function printLabels(options) {
|
|||||||
} else {
|
} else {
|
||||||
window.open(href);
|
window.open(href);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
plural_name: options.plural_name,
|
||||||
|
singular_name: options.singular_name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1834,7 +1834,9 @@ function loadPartTable(table, url, options={}) {
|
|||||||
labels: {
|
labels: {
|
||||||
url: '{% url "api-part-label-list" %}',
|
url: '{% url "api-part-label-list" %}',
|
||||||
key: 'part',
|
key: 'part',
|
||||||
}
|
},
|
||||||
|
singular_name: '{% trans "part" %}',
|
||||||
|
plural_name: '{% trans "parts" %}',
|
||||||
});
|
});
|
||||||
|
|
||||||
var columns = [
|
var columns = [
|
||||||
|
@ -1724,7 +1724,9 @@ function loadStockTable(table, options) {
|
|||||||
labels: {
|
labels: {
|
||||||
url: '{% url "api-stockitem-label-list" %}',
|
url: '{% url "api-stockitem-label-list" %}',
|
||||||
key: 'item',
|
key: 'item',
|
||||||
}
|
},
|
||||||
|
singular_name: '{% trans "stock item" %}',
|
||||||
|
plural_name: '{% trans "stock items" %}'
|
||||||
});
|
});
|
||||||
|
|
||||||
// Override the default values, or add new ones
|
// Override the default values, or add new ones
|
||||||
@ -2378,7 +2380,9 @@ function loadStockLocationTable(table, options) {
|
|||||||
labels: {
|
labels: {
|
||||||
url: '{% url "api-stocklocation-label-list" %}',
|
url: '{% url "api-stocklocation-label-list" %}',
|
||||||
key: 'location'
|
key: 'location'
|
||||||
}
|
},
|
||||||
|
singular_name: '{% trans "stock location" %}',
|
||||||
|
plural_name: '{% trans "stock locations" %}',
|
||||||
});
|
});
|
||||||
|
|
||||||
for (var key in params) {
|
for (var key in params) {
|
||||||
|
Loading…
Reference in New Issue
Block a user