From dce55183d21d368059a71b69b8a1a190cd83cdba Mon Sep 17 00:00:00 2001 From: nic Date: Thu, 2 Jan 2025 14:27:18 -0500 Subject: [PATCH] updated some invoice button logic that was incorrect and updated the input styles --- apps/web/main.go | 4 ++-- internal/handlers/web/invoices.go | 4 ++-- static/css/styles.css | 2 +- templates/partials/invoice_search.html | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/web/main.go b/apps/web/main.go index aefd84e..1b69d2d 100644 --- a/apps/web/main.go +++ b/apps/web/main.go @@ -40,8 +40,8 @@ func main() { protected.HandleFunc("/jobs", web.JobsHandler).Methods("GET") protected.HandleFunc("/invoices", web.InvoicesHandler).Methods("GET", "POST") protected.HandleFunc("/ok-invoice/{id}", web.UpdateInvoiceStatusHandler).Methods("PUT") - protected.HandleFunc("/fail-invoice/{id}", web.UpdateInvoiceStatusHandler).Methods("PUT") - protected.HandleFunc("/pending-invoice/{id}", web.UpdateInvoiceStatusHandler).Methods("PUT") + protected.HandleFunc("/failed-invoice/{id}", web.UpdateInvoiceStatusHandler).Methods("PUT") + protected.HandleFunc("/pending_accounting-invoice/{id}", web.UpdateInvoiceStatusHandler).Methods("PUT") protected.HandleFunc("/processed-invoice/{id}", web.UpdateInvoiceStatusHandler).Methods("PUT") protected.HandleFunc("/void-invoice/{id}", web.UpdateInvoiceStatusHandler).Methods("PUT") protected.HandleFunc("/admin", web.AdminHandler).Methods("GET") diff --git a/internal/handlers/web/invoices.go b/internal/handlers/web/invoices.go index 0d83dd5..585d06f 100644 --- a/internal/handlers/web/invoices.go +++ b/internal/handlers/web/invoices.go @@ -22,7 +22,7 @@ type StatusButton struct { var statusButtons = []StatusButton{ {"draft", "Draft Invoice", "success-button", "Are you sure you want to draft this invoice?"}, {"ok", "Ok Invoice", "success-button", "Are you sure you want to mark this invoice as OK?"}, - {"fail", "Fail Invoice", "caution-button", "Are you sure you want to fail this invoice?"}, + {"failed", "Fail Invoice", "caution-button", "Are you sure you want to fail this invoice?"}, {"pending_accounting", "Pending Invoice", "caution-button", "Are you sure you want to mark this invoice as pending?"}, {"processed", "Process Invoice", "warning-button", "Are you sure you want to process this invoice?"}, {"void", "Void Invoice", "warning-button", "Are you sure you want to void this invoice?"}, @@ -186,7 +186,7 @@ func UpdateInvoiceStatusHandler(w http.ResponseWriter, r *http.Request) { // Validate the status validStatuses := map[string]bool{ "draft": true, - "fail": true, + "failed": true, "ok": true, "pending_accounting": true, "processed": true, diff --git a/static/css/styles.css b/static/css/styles.css index d0cc58e..cc5e902 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -206,7 +206,7 @@ html { } .card-input { - width: 100%; + width: 95%; /* Adjust size as needed */ padding: 0.25rem 0.5rem; /* Smaller padding */ diff --git a/templates/partials/invoice_search.html b/templates/partials/invoice_search.html index 998ca0e..e32fc84 100644 --- a/templates/partials/invoice_search.html +++ b/templates/partials/invoice_search.html @@ -3,7 +3,7 @@
-