mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Added localization to _Batch partial view
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-primary text-white">
|
||||
<h5 class="modal-title" id="printModalLabel">Print Page</h5>
|
||||
<h5 class="modal-title" id="printModalLabel">@T["Print Page"]</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@@ -24,7 +24,7 @@
|
||||
const modalBody = document.querySelector('#printModal .modal-body');
|
||||
modalBody.innerHTML = '';
|
||||
if (!assetIds || assetIds.length === 0) {
|
||||
modalBody.innerHTML = '<p>No assets selected for printing.</p>';
|
||||
modalBody.innerHTML = '<p>@T["No assets selected for printing."]</p>';
|
||||
return;
|
||||
}
|
||||
modalBody.innerHTML = `
|
||||
@@ -62,14 +62,14 @@
|
||||
<h6 class="card-title"><strong>Asset ${i + 1}:</strong> ${asset.Name}</h6>
|
||||
<div class="row">
|
||||
<div class="col-md-5">
|
||||
<p><strong>Asset ID:</strong> ${asset.Cn}</p>
|
||||
<p><strong>Owner:</strong> ${asset.Owner}</p>
|
||||
<p><strong>Type:</strong> ${asset.Description.Type}</p>
|
||||
<p><strong>@T["Asset ID"]:</strong> ${asset.Cn}</p>
|
||||
<p><strong>@T["Owner"]:</strong> ${asset.Owner}</p>
|
||||
<p><strong>@T["Type"]:</strong> ${asset.Description.Type}</p>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<p><strong>Make:</strong> ${asset.Description.Make}</p>
|
||||
<p><strong>Model:</strong> ${asset.Description.Model}</p>
|
||||
<p><strong>Serial:</strong> ${asset.SerialNumber}</p>
|
||||
<p><strong>@T["Make"]:</strong> ${asset.Description.Make}</p>
|
||||
<p><strong>@T["Model"]:</strong> ${asset.Description.Model}</p>
|
||||
<p><strong>@T["Serial"]:</strong> ${asset.SerialNumber}</p>
|
||||
</div>
|
||||
<div id="printPreviewBatchButtons${i}" class="col-md-1 justify-content-end" style="margin-left: auto; width: auto;">
|
||||
</div>
|
||||
@@ -114,7 +114,7 @@
|
||||
console.error(`Error fetching asset ${assetId}:`, error);
|
||||
const errorDiv = document.createElement('div');
|
||||
errorDiv.className = 'alert alert-danger';
|
||||
errorDiv.textContent = `Error loading asset ${assetId}`;
|
||||
errorDiv.textContent = `@T["Error loading asset"] ${assetId}`;
|
||||
modalBody.appendChild(errorDiv);
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,7 @@
|
||||
const container = document.getElementById(containerId);
|
||||
if (!container) return console.error(`Container #${containerId} not found.`);
|
||||
|
||||
container.innerHTML = `<p class="text-muted text-center">Loading preview...</p>`;
|
||||
container.innerHTML = `<p class="text-muted text-center">@T["Loading preview..."]</p>`;
|
||||
|
||||
let batch = JSON.parse(localStorage.getItem("printBatch")) || [];
|
||||
padNulls(batch, 24);
|
||||
@@ -149,7 +149,7 @@
|
||||
|
||||
const assetId = batch[i];
|
||||
if (!assetId) {
|
||||
cell.innerHTML = `<div class="text-muted small">Empty Slot</div>`;
|
||||
cell.innerHTML = `<div class="text-muted small">@T["Empty Slot"]</div>`;
|
||||
grid.appendChild(cell);
|
||||
continue;
|
||||
}
|
||||
@@ -181,8 +181,8 @@
|
||||
fontSize: 12,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(`Error rendering asset ${assetId}:`, error);
|
||||
cell.innerHTML = `<div class="text-danger small">Error loading ${assetId}</div>`;
|
||||
console.error(`@T["Error rendering asset"] ${assetId}:`, error);
|
||||
cell.innerHTML = `<div class="text-danger small">@T["Error loading"] ${assetId}</div>`;
|
||||
grid.appendChild(cell);
|
||||
}
|
||||
}
|
||||
@@ -268,7 +268,7 @@
|
||||
padNulls(batch, 24);
|
||||
|
||||
if (!batch.length || batch.every(x => x === null)) {
|
||||
alert("No assets in print batch.");
|
||||
alert("@T["No assets in print batch."]");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@
|
||||
console.error(err);
|
||||
const errDiv = printWindow.document.createElement("div");
|
||||
errDiv.className = "barcode-label text-danger";
|
||||
errDiv.textContent = `Error loading ${assetId}`;
|
||||
errDiv.textContent = `@T["Error loading"] ${assetId}`;
|
||||
cell.appendChild(errDiv);
|
||||
grid.appendChild(cell);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user