label_printer/templates/text.html

68 lines
2.2 KiB
HTML
Raw Normal View History

2024-09-25 19:48:36 +00:00
<!-- SPDX-License-Identifier: GPL-3.0-or-later -->
2024-09-14 18:49:57 +00:00
{% extends "base.html" %}
{% 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>
2024-11-27 22:55:50 +00:00
<option value="Remove by">Remove by</option>
2024-09-14 18:49:57 +00:00
</select>
<input type="submit" value="Apply">
</form>
<form method="POST" action="/text-form">
2024-11-27 23:59:36 +00:00
<h2>Top text</h2>
2024-09-15 10:24:26 +00:00
Text:<br>
<textarea name="string1">{{text1["string"]}}</textarea><br>
2024-09-14 18:49:57 +00:00
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>
2024-11-27 23:59:36 +00:00
<h2>Bottom text</h2>
2024-09-15 10:24:26 +00:00
Text:<br>
<textarea name="string2">{{text2["string"]}}</textarea><br>
2024-09-14 18:49:57 +00:00
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
2024-11-27 23:59:36 +00:00
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">
2024-09-14 18:49:57 +00:00
</form>
{% if info %}
<p class="info" style="color: {{info_color}}">{{info}}</p>
{% endif %}
2024-09-14 18:49:57 +00:00
{% if filename %}
2024-09-25 20:23:32 +00:00
<img src="user_data/{{filename}}" alt="Generated Image" style="height: 150px; width: auto;">
2024-09-14 18:49:57 +00:00
<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>
2024-09-15 11:54:29 +00:00
<input type="submit" value="Print" style="font-size: 2em; padding: 20px 40px;">
2024-09-14 18:49:57 +00:00
</form>
{% endif %}
2024-09-14 18:49:57 +00:00
{% endblock %}