label_printer/templates/text.html
2024-12-04 22:26:50 +01:00

70 lines
2.3 KiB
HTML

<!-- SPDX-License-Identifier: GPL-3.0-or-later -->
{% extends "base.html" %}
{% block head %}
<title>LabelPrinter Label generator</title>
{% endblock %}
{% block content %}
<form method="POST" action="/text-template">
<label for="template">Template:</label>
<select name="template">
<option value="DNH">Do not hack</option>
<option value="Food">Food</option>
<option value="Remove by">Remove by</option>
</select>
<input type="submit" value="Apply">
</form>
<form method="POST" action="/text-form">
<h2>Top text</h2>
Text:<br>
<textarea name="string1">{{text1["string"]}}</textarea><br>
Size: <input type="number" value="{{text1["size"]}}" name="size1" min="0" required
style="width: 40px"><br>
Y position: <input type="number" value="{{text1["pos"]}}" name="pos1" required
style="width: 40px"><br>
<h2>Bottom text</h2>
Text:<br>
<textarea name="string2">{{text2["string"]}}</textarea><br>
Size: <input type="number" value="{{text2["size"]}}" name="size2" min="0" required
style="width: 40px"><br>
Y position: <input type="number" value="{{text2["pos"]}}" name="pos2" required
style="width: 40px">
<h2>Font</h2>
<label for="font">Font:</label>
<select name="font">
{% for font in fonts %}
<option value="{{ font }}"{% if fonts[font].selected %} selected{% endif %}>{{ fonts[font].name }}</option>
{% endfor %}
</select>
<br />
<input type="submit" value="Generate preview">
</form>
{% if info %}
<p class="info" style="color: {{info_color}}">{{info}}</p>
{% endif %}
{% if filename %}
<img src="user_data/{{filename}}" alt="Generated Image" style="height: 150px; width: auto;">
<form method="POST" action="/text-print">
{% if cut %}
<input type="checkbox" name="cut" value="cut" checked>
{%else %}
<input type="checkbox" name="cut" value="cut">
{%endif%}
<label for="cut"> Cut paper after printing </label><br>
<input type="submit" value="Print" style="font-size: 2em; padding: 20px 40px;">
</form>
{% endif %}
{% endblock %}