Added basic label generation dialog.

This commit is contained in:
Jan Böhmer 2020-04-16 19:56:30 +02:00
parent ea0d72bfbb
commit a4e1a17b4a
12 changed files with 230 additions and 5 deletions

View 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 %}

View 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>

View 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;
}