updated template creation

This commit is contained in:
2025-05-07 16:38:40 +03:00
parent 31e0ffd6dc
commit 45c9669393
5 changed files with 362 additions and 142 deletions

View File

@@ -22,11 +22,20 @@
<label for="label-height">Height (mm):</label>
<input type="number" id="label-height" name="label_height" required>
</div>
<button type="button" id="set-dimensions-btn" class="btn">Set Label Dimensions</button>
</form>
</div>
<hr style="margin: 20px 0;">
<!-- Add Fields Section -->
<div>
<h4>Add Fields</h4>
<button type="button" class="btn add-field-btn" data-type="text-label">Add Text Label</button>
<button type="button" class="btn add-field-btn" data-type="text-input">Add Text Input</button>
<button type="button" class="btn add-field-btn" data-type="barcode">Add Barcode</button>
<button type="button" class="btn add-field-btn" data-type="qrcode">Add QR Code</button>
</div>
<!-- Get Database Headers Section -->
<div>
<h4>Get Database Headers</h4>
@@ -42,10 +51,7 @@
<hr style="margin: 20px 0;">
<!-- Generate PDF Template -->
<div>
<button type="button" id="generate-pdf-btn" class="btn">Generate PDF Template</button>
</div>
</div>
</div>
@@ -53,11 +59,20 @@
<div class="right-column" style="flex: 2;">
<div class="dashboard-card">
<h3>Interactive Label Preview</h3>
<p>Preview the label with selected headers:</p>
<div id="label-preview" style="border: 1px solid #ddd; padding: 10px; min-height: 200px;">
<!-- Label preview will be dynamically updated here -->
<p>Drag and drop fields to design your label:</p>
<div class="label-preview-container" style="display: flex; justify-content: center; align-items: center; height: 100%; position: relative;">
<div id="label-preview" style="border: 1px solid #ddd; padding: 10px; min-height: 400px; position: relative;">
<!-- Fields will be dynamically added here -->
</div>
</div>
<button type="button" id="preview-btn" class="btn" style="margin-top: 10px;">Preview</button>
</div>
</div>
</div>
<script src="{{ url_for('static', filename='pdfjs/pdf.worker.js') }}"></script>
<script>
// Set the worker source for PDF.js
pdfjsLib.GlobalWorkerOptions.workerSrc = "{{ url_for('static', filename='pdfjs/pdf.worker.min.js') }}";
</script>
{% endblock %}