From 6c59d1233fb57c321e27d1593302efd744b752b8 Mon Sep 17 00:00:00 2001 From: kalipso Date: Tue, 1 Jul 2025 23:45:27 +0200 Subject: [PATCH] show invoice after print --- controllers/printController.go | 7 ++- static/output.css | 96 ++++++++++++---------------------- views/invoice.html | 49 +++++++++++++++++ views/invoiceview.html | 52 +----------------- views/printstarted.html | 22 ++++++++ views/printvariant.html | 2 +- 6 files changed, 113 insertions(+), 115 deletions(-) create mode 100644 views/invoice.html create mode 100644 views/printstarted.html diff --git a/controllers/printController.go b/controllers/printController.go index a7bf78f..988d388 100644 --- a/controllers/printController.go +++ b/controllers/printController.go @@ -186,5 +186,10 @@ func (rc *printController) PrintHandler(c *gin.Context) { go executeJobs() - c.HTML(http.StatusOK, "index.html", nil) + fmt.Println(invoice) + data := CreateSessionData(c, gin.H{ + "invoice": invoice, + }) + + c.HTML(http.StatusOK, "printstarted.html", data) } diff --git a/static/output.css b/static/output.css index 667f7ca..f3583d6 100644 --- a/static/output.css +++ b/static/output.css @@ -591,6 +591,10 @@ video { grid-column: span 3 / span 3; } +.-m-1\.5 { + margin: -0.375rem; +} + .m-2 { margin: 0.5rem; } @@ -599,8 +603,8 @@ video { margin: 1rem; } -.-m-1\.5 { - margin: -0.375rem; +.m-8 { + margin: 2rem; } .-mx-2 { @@ -690,10 +694,6 @@ video { display: flex; } -.inline-flex { - display: inline-flex; -} - .table { display: table; } @@ -798,6 +798,10 @@ video { max-width: 1280px; } +.max-w-4xl { + max-width: 56rem; +} + .flex-1 { flex: 1 1 0%; } @@ -838,6 +842,10 @@ video { grid-template-columns: repeat(6, minmax(0, 1fr)); } +.grid-cols-7 { + grid-template-columns: repeat(7, minmax(0, 1fr)); +} + .flex-col { flex-direction: column; } @@ -883,11 +891,6 @@ video { row-gap: 1rem; } -.gap-x-2 { - -moz-column-gap: 0.5rem; - column-gap: 0.5rem; -} - .space-x-4 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(1rem * var(--tw-space-x-reverse)); @@ -1000,10 +1003,6 @@ video { border-color: rgb(209 213 219 / var(--tw-border-opacity, 1)); } -.border-transparent { - border-color: transparent; -} - .bg-amber-100 { --tw-bg-opacity: 1; background-color: rgb(254 243 199 / var(--tw-bg-opacity, 1)); @@ -1302,6 +1301,10 @@ video { object-fit: cover; } +.p-1\.5 { + padding: 0.375rem; +} + .p-2 { padding: 0.5rem; } @@ -1314,8 +1317,8 @@ video { padding: 1rem; } -.p-1\.5 { - padding: 0.375rem; +.p-8 { + padding: 2rem; } .px-2 { @@ -1383,6 +1386,11 @@ video { padding-bottom: 6rem; } +.py-3 { + padding-top: 0.75rem; + padding-bottom: 0.75rem; +} + .py-4 { padding-top: 1rem; padding-bottom: 1rem; @@ -1393,9 +1401,9 @@ video { padding-bottom: 2rem; } -.py-3 { - padding-top: 0.75rem; - padding-bottom: 0.75rem; +.px-8 { + padding-left: 2rem; + padding-right: 2rem; } .pb-3 { @@ -1802,11 +1810,6 @@ video { color: rgb(39 39 42 / var(--tw-text-opacity, 1)); } -.text-blue-600 { - --tw-text-opacity: 1; - color: rgb(37 99 235 / var(--tw-text-opacity, 1)); -} - .antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -1954,11 +1957,6 @@ video { color: rgb(255 255 255 / var(--tw-text-opacity, 1)); } -.hover\:text-blue-800:hover { - --tw-text-opacity: 1; - color: rgb(30 64 175 / var(--tw-text-opacity, 1)); -} - .hover\:underline:hover { text-decoration-line: underline; } @@ -1972,11 +1970,6 @@ video { border-color: rgb(59 130 246 / var(--tw-border-opacity, 1)); } -.focus\:text-blue-800:focus { - --tw-text-opacity: 1; - color: rgb(30 64 175 / var(--tw-text-opacity, 1)); -} - .focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; @@ -2036,14 +2029,6 @@ video { outline-color: #4f46e5; } -.disabled\:pointer-events-none:disabled { - pointer-events: none; -} - -.disabled\:opacity-50:disabled { - opacity: 0.5; -} - .group:hover .group-hover\:fill-red-400 { fill: #f87171; } @@ -2328,16 +2313,6 @@ video { color: rgb(17 24 39 / var(--tw-text-opacity, 1)); } - .dark\:text-white { - --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity, 1)); - } - - .dark\:text-blue-500 { - --tw-text-opacity: 1; - color: rgb(59 130 246 / var(--tw-text-opacity, 1)); - } - .dark\:text-neutral-200 { --tw-text-opacity: 1; color: rgb(229 229 229 / var(--tw-text-opacity, 1)); @@ -2348,6 +2323,11 @@ video { color: rgb(115 115 115 / var(--tw-text-opacity, 1)); } + .dark\:text-white { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity, 1)); + } + .dark\:placeholder-gray-400::-moz-placeholder { --tw-placeholder-opacity: 1; color: rgb(156 163 175 / var(--tw-placeholder-opacity, 1)); @@ -2373,21 +2353,11 @@ video { color: rgb(255 255 255 / var(--tw-text-opacity, 1)); } - .dark\:hover\:text-blue-400:hover { - --tw-text-opacity: 1; - color: rgb(96 165 250 / var(--tw-text-opacity, 1)); - } - .dark\:focus\:border-blue-500:focus { --tw-border-opacity: 1; border-color: rgb(59 130 246 / var(--tw-border-opacity, 1)); } - .dark\:focus\:text-blue-400:focus { - --tw-text-opacity: 1; - color: rgb(96 165 250 / var(--tw-text-opacity, 1)); - } - .dark\:focus\:ring-blue-500:focus { --tw-ring-opacity: 1; --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1)); diff --git a/views/invoice.html b/views/invoice.html new file mode 100644 index 0000000..85c2a4c --- /dev/null +++ b/views/invoice.html @@ -0,0 +1,49 @@ +
+
+
+ + + + + + + + + + + + + + {{ range .PrintJobs }} + + + + + + + + + + + {{ end }} + + + + + + + + + + + +
ImageNameVariantPaperCoverPaperAmountPrice
+ + imac image + + {{ .ShopItem.Name }}{{ .Variant.Name}}{{ .PaperType.Brand }} - {{.PaperType.Name }}: {{ .PaperType.Size }} {{ .PaperType.Weight }}g/m2{{ .PaperType.Brand }} - {{.PaperType.Name }}: {{ .PaperType.Size }} {{ .PaperType.Weight }}g/m2{{ .Amount }}{{ .PriceTotal }}
+ TOTAL + {{ .PriceTotal }}
+
+
+
diff --git a/views/invoiceview.html b/views/invoiceview.html index 226f8f1..adaddb8 100644 --- a/views/invoiceview.html +++ b/views/invoiceview.html @@ -15,56 +15,8 @@
-
-
-
- - - - - - - - - - - - - - {{ range .PrintJobs }} - - - - - - - - - - - {{ end }} - - - - - - - - - - - -
ImageNameVariantPaperCoverPaperAmountPrice
- - imac image - - {{ .ShopItem.Name }}{{ .Variant.Name}}{{ .PaperType.Brand }} - {{.PaperType.Name }}: {{ .PaperType.Size }} {{ .PaperType.Weight }}g/m2{{ .PaperType.Brand }} - {{.PaperType.Name }}: {{ .PaperType.Size }} {{ .PaperType.Weight }}g/m2{{ .Amount }}{{ .PriceTotal }}
- TOTAL - {{ .PriceTotal }}
-
-
-
-
+ {{ template "invoice.html" . }} +
diff --git a/views/printstarted.html b/views/printstarted.html new file mode 100644 index 0000000..d470e46 --- /dev/null +++ b/views/printstarted.html @@ -0,0 +1,22 @@ +{{ template "header.html" . }} + +
+
+
+
+

Print Started +

+
+
+ {{ template "invoice.html" .data.invoice }} +
+
+
+
+
+
+
+
+ + +{{ template "footer.html" . }} diff --git a/views/printvariant.html b/views/printvariant.html index 44f85f9..28c72ac 100644 --- a/views/printvariant.html +++ b/views/printvariant.html @@ -15,7 +15,7 @@

CoverPage: If selected, the Printer will take Paper from the BypassTray for the first page. For example you can put colored paper there to have a nice looking front page, and the rest will be normal paper. - Makue sure you put paper in that tray when selecting this option.

+ Make sure you put paper in that tray when selecting this option.

Print Order: The Zines will be printed from top to bottom as seen in this list.