mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Small tweaks here and there
This commit is contained in:
parent
4061693522
commit
1998dabe9b
@ -42,9 +42,32 @@ function loadAttachmentTable(url, options) {
|
||||
title: '{% trans "File" %}',
|
||||
formatter: function(value, row) {
|
||||
|
||||
var split = value.split('/');
|
||||
var icon = 'fa-file-alt';
|
||||
|
||||
return renderLink(split[split.length - 1], value);
|
||||
var fn = value.toLowerCase();
|
||||
|
||||
if (fn.endsWith('.pdf')) {
|
||||
icon = 'fa-file-pdf';
|
||||
} else if (fn.endsWith('.xls') || fn.endsWith('.xlsx')) {
|
||||
icon = 'fa-file-excel';
|
||||
} else if (fn.endsWith('.doc') || fn.endsWith('.docx')) {
|
||||
icon = 'fa-file-word';
|
||||
} else {
|
||||
var images = ['.png', '.jpg', '.bmp', '.gif', '.svg', '.tif'];
|
||||
|
||||
images.forEach(function (suffix) {
|
||||
if (fn.endsWith(suffix)) {
|
||||
icon = 'fa-file-image';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var split = value.split('/');
|
||||
var filename = split[split.length - 1];
|
||||
|
||||
var html = `<span class='fas ${icon}'></span> ${filename}`;
|
||||
|
||||
return renderLink(html, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -252,7 +252,7 @@ function loadBomTable(table, options) {
|
||||
sortable: true,
|
||||
formatter: function(value, row, index, field) {
|
||||
|
||||
var url = `/part/${row.sub_part_detail.pk}/stock/`;
|
||||
var url = `/part/${row.sub_part_detail.pk}/?display=stock`;
|
||||
var text = value;
|
||||
|
||||
if (value == null || value <= 0) {
|
||||
|
@ -500,7 +500,7 @@ function loadPartVariantTable(table, partId, options={}) {
|
||||
field: 'in_stock',
|
||||
title: '{% trans "Stock" %}',
|
||||
formatter: function(value, row) {
|
||||
return renderLink(value, `/part/${row.pk}/stock/`);
|
||||
return renderLink(value, `/part/${row.pk}/?display=stock`);
|
||||
}
|
||||
}
|
||||
];
|
||||
|
@ -1066,7 +1066,7 @@ function loadStockTable(table, options) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
var link = `/supplier-part/${row.supplier_part}/stock/`;
|
||||
var link = `/supplier-part/${row.supplier_part}/?display=stock`;
|
||||
|
||||
var text = '';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user