Show a notice flash if the content of labels is empty

This implements the suggestion of issue #297
This commit is contained in:
Jan Böhmer 2023-06-27 00:18:47 +02:00
parent 742f1f4622
commit 20826daa18
2 changed files with 11 additions and 0 deletions

View file

@ -126,6 +126,11 @@ class LabelController extends AbstractController
new FormError($this->translator->trans('label_generator.no_entities_found')) new FormError($this->translator->trans('label_generator.no_entities_found'))
); );
} }
//When the profile lines are empty, show a notice flash
if (trim($form_options->getLines()) === '') {
$this->addFlash('notice', 'label_generator.no_lines_given');
}
} }
return $this->render('label_system/dialog.html.twig', [ return $this->render('label_system/dialog.html.twig', [

View file

@ -11463,5 +11463,11 @@ Element 3</target>
<target>Auto (decide based on system settings)</target> <target>Auto (decide based on system settings)</target>
</segment> </segment>
</unit> </unit>
<unit id="9N0N8aL" name="label_generator.no_lines_given">
<segment>
<source>label_generator.no_lines_given</source>
<target>No text content given! The labels will remain empty.</target>
</segment>
</unit>
</file> </file>
</xliff> </xliff>