Skip to content

Commit

Permalink
Added default template
Browse files Browse the repository at this point in the history
  • Loading branch information
Donkie committed Jun 19, 2024
1 parent 20923de commit 052bdb4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/src/components/printing/qrCodePrintingDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const QRCodePrintingDialog: React.FC<QRCodePrintingDialogProps> = ({
}) => {
const t = useTranslate();

const showContent = printSettings?.showContent;
const showContent = printSettings?.showContent === undefined ? true : printSettings?.showContent;
const textSize = printSettings?.textSize || 5;
const showSpoolmanIcon = printSettings?.showSpoolmanIcon;
const showSpoolmanIcon = printSettings?.showSpoolmanIcon === undefined ? true : printSettings?.showSpoolmanIcon;

const elements = items.map((item) => {
return (
Expand Down
12 changes: 11 additions & 1 deletion client/src/components/printing/spoolQrCodePrintingDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,17 @@ const SpoolQRCodePrintingDialog: React.FC<SpoolQRCodePrintingDialog> = ({ visibl
}

const [templateHelpOpen, setTemplateHelpOpen] = useState(false);
const template = selectedPrintSetting.template ?? "";
const template =
selectedPrintSetting.template ??
`**{filament.vendor.name} - {filament.name}
#{id} - {filament.material}**
Spool Weight: {filament.spool_weight} g
ET: {filament.settings_extruder_temp} °C
BT: {filament.settings_bed_temp} °C
Lot Nr: {lot_nr}
{comment}
{filament.comment}
{filament.vendor.comment}`;

const spoolTags = [
{ tag: "id" },
Expand Down

0 comments on commit 052bdb4

Please sign in to comment.