mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Merge pull request #265 from LD-Reborn/237-feature-implement-barcodetext-setting
Implemented BarcodeType and BarcodeText settings, fixed barcode align…
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
@using Berufsschule_HAM.Services
|
||||
@using Microsoft.AspNetCore.Mvc.Localization
|
||||
@inject IViewLocalizer T
|
||||
@inject IConfiguration Configuration
|
||||
@inject LdapService ldap
|
||||
@{
|
||||
string barcodeType = Configuration["BarcodeType"] ?? "EAN13";
|
||||
AdminSettingsModel adminSettingsModel = await ldap.GetAdminSettingsModelAsync();
|
||||
string barcodeType = adminSettingsModel.BarcodeType;
|
||||
string barcodeText = adminSettingsModel.BarcodeText;
|
||||
}
|
||||
|
||||
<!-- Print Modal -->
|
||||
@@ -520,7 +524,7 @@
|
||||
|
||||
const label = printWindow.document.createElement("div");
|
||||
label.className = "barcode-label";
|
||||
label.textContent = "HAM"; //asset?.Name || assetId;
|
||||
label.textContent = "@Html.Raw(barcodeText)";
|
||||
|
||||
const svg = printWindow.document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
||||
svg.id = `barcode_${i}`;
|
||||
@@ -538,7 +542,6 @@
|
||||
displayValue: true,
|
||||
fontSize: 12,
|
||||
});
|
||||
svg.viewBox.baseVal.x += 10;
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
const errDiv = printWindow.document.createElement("div");
|
||||
|
||||
Reference in New Issue
Block a user