mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 03:14:32 +02:00
Added basic label generation dialog.
This commit is contained in:
parent
ea0d72bfbb
commit
a4e1a17b4a
12 changed files with 230 additions and 5 deletions
|
@ -24,14 +24,16 @@ namespace App\Services\LabelSystem;
|
|||
use App\Entity\Contracts\NamedElementInterface;
|
||||
use App\Entity\LabelSystem\LabelOptions;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Services\ElementTypeNameGenerator;
|
||||
use Dompdf\Dompdf;
|
||||
use Twig\Environment;
|
||||
|
||||
class LabelGenerator
|
||||
{
|
||||
protected const CLASS_SUPPORT_MAPPING = [
|
||||
public const CLASS_SUPPORT_MAPPING = [
|
||||
'part' => Part::class,
|
||||
'part_lot' => PartLot::class,
|
||||
];
|
||||
|
||||
public const MM_TO_POINTS_FACTOR = 2.83465;
|
||||
|
|
|
@ -40,7 +40,7 @@ class LabelHTMLGenerator
|
|||
|
||||
public function getLabelHTML(LabelOptions $options, object $element): string
|
||||
{
|
||||
return $this->twig->render('labels/base_label.html.twig', [
|
||||
return $this->twig->render('LabelSystem/labels/base_label.html.twig', [
|
||||
'meta_title' => $this->getPDFTitle($options, $element),
|
||||
'lines' => $this->replacer->replace($options->getLines(), $element),
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue