diff --git a/handlers/bundle.go b/handlers/bundle.go new file mode 100644 index 0000000..dd3f365 --- /dev/null +++ b/handlers/bundle.go @@ -0,0 +1,20 @@ +package handlers + +import ( + "net/http" + "text/template" + + "git.espin.casa/albert/cml04-falcon-ui/storage" + "github.com/julienschmidt/httprouter" +) + +func BundleHandler(storage storage.Storager) httprouter.Handle { + return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { + t, _ := template.ParseFiles("templates/base.html", "templates/bundle.html") + err := t.Execute(w, nil) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + } +} diff --git a/routes/routes.go b/routes/routes.go index acbe72d..58aec29 100644 --- a/routes/routes.go +++ b/routes/routes.go @@ -16,4 +16,5 @@ func CreateRoutes(r *httprouter.Router, storage storage.Storager) { r.GET("/barcodes", handlers.BarcodesHandler(storage)) r.GET("/labels", handlers.LabelsHandler()) r.GET("/standards", handlers.StandardsHandler(storage)) + r.GET("/bundle", handlers.BundleHandler(storage)) } diff --git a/templates/bcp.html b/templates/bcp.html index 1bafc42..8bcb56d 100644 --- a/templates/bcp.html +++ b/templates/bcp.html @@ -39,7 +39,7 @@
diff --git a/templates/bundle.html b/templates/bundle.html index ec55151..83bccca 100644 --- a/templates/bundle.html +++ b/templates/bundle.html @@ -39,7 +39,7 @@
diff --git a/templates/lcp.html b/templates/lcp.html index 419ce89..f09e794 100644 --- a/templates/lcp.html +++ b/templates/lcp.html @@ -39,7 +39,7 @@
diff --git a/templates/po.html b/templates/po.html index 3c22adc..74ebef9 100644 --- a/templates/po.html +++ b/templates/po.html @@ -39,7 +39,7 @@