mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-02 01:04:41 +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
28
templates/LabelSystem/dialog.html.twig
Normal file
28
templates/LabelSystem/dialog.html.twig
Normal file
|
@ -0,0 +1,28 @@
|
|||
{% extends 'main_card.html.twig' %}
|
||||
|
||||
{% block card_title %}<i class="fas fa-qrcode fa-fw"></i> {% trans %}label_generator.title{% endtrans %}{% endblock %}
|
||||
|
||||
{% block card_content %}
|
||||
{{ form_start(form) }}
|
||||
{{ form_row(form.target_id) }}
|
||||
{{ form_widget(form.options) }}
|
||||
{{ form_end(form) }}
|
||||
{% if pdf_data %}
|
||||
<div class="row">
|
||||
<div class="col-sm-9 offset-sm-3">
|
||||
<a data-no-ajax class="btn btn-secondary" href="#" onclick="this.href = document.getElementById('pdf_preview').data" download="{{ filename ?? '' }}">
|
||||
{% trans %}label_generator.download{% endtrans %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block additional_content %}
|
||||
{% if pdf_data %}
|
||||
<div class="card mt-2 p-1 border-secondary" style="resize: vertical; overflow: scroll; height: 250px">
|
||||
<object id="pdf_preview" data="{{ inlineData(pdf_data, 'application/pdf') | escape('html_attr') }}"style="height: inherit">
|
||||
</object>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
16
templates/LabelSystem/labels/base_label.html.twig
Normal file
16
templates/LabelSystem/labels/base_label.html.twig
Normal file
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{{ meta_title }}</title>
|
||||
<meta name="author" content="{{ partdb_title }}">
|
||||
<meta name="description" content="Label for {{ meta_title }}">
|
||||
<meta name="keywords" content="Part-DB, Label, Barcode">
|
||||
<style>
|
||||
{% include("LabelSystem/labels/label_style.css.twig") %}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
{{ lines | raw }}
|
||||
</body>
|
||||
</html>
|
17
templates/LabelSystem/labels/label_style.css.twig
Normal file
17
templates/LabelSystem/labels/label_style.css.twig
Normal file
|
@ -0,0 +1,17 @@
|
|||
@page {
|
||||
margin: 5px 5px;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "DejaVu Sans Mono";
|
||||
font-size: 10pt;
|
||||
line-height: 1.0;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 2px;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue