diff --git a/assets/pasted-20260213-034550-9dbf9cca.png b/assets/pasted-20260213-034550-9dbf9cca.png
new file mode 100644
index 0000000..7c1c09b
Binary files /dev/null and b/assets/pasted-20260213-034550-9dbf9cca.png differ
diff --git a/check_libs.py b/check_libs.py
new file mode 100644
index 0000000..c537d23
--- /dev/null
+++ b/check_libs.py
@@ -0,0 +1,29 @@
+import os
+from cffi import FFI
+
+ffi = FFI()
+
+def _dlopen(*names):
+ for name in names:
+ try:
+ lib = ffi.dlopen(name)
+ print(f"Loaded {name}")
+ return lib
+ except OSError as e:
+ print(f"Failed to load {name}: {e}")
+ return None
+
+print("Checking gobject...")
+_dlopen('libgobject-2.0-0', 'gobject-2.0-0', 'gobject-2.0', 'libgobject-2.0.so.0')
+
+print("\nChecking pango...")
+_dlopen('libpango-1.0-0', 'pango-1.0-0', 'pango-1.0', 'libpango-1.0.so.0')
+
+print("\nChecking harfbuzz...")
+_dlopen('libharfbuzz-0', 'harfbuzz', 'harfbuzz-0.0', 'libharfbuzz.so.0')
+
+print("\nChecking fontconfig...")
+_dlopen('libfontconfig-1', 'fontconfig-1', 'fontconfig', 'libfontconfig.so.1')
+
+print("\nChecking pangoft2...")
+_dlopen('libpangoft2-1.0-0', 'pangoft2-1.0-0', 'pangoft2-1.0', 'libpangoft2-1.0.so.0')
diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc
index 2ec899d..ef3970e 100644
Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ
diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc
index 553eb16..68a3e28 100644
Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ
diff --git a/core/templates/core/barcode_labels.html b/core/templates/core/barcode_labels.html
index 15ad3dd..0dd3907 100644
--- a/core/templates/core/barcode_labels.html
+++ b/core/templates/core/barcode_labels.html
@@ -5,9 +5,14 @@
Barcode Label Printing
-
+
+
+
+
@@ -132,24 +137,17 @@
-
3. Live Preview (Single Label)
+
3. Live Preview (Queue Preview)
-
-
-
-
Product Name
-
-
-
+
+
+
- Note: This is a preview of the layout. Actual print layout depends on settings above.
+ Note: This preview shows one of each product in your queue. Actual sheet layout will be generated on print.
@@ -481,6 +479,17 @@ document.addEventListener('DOMContentLoaded', function() {
printQueueBtn.addEventListener('click', handlePrintQueue);
}
+ const clearQueueBtn = document.getElementById('clearQueueBtn');
+ if (clearQueueBtn) {
+ clearQueueBtn.addEventListener('click', function() {
+ if (confirm("Are you sure you want to clear the entire queue?")) {
+ queue.length = 0;
+ renderQueue();
+ updatePreview();
+ }
+ });
+ }
+
function handlePrintQueue() {
if (queue.length === 0) return;
preparePrint();
@@ -491,7 +500,7 @@ document.addEventListener('DOMContentLoaded', function() {
const printPreviewBtn = document.getElementById('printPreviewBtn');
if (printPreviewBtn) {
- printPreviewBtn.addEventListener('click', printSingleFromPreview);
+ printPreviewBtn.addEventListener('click', handlePrintQueue);
}
// Product Search
@@ -514,38 +523,90 @@ document.addEventListener('DOMContentLoaded', function() {
// --- PREVIEW LOGIC ---
function updatePreview() {
- let product = null;
+ const container = document.getElementById('previewContainer');
+ if (!container) return;
+
+ container.innerHTML = '';
+
+ // Items to show: either everything in the queue, or the last added if queue is empty
+ let itemsToShow = [];
if (queue.length > 0) {
- product = queue[queue.length - 1];
+ itemsToShow = [...queue];
} else if (lastAddedProduct) {
- product = lastAddedProduct;
+ itemsToShow = [lastAddedProduct];
}
-
- if (!product) return;
-
- const previewName = document.querySelector('.preview-name');
- const previewSku = document.querySelector('.preview-sku');
- const previewPrice = document.querySelector('.preview-price');
-
- if (previewName) previewName.innerHTML = (product.nameAr ? `