From f673933c4c7727e9e0140602e1c8a7ba4d1ea26e Mon Sep 17 00:00:00 2001 From: Sas Andy Date: Fri, 10 May 2024 08:53:32 +0700 Subject: [PATCH 1/8] login --- handlers/public/login.handlers.go | 33 +++ handlers/routes.go | 2 + services/public/login.services.go | 14 ++ views/public/login/login.templ | 103 ++++++++ views/public/login/login_templ.go | 158 ++++++++++++ views/public/login/logincomponent.templ | 274 +++++++++++++++++++++ views/public/login/logincomponent_templ.go | 107 ++++++++ 7 files changed, 691 insertions(+) create mode 100644 handlers/public/login.handlers.go create mode 100644 services/public/login.services.go create mode 100644 views/public/login/login.templ create mode 100644 views/public/login/login_templ.go create mode 100644 views/public/login/logincomponent.templ create mode 100644 views/public/login/logincomponent_templ.go diff --git a/handlers/public/login.handlers.go b/handlers/public/login.handlers.go new file mode 100644 index 0000000..f703162 --- /dev/null +++ b/handlers/public/login.handlers.go @@ -0,0 +1,33 @@ +package public_handlers + +import ( + "cpone/utils" + public_login "cpone/views/public/login" + + "github.com/labstack/echo/v4" +) + +type LoginService interface { +} + +func NewLoginHandler(us LoginService) *LoginHandler { + return &LoginHandler{ + LoginService: us, + } +} + +type LoginHandler struct { + LoginService LoginService +} + +// func (uh *LoginHandler) ShowLogin(c echo.Context) error { +// helo := client_Login.Show() +// return utils.View(c, helo) +// } + +func (lh *LoginHandler) HandlerShowLogin(c echo.Context) error { + + si := public_login.ShowLogin("Login ", public_login.MainLogin(), public_login.CssLogin(), public_login.JsLogin()) + + return utils.View(c, si) +} diff --git a/handlers/routes.go b/handlers/routes.go index d2851b3..c0947c2 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -67,6 +67,8 @@ func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) { l := public_services.NewServicesLandingPage(public_services.LandingPage{}, appStore) lh := public_handlers.NewLandingPageHandler(l) public.GET("landingpage", lh.ShowLandingPage) + loginHdr := public_handlers.NewLoginHandler(l) + public.GET("login", loginHdr.HandlerShowLogin) } func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) { public := app.Group("/corp") diff --git a/services/public/login.services.go b/services/public/login.services.go new file mode 100644 index 0000000..5ef470b --- /dev/null +++ b/services/public/login.services.go @@ -0,0 +1,14 @@ +package public_services + +import "cpone/db" + +type ServicesLogin struct { + CompanyStore db.AppStore +} + +func NewServicesLogin(uStore db.AppStore) *ServicesLogin { + + return &ServicesLogin{ + CompanyStore: uStore, + } +} diff --git a/views/public/login/login.templ b/views/public/login/login.templ new file mode 100644 index 0000000..79a9572 --- /dev/null +++ b/views/public/login/login.templ @@ -0,0 +1,103 @@ +package public_login + +import ( + "cpone/layout" +) + +templ MainLogin() { +
+ + +
+} + +templ CssLogin() { + +} + +templ JsLogin() { + +} + +templ ShowLogin(title string, cmp templ.Component, css templ.Component, js templ.Component) { + @layout.PlaygroundLayout(title, css, js) { + @cmp + } +} diff --git a/views/public/login/login_templ.go b/views/public/login/login_templ.go new file mode 100644 index 0000000..1d9ea00 --- /dev/null +++ b/views/public/login/login_templ.go @@ -0,0 +1,158 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package public_login + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/layout" +) + +func MainLogin() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = AsideLeft().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = FormSignin().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = FormSignup().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = ForgotPassword().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func CssLogin() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func JsLogin() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func ShowLogin(title string, cmp templ.Component, css templ.Component, js templ.Component) templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = cmp.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = layout.PlaygroundLayout(title, css, js).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} diff --git a/views/public/login/logincomponent.templ b/views/public/login/logincomponent.templ new file mode 100644 index 0000000..4fdb036 --- /dev/null +++ b/views/public/login/logincomponent.templ @@ -0,0 +1,274 @@ +package public_login + +templ AsideLeft() { +
+ +
+ +
+ Empowering Your Workforce's Health +
+ + +
+ Discover peace of mind and prioritize your health with our + comprehensive medical check-up packages +
+ +
+ + +
+ +
+ +
+} + +templ FormSignin() { +
+ +
+ +
+
+

+ Welcome to Corporate Portal +

+
+
+

+ Sign in to access your account +

+
+ + +
+ + +
+ + +
+
+ +
+
+ + +
+ + + + + + +
+
+
+ + + +
+ +
+ +
+} + +templ FormSignup() { +
+ +
+

+ Sign Up +

+

+ Enter your details to create your account +

+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ +
+} + +templ ForgotPassword() { +
+ +
+ +
+
+

+ Forgotten Password ? +

+

+ Enter your email to reset your password +

+
+ + +
+ +
+ + +
+ + +
+ +
+} diff --git a/views/public/login/logincomponent_templ.go b/views/public/login/logincomponent_templ.go new file mode 100644 index 0000000..dbc6104 --- /dev/null +++ b/views/public/login/logincomponent_templ.go @@ -0,0 +1,107 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package public_login + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +func AsideLeft() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Empowering Your Workforce's Health\r
Discover peace of mind and prioritize your health with our\r comprehensive medical check-up packages\r
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func FormSignin() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"\"

Welcome to Corporate Portal\r

Sign in to access your account\r

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func FormSignup() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Sign Up\r

Enter your details to create your account\r

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func ForgotPassword() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
\"\"

Forgotten Password ?\r

Enter your email to reset your password\r

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} From f6d177f2f13662b0f7ffa1bbb82c3d16390fd899 Mon Sep 17 00:00:00 2001 From: Sas Andy Date: Fri, 10 May 2024 09:23:40 +0700 Subject: [PATCH 2/8] patient underdev --- handlers/corporate/patient.handlers.go | 26 +++++ handlers/routes.go | 2 + services/corporate/patient.services.go | 15 +++ views/corporate/patient/patient.templ | 40 +++++++ views/corporate/patient/patient_templ.go | 131 +++++++++++++++++++++++ 5 files changed, 214 insertions(+) create mode 100644 handlers/corporate/patient.handlers.go create mode 100644 services/corporate/patient.services.go create mode 100644 views/corporate/patient/patient.templ create mode 100644 views/corporate/patient/patient_templ.go diff --git a/handlers/corporate/patient.handlers.go b/handlers/corporate/patient.handlers.go new file mode 100644 index 0000000..47dcdf5 --- /dev/null +++ b/handlers/corporate/patient.handlers.go @@ -0,0 +1,26 @@ +package corporate_handlers + +import ( + "cpone/utils" + corporate_patient "cpone/views/corporate/Patient" + + "github.com/labstack/echo/v4" +) + +type PatientService interface { +} + +func NewPatientHandler(us PatientService) *PatientHandler { + return &PatientHandler{ + PatientService: us, + } +} + +type PatientHandler struct { + PatientService PatientService +} + +func (uh *PatientHandler) ShowPatient(c echo.Context) error { + helo := corporate_patient.Show() + return utils.View(c, helo) +} diff --git a/handlers/routes.go b/handlers/routes.go index c0947c2..4c328ef 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -75,6 +75,8 @@ func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) { l := corporate_services.NewServicesCompany(appStore) lh := corporate_handlers.NewCompanyHandler(l) public.GET("/company", lh.ShowCompany) + patientHandler := corporate_handlers.NewPatientHandler(l) + public.GET("/patient", patientHandler.ShowPatient) } func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) { diff --git a/services/corporate/patient.services.go b/services/corporate/patient.services.go new file mode 100644 index 0000000..7d22b22 --- /dev/null +++ b/services/corporate/patient.services.go @@ -0,0 +1,15 @@ +package corporate_services + +import "cpone/db" + +type ServicesPatient struct { + PatientStore db.AppStore +} + +func NewServicesPatient(uStore db.AppStore) *ServicesPatient { + + return &ServicesPatient{ + + PatientStore: uStore, + } +} diff --git a/views/corporate/patient/patient.templ b/views/corporate/patient/patient.templ new file mode 100644 index 0000000..b2dfa42 --- /dev/null +++ b/views/corporate/patient/patient.templ @@ -0,0 +1,40 @@ +package corporate_company + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +templ Content() { +
+ @under_development.UnderDevelopment() +
+} + +templ Css() { + +} + +templ Js() { +} + +templ Show() { + @layout.PlaygroundLayout("Corp Patient", Css(), Js()) { + @Content() + } +} diff --git a/views/corporate/patient/patient_templ.go b/views/corporate/patient/patient_templ.go new file mode 100644 index 0000000..ae0cfb4 --- /dev/null +++ b/views/corporate/patient/patient_templ.go @@ -0,0 +1,131 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package corporate_company + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +func Content() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = under_development.UnderDevelopment().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Css() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Js() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Show() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = Content().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = layout.PlaygroundLayout("Corp Patient", Css(), Js()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} From ff0f95a67f1ceca759a5b806c5c906a3f7c1b969 Mon Sep 17 00:00:00 2001 From: Sas Andy Date: Fri, 10 May 2024 09:32:36 +0700 Subject: [PATCH 3/8] client dashboard --- handlers/client/clientdashboard.handlers.go | 26 ++++ handlers/routes.go | 2 + services/client/clientdashboard.services.go | 15 +++ views/client/dashboard/dashboard.templ | 40 ++++++ views/client/dashboard/dashboard_templ.go | 131 ++++++++++++++++++++ 5 files changed, 214 insertions(+) create mode 100644 handlers/client/clientdashboard.handlers.go create mode 100644 services/client/clientdashboard.services.go create mode 100644 views/client/dashboard/dashboard.templ create mode 100644 views/client/dashboard/dashboard_templ.go diff --git a/handlers/client/clientdashboard.handlers.go b/handlers/client/clientdashboard.handlers.go new file mode 100644 index 0000000..b66d470 --- /dev/null +++ b/handlers/client/clientdashboard.handlers.go @@ -0,0 +1,26 @@ +package client_handlers + +import ( + "cpone/utils" + client_dashboard "cpone/views/client/dashboard" + + "github.com/labstack/echo/v4" +) + +type ClientDashboardService interface { +} + +func NewClientDashboardHandler(us ClientDashboardService) *ClientDashboardHandler { + return &ClientDashboardHandler{ + ClientDashboardService: us, + } +} + +type ClientDashboardHandler struct { + ClientDashboardService ClientDashboardService +} + +func (uh *ClientDashboardHandler) ShowClientDashboard(c echo.Context) error { + helo := client_dashboard.Show() + return utils.View(c, helo) +} diff --git a/handlers/routes.go b/handlers/routes.go index 4c328ef..79367ae 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -84,4 +84,6 @@ func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) { l := client_services.NewServicesMdBahan(appStore) lh := client_handlers.NewMdBahanHandler(l) public.GET("/md/bahan", lh.ShowMdBahan) + clientdshbrdHandler := client_handlers.NewClientDashboardHandler(l) + public.GET("", clientdshbrdHandler.ShowClientDashboard) } diff --git a/services/client/clientdashboard.services.go b/services/client/clientdashboard.services.go new file mode 100644 index 0000000..219f9d4 --- /dev/null +++ b/services/client/clientdashboard.services.go @@ -0,0 +1,15 @@ +package client_services + +import "cpone/db" + +type ServicesClientDashboard struct { + CLientDashboardStore db.AppStore +} + +func NewServicesClientDashboard(uStore db.AppStore) *ServicesClientDashboard { + + return &ServicesClientDashboard{ + + CLientDashboardStore: uStore, + } +} diff --git a/views/client/dashboard/dashboard.templ b/views/client/dashboard/dashboard.templ new file mode 100644 index 0000000..513eac9 --- /dev/null +++ b/views/client/dashboard/dashboard.templ @@ -0,0 +1,40 @@ +package client_dashboard + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +templ Content() { +
+ @under_development.UnderDevelopment() +
+} + +templ Css() { + +} + +templ Js() { +} + +templ Show() { + @layout.PlaygroundLayout("Client Dashboard", Css(), Js()) { + @Content() + } +} diff --git a/views/client/dashboard/dashboard_templ.go b/views/client/dashboard/dashboard_templ.go new file mode 100644 index 0000000..4afd476 --- /dev/null +++ b/views/client/dashboard/dashboard_templ.go @@ -0,0 +1,131 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package client_dashboard + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +func Content() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = under_development.UnderDevelopment().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Css() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Js() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Show() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = Content().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = layout.PlaygroundLayout("Client Dashboard", Css(), Js()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} From 6a8f7ef6561bc05c9cb55d3305e83229562a64c1 Mon Sep 17 00:00:00 2001 From: Sas Andy Date: Fri, 10 May 2024 09:41:07 +0700 Subject: [PATCH 4/8] client md user --- handlers/client/mduser.handlers.go | 26 ++++++ handlers/routes.go | 2 + services/client/mduser.services.go | 15 ++++ views/client/mduser/mduser.templ | 40 +++++++++ views/client/mduser/mduser_templ.go | 131 ++++++++++++++++++++++++++++ 5 files changed, 214 insertions(+) create mode 100644 handlers/client/mduser.handlers.go create mode 100644 services/client/mduser.services.go create mode 100644 views/client/mduser/mduser.templ create mode 100644 views/client/mduser/mduser_templ.go diff --git a/handlers/client/mduser.handlers.go b/handlers/client/mduser.handlers.go new file mode 100644 index 0000000..fd3d8da --- /dev/null +++ b/handlers/client/mduser.handlers.go @@ -0,0 +1,26 @@ +package client_handlers + +import ( + "cpone/utils" + client_mduser "cpone/views/client/mduser" + + "github.com/labstack/echo/v4" +) + +type MdUserService interface { +} + +func NewMdUserHandler(us MdUserService) *MdUserHandler { + return &MdUserHandler{ + MdUserService: us, + } +} + +type MdUserHandler struct { + MdUserService MdUserService +} + +func (uh *MdUserHandler) ShowMdUser(c echo.Context) error { + helo := client_mduser.Show() + return utils.View(c, helo) +} diff --git a/handlers/routes.go b/handlers/routes.go index 79367ae..c28f5cc 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -86,4 +86,6 @@ func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) { public.GET("/md/bahan", lh.ShowMdBahan) clientdshbrdHandler := client_handlers.NewClientDashboardHandler(l) public.GET("", clientdshbrdHandler.ShowClientDashboard) + mdUserHandler := client_handlers.NewMdUserHandler(l) + public.GET("/md/user", mdUserHandler.ShowMdUser) } diff --git a/services/client/mduser.services.go b/services/client/mduser.services.go new file mode 100644 index 0000000..ba84fa9 --- /dev/null +++ b/services/client/mduser.services.go @@ -0,0 +1,15 @@ +package client_services + +import "cpone/db" + +type ServicesMdUser struct { + MdUserStore db.AppStore +} + +func NewServicesMdUser(uStore db.AppStore) *ServicesMdUser { + + return &ServicesMdUser{ + + MdUserStore: uStore, + } +} diff --git a/views/client/mduser/mduser.templ b/views/client/mduser/mduser.templ new file mode 100644 index 0000000..5dda89b --- /dev/null +++ b/views/client/mduser/mduser.templ @@ -0,0 +1,40 @@ +package client_mduser + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +templ Content() { +
+ @under_development.UnderDevelopment() +
+} + +templ Css() { + +} + +templ Js() { +} + +templ Show() { + @layout.PlaygroundLayout("Client Md User", Css(), Js()) { + @Content() + } +} diff --git a/views/client/mduser/mduser_templ.go b/views/client/mduser/mduser_templ.go new file mode 100644 index 0000000..b36a9aa --- /dev/null +++ b/views/client/mduser/mduser_templ.go @@ -0,0 +1,131 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package client_mduser + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +func Content() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = under_development.UnderDevelopment().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Css() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Js() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Show() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = Content().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = layout.PlaygroundLayout("Client Md User", Css(), Js()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} From 0bc1cb2a49c35e358d33d2b569c146b31155cad9 Mon Sep 17 00:00:00 2001 From: Sas Andy Date: Fri, 10 May 2024 09:51:59 +0700 Subject: [PATCH 5/8] client md corp --- handlers/client/mdcorp.handlers.go | 26 ++++++ handlers/routes.go | 2 + services/client/mdcorp.services.go | 15 ++++ views/client/mdcorp/mdcorp.templ | 40 +++++++++ views/client/mdcorp/mdcorp_templ.go | 131 ++++++++++++++++++++++++++++ 5 files changed, 214 insertions(+) create mode 100644 handlers/client/mdcorp.handlers.go create mode 100644 services/client/mdcorp.services.go create mode 100644 views/client/mdcorp/mdcorp.templ create mode 100644 views/client/mdcorp/mdcorp_templ.go diff --git a/handlers/client/mdcorp.handlers.go b/handlers/client/mdcorp.handlers.go new file mode 100644 index 0000000..5cbd6db --- /dev/null +++ b/handlers/client/mdcorp.handlers.go @@ -0,0 +1,26 @@ +package client_handlers + +import ( + "cpone/utils" + client_mdcorp "cpone/views/client/mdcorp" + + "github.com/labstack/echo/v4" +) + +type MdCorpService interface { +} + +func NewMdCorpHandler(us MdCorpService) *MdCorpHandler { + return &MdCorpHandler{ + MdCorpService: us, + } +} + +type MdCorpHandler struct { + MdCorpService MdCorpService +} + +func (uh *MdCorpHandler) ShowMdCorp(c echo.Context) error { + helo := client_mdcorp.Show() + return utils.View(c, helo) +} diff --git a/handlers/routes.go b/handlers/routes.go index c28f5cc..6f48588 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -88,4 +88,6 @@ func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) { public.GET("", clientdshbrdHandler.ShowClientDashboard) mdUserHandler := client_handlers.NewMdUserHandler(l) public.GET("/md/user", mdUserHandler.ShowMdUser) + mdCorpHandler := client_handlers.NewMdCorpHandler(l) + public.GET("/md/corp", mdCorpHandler.ShowMdCorp) } diff --git a/services/client/mdcorp.services.go b/services/client/mdcorp.services.go new file mode 100644 index 0000000..3ab113e --- /dev/null +++ b/services/client/mdcorp.services.go @@ -0,0 +1,15 @@ +package client_services + +import "cpone/db" + +type ServicesMdCorp struct { + MdCorpStore db.AppStore +} + +func NewServicesMdCorp(uStore db.AppStore) *ServicesMdCorp { + + return &ServicesMdCorp{ + + MdCorpStore: uStore, + } +} diff --git a/views/client/mdcorp/mdcorp.templ b/views/client/mdcorp/mdcorp.templ new file mode 100644 index 0000000..bed72a1 --- /dev/null +++ b/views/client/mdcorp/mdcorp.templ @@ -0,0 +1,40 @@ +package client_mdcorp + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +templ Content() { +
+ @under_development.UnderDevelopment() +
+} + +templ Css() { + +} + +templ Js() { +} + +templ Show() { + @layout.PlaygroundLayout("Client Md Corp", Css(), Js()) { + @Content() + } +} diff --git a/views/client/mdcorp/mdcorp_templ.go b/views/client/mdcorp/mdcorp_templ.go new file mode 100644 index 0000000..bd2f27c --- /dev/null +++ b/views/client/mdcorp/mdcorp_templ.go @@ -0,0 +1,131 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package client_mdcorp + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +func Content() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = under_development.UnderDevelopment().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Css() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Js() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Show() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = Content().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = layout.PlaygroundLayout("Client Md Corp", Css(), Js()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} From f2a84daea06310c2d4b5a192872384876109cfb2 Mon Sep 17 00:00:00 2001 From: Sas Andy Date: Fri, 10 May 2024 10:06:05 +0700 Subject: [PATCH 6/8] client md user group --- handlers/client/mdusergroup.handlers.go | 26 ++++ handlers/routes.go | 2 + services/client/mdusergroup.services.go | 15 ++ views/client/mdusergroup/mdusergroup.templ | 40 ++++++ views/client/mdusergroup/mdusergroup_templ.go | 131 ++++++++++++++++++ 5 files changed, 214 insertions(+) create mode 100644 handlers/client/mdusergroup.handlers.go create mode 100644 services/client/mdusergroup.services.go create mode 100644 views/client/mdusergroup/mdusergroup.templ create mode 100644 views/client/mdusergroup/mdusergroup_templ.go diff --git a/handlers/client/mdusergroup.handlers.go b/handlers/client/mdusergroup.handlers.go new file mode 100644 index 0000000..7b2d781 --- /dev/null +++ b/handlers/client/mdusergroup.handlers.go @@ -0,0 +1,26 @@ +package client_handlers + +import ( + "cpone/utils" + client_mdusergroup "cpone/views/client/mdusergroup" + + "github.com/labstack/echo/v4" +) + +type MdUserGroupService interface { +} + +func NewMdUserGroupHandler(us MdUserGroupService) *MdUserGroupHandler { + return &MdUserGroupHandler{ + MdUserGroupService: us, + } +} + +type MdUserGroupHandler struct { + MdUserGroupService MdUserGroupService +} + +func (uh *MdUserGroupHandler) ShowMdUserGroup(c echo.Context) error { + helo := client_mdusergroup.Show() + return utils.View(c, helo) +} diff --git a/handlers/routes.go b/handlers/routes.go index 6f48588..d3c7904 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -90,4 +90,6 @@ func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) { public.GET("/md/user", mdUserHandler.ShowMdUser) mdCorpHandler := client_handlers.NewMdCorpHandler(l) public.GET("/md/corp", mdCorpHandler.ShowMdCorp) + mdUserGroupHandler := client_handlers.NewMdUserGroupHandler(l) + public.GET("/md/usergroup", mdUserGroupHandler.ShowMdUserGroup) } diff --git a/services/client/mdusergroup.services.go b/services/client/mdusergroup.services.go new file mode 100644 index 0000000..062c181 --- /dev/null +++ b/services/client/mdusergroup.services.go @@ -0,0 +1,15 @@ +package client_services + +import "cpone/db" + +type ServicesMdUserGroup struct { + MdUserGroupStore db.AppStore +} + +func NewServicesMdUserGroup(uStore db.AppStore) *ServicesMdUserGroup { + + return &ServicesMdUserGroup{ + + MdUserGroupStore: uStore, + } +} diff --git a/views/client/mdusergroup/mdusergroup.templ b/views/client/mdusergroup/mdusergroup.templ new file mode 100644 index 0000000..923e7f9 --- /dev/null +++ b/views/client/mdusergroup/mdusergroup.templ @@ -0,0 +1,40 @@ +package client_mdusergroup + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +templ Content() { +
+ @under_development.UnderDevelopment() +
+} + +templ Css() { + +} + +templ Js() { +} + +templ Show() { + @layout.PlaygroundLayout("Client Md User Group", Css(), Js()) { + @Content() + } +} diff --git a/views/client/mdusergroup/mdusergroup_templ.go b/views/client/mdusergroup/mdusergroup_templ.go new file mode 100644 index 0000000..e221d8f --- /dev/null +++ b/views/client/mdusergroup/mdusergroup_templ.go @@ -0,0 +1,131 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package client_mdusergroup + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +func Content() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = under_development.UnderDevelopment().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Css() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Js() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Show() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = Content().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = layout.PlaygroundLayout("Client Md User Group", Css(), Js()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} From d3d59ebedb1b1df1d37887d721bb19c93d0a1196 Mon Sep 17 00:00:00 2001 From: Sas Andy Date: Fri, 10 May 2024 14:07:37 +0700 Subject: [PATCH 7/8] client md test --- handlers/client/mdtest.handlers.go | 26 ++++++ handlers/routes.go | 2 + services/client/mdtest.services.go | 15 ++++ views/client/mdtest/mdtest.templ | 40 +++++++++ views/client/mdtest/mdtest_templ.go | 131 ++++++++++++++++++++++++++++ 5 files changed, 214 insertions(+) create mode 100644 handlers/client/mdtest.handlers.go create mode 100644 services/client/mdtest.services.go create mode 100644 views/client/mdtest/mdtest.templ create mode 100644 views/client/mdtest/mdtest_templ.go diff --git a/handlers/client/mdtest.handlers.go b/handlers/client/mdtest.handlers.go new file mode 100644 index 0000000..dbf288f --- /dev/null +++ b/handlers/client/mdtest.handlers.go @@ -0,0 +1,26 @@ +package client_handlers + +import ( + "cpone/utils" + client_mdtest "cpone/views/client/mdtest" + + "github.com/labstack/echo/v4" +) + +type MdTestService interface { +} + +func NewMdTestHandler(us MdTestService) *MdTestHandler { + return &MdTestHandler{ + MdTestService: us, + } +} + +type MdTestHandler struct { + MdTestService MdTestService +} + +func (uh *MdTestHandler) ShowMdTest(c echo.Context) error { + helo := client_mdtest.Show() + return utils.View(c, helo) +} diff --git a/handlers/routes.go b/handlers/routes.go index d3c7904..105f31a 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -92,4 +92,6 @@ func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) { public.GET("/md/corp", mdCorpHandler.ShowMdCorp) mdUserGroupHandler := client_handlers.NewMdUserGroupHandler(l) public.GET("/md/usergroup", mdUserGroupHandler.ShowMdUserGroup) + mdTestpHandler := client_handlers.NewMdTestHandler(l) + public.GET("/md/test", mdTestpHandler.ShowMdTest) } diff --git a/services/client/mdtest.services.go b/services/client/mdtest.services.go new file mode 100644 index 0000000..4695593 --- /dev/null +++ b/services/client/mdtest.services.go @@ -0,0 +1,15 @@ +package client_services + +import "cpone/db" + +type ServicesMdTest struct { + MdTestStore db.AppStore +} + +func NewServicesMdTest(uStore db.AppStore) *ServicesMdTest { + + return &ServicesMdTest{ + + MdTestStore: uStore, + } +} diff --git a/views/client/mdtest/mdtest.templ b/views/client/mdtest/mdtest.templ new file mode 100644 index 0000000..d1b1892 --- /dev/null +++ b/views/client/mdtest/mdtest.templ @@ -0,0 +1,40 @@ +package client_mdtest + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +templ Content() { +
+ @under_development.UnderDevelopment() +
+} + +templ Css() { + +} + +templ Js() { +} + +templ Show() { + @layout.PlaygroundLayout("Client Md Test", Css(), Js()) { + @Content() + } +} diff --git a/views/client/mdtest/mdtest_templ.go b/views/client/mdtest/mdtest_templ.go new file mode 100644 index 0000000..25f111e --- /dev/null +++ b/views/client/mdtest/mdtest_templ.go @@ -0,0 +1,131 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package client_mdtest + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +func Content() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = under_development.UnderDevelopment().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Css() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Js() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Show() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = Content().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = layout.PlaygroundLayout("Client Md Test", Css(), Js()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} From 9a4a9b34dc83a761fae9746b26ebe20ee213cb66 Mon Sep 17 00:00:00 2001 From: Sas Andy Date: Fri, 10 May 2024 14:35:00 +0700 Subject: [PATCH 8/8] routing --- handlers/client/mcupreregister.handlers.go | 26 ++++ handlers/client/mcusetup.handlers.go | 26 ++++ handlers/client/mdprofile.handlers.go | 26 ++++ .../client/transaksisamplestation.handler.go | 26 ++++ handlers/routes.go | 54 ++++++-- services/client/mcupreregister.services.go | 15 ++ services/client/mcusetup.services.go | 15 ++ services/client/mdprofile.services.go | 15 ++ .../client/transaksisamplestation.services.go | 15 ++ .../mcupreregister/mcupreregister.templ | 40 ++++++ .../mcupreregister/mcupreregister_templ.go | 131 ++++++++++++++++++ views/client/mcusetup/mcusetup.templ | 40 ++++++ views/client/mcusetup/mcusetup_templ.go | 131 ++++++++++++++++++ views/client/mdprofile/mdprofile.templ | 40 ++++++ views/client/mdprofile/mdprofile_templ.go | 131 ++++++++++++++++++ .../transaksisamplestation.templ | 40 ++++++ .../transaksisamplestation_templ.go | 131 ++++++++++++++++++ 17 files changed, 893 insertions(+), 9 deletions(-) create mode 100644 handlers/client/mcupreregister.handlers.go create mode 100644 handlers/client/mcusetup.handlers.go create mode 100644 handlers/client/mdprofile.handlers.go create mode 100644 handlers/client/transaksisamplestation.handler.go create mode 100644 services/client/mcupreregister.services.go create mode 100644 services/client/mcusetup.services.go create mode 100644 services/client/mdprofile.services.go create mode 100644 services/client/transaksisamplestation.services.go create mode 100644 views/client/mcupreregister/mcupreregister.templ create mode 100644 views/client/mcupreregister/mcupreregister_templ.go create mode 100644 views/client/mcusetup/mcusetup.templ create mode 100644 views/client/mcusetup/mcusetup_templ.go create mode 100644 views/client/mdprofile/mdprofile.templ create mode 100644 views/client/mdprofile/mdprofile_templ.go create mode 100644 views/client/transaksisamplestation/transaksisamplestation.templ create mode 100644 views/client/transaksisamplestation/transaksisamplestation_templ.go diff --git a/handlers/client/mcupreregister.handlers.go b/handlers/client/mcupreregister.handlers.go new file mode 100644 index 0000000..2f76f0c --- /dev/null +++ b/handlers/client/mcupreregister.handlers.go @@ -0,0 +1,26 @@ +package client_handlers + +import ( + "cpone/utils" + client_mcupreregister "cpone/views/client/mcupreregister" + + "github.com/labstack/echo/v4" +) + +type MCUPreregisterService interface { +} + +func NewMCUPreregisterHandler(us MCUPreregisterService) *MCUPreregisterHandler { + return &MCUPreregisterHandler{ + MCUPreregisterService: us, + } +} + +type MCUPreregisterHandler struct { + MCUPreregisterService MCUPreregisterService +} + +func (uh *MCUPreregisterHandler) ShowMCUPreregister(c echo.Context) error { + helo := client_mcupreregister.Show() + return utils.View(c, helo) +} diff --git a/handlers/client/mcusetup.handlers.go b/handlers/client/mcusetup.handlers.go new file mode 100644 index 0000000..48fc23a --- /dev/null +++ b/handlers/client/mcusetup.handlers.go @@ -0,0 +1,26 @@ +package client_handlers + +import ( + "cpone/utils" + client_mcusetup "cpone/views/client/mcusetup" + + "github.com/labstack/echo/v4" +) + +type MCUSetupService interface { +} + +func NewMCUSetupHandler(us MCUSetupService) *MCUSetupHandler { + return &MCUSetupHandler{ + MCUSetupService: us, + } +} + +type MCUSetupHandler struct { + MCUSetupService MCUSetupService +} + +func (uh *MCUSetupHandler) ShowMCUSetup(c echo.Context) error { + helo := client_mcusetup.Show() + return utils.View(c, helo) +} diff --git a/handlers/client/mdprofile.handlers.go b/handlers/client/mdprofile.handlers.go new file mode 100644 index 0000000..68c6fa5 --- /dev/null +++ b/handlers/client/mdprofile.handlers.go @@ -0,0 +1,26 @@ +package client_handlers + +import ( + "cpone/utils" + client_mdprofile "cpone/views/client/mdprofile" + + "github.com/labstack/echo/v4" +) + +type MdProfileService interface { +} + +func NewMdProfileHandler(us MdProfileService) *MdProfileHandler { + return &MdProfileHandler{ + MdProfileService: us, + } +} + +type MdProfileHandler struct { + MdProfileService MdProfileService +} + +func (uh *MdProfileHandler) ShowMdProfile(c echo.Context) error { + helo := client_mdprofile.Show() + return utils.View(c, helo) +} diff --git a/handlers/client/transaksisamplestation.handler.go b/handlers/client/transaksisamplestation.handler.go new file mode 100644 index 0000000..71521a1 --- /dev/null +++ b/handlers/client/transaksisamplestation.handler.go @@ -0,0 +1,26 @@ +package client_handlers + +import ( + "cpone/utils" + client_transaksisamplestation "cpone/views/client/TransaksiSampleStation" + + "github.com/labstack/echo/v4" +) + +type TransaksiSampleStationService interface { +} + +func NewTransaksiSampleStationHandler(us TransaksiSampleStationService) *TransaksiSampleStationHandler { + return &TransaksiSampleStationHandler{ + TransaksiSampleStationService: us, + } +} + +type TransaksiSampleStationHandler struct { + TransaksiSampleStationService TransaksiSampleStationService +} + +func (uh *TransaksiSampleStationHandler) ShowTransaksiSampleStation(c echo.Context) error { + helo := client_transaksisamplestation.Show() + return utils.View(c, helo) +} diff --git a/handlers/routes.go b/handlers/routes.go index 105f31a..a034426 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -81,17 +81,53 @@ func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) { func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) { public := app.Group("/client") - l := client_services.NewServicesMdBahan(appStore) - lh := client_handlers.NewMdBahanHandler(l) - public.GET("/md/bahan", lh.ShowMdBahan) - clientdshbrdHandler := client_handlers.NewClientDashboardHandler(l) + //MD BAHAN + mdBahanService := client_services.NewServicesMdBahan(appStore) + mdbahanHandler := client_handlers.NewMdBahanHandler(mdBahanService) + public.GET("/md/bahan", mdbahanHandler.ShowMdBahan) + + //Client Dahboard + clientDashboardService := client_services.NewServicesClientDashboard(appStore) + clientdshbrdHandler := client_handlers.NewClientDashboardHandler(clientDashboardService) public.GET("", clientdshbrdHandler.ShowClientDashboard) - mdUserHandler := client_handlers.NewMdUserHandler(l) + + //MD User + mdUserService := client_services.NewServicesMdUser(appStore) + mdUserHandler := client_handlers.NewMdUserHandler(mdUserService) public.GET("/md/user", mdUserHandler.ShowMdUser) - mdCorpHandler := client_handlers.NewMdCorpHandler(l) + + // MD Corp + mdCorpService := client_services.NewServicesMdCorp(appStore) + mdCorpHandler := client_handlers.NewMdCorpHandler(mdCorpService) public.GET("/md/corp", mdCorpHandler.ShowMdCorp) - mdUserGroupHandler := client_handlers.NewMdUserGroupHandler(l) + + // Md User Group + mdUserGroupService := client_services.NewServicesMdUserGroup(appStore) + mdUserGroupHandler := client_handlers.NewMdUserGroupHandler(mdUserGroupService) public.GET("/md/usergroup", mdUserGroupHandler.ShowMdUserGroup) - mdTestpHandler := client_handlers.NewMdTestHandler(l) - public.GET("/md/test", mdTestpHandler.ShowMdTest) + + //MD Test + mdTestService := client_services.NewServicesMdTest(appStore) + mdTestHandler := client_handlers.NewMdTestHandler(mdTestService) + public.GET("/md/test", mdTestHandler.ShowMdTest) + + //MD Profile + mdProfileService := client_services.NewServicesMdProfile(appStore) + mdProfileHandler := client_handlers.NewMdProfileHandler(mdProfileService) + public.GET("/md/profile", mdProfileHandler.ShowMdProfile) + + //MCU Setup + mcuSetupService := client_services.NewServicesMCUSetup(appStore) + mcuSetupHandler := client_handlers.NewMCUSetupHandler(mcuSetupService) + public.GET("/mcu/setup", mcuSetupHandler.ShowMCUSetup) + + //MCU Preregister + mcuPreregisterService := client_services.NewServicesMCUPreregister(appStore) + mcuPreregisterHandler := client_handlers.NewMCUPreregisterHandler(mcuPreregisterService) + public.GET("/mcu/preregister", mcuPreregisterHandler.ShowMCUPreregister) + + //Transaksi Sample Station + txSampleStationService := client_services.NewServicesTransaksiSampleStation(appStore) + txSampleStationHandler := client_handlers.NewTransaksiSampleStationHandler(txSampleStationService) + public.GET("/transaksi/samplestation", txSampleStationHandler.ShowTransaksiSampleStation) } diff --git a/services/client/mcupreregister.services.go b/services/client/mcupreregister.services.go new file mode 100644 index 0000000..ccfb6ae --- /dev/null +++ b/services/client/mcupreregister.services.go @@ -0,0 +1,15 @@ +package client_services + +import "cpone/db" + +type ServicesMCUPreregister struct { + MCUPreregisterStore db.AppStore +} + +func NewServicesMCUPreregister(uStore db.AppStore) *ServicesMCUPreregister { + + return &ServicesMCUPreregister{ + + MCUPreregisterStore: uStore, + } +} diff --git a/services/client/mcusetup.services.go b/services/client/mcusetup.services.go new file mode 100644 index 0000000..61aba72 --- /dev/null +++ b/services/client/mcusetup.services.go @@ -0,0 +1,15 @@ +package client_services + +import "cpone/db" + +type ServicesMCUSetup struct { + MCUSetupStore db.AppStore +} + +func NewServicesMCUSetup(uStore db.AppStore) *ServicesMCUSetup { + + return &ServicesMCUSetup{ + + MCUSetupStore: uStore, + } +} diff --git a/services/client/mdprofile.services.go b/services/client/mdprofile.services.go new file mode 100644 index 0000000..a8d0a88 --- /dev/null +++ b/services/client/mdprofile.services.go @@ -0,0 +1,15 @@ +package client_services + +import "cpone/db" + +type ServicesMdProfile struct { + MdProfileStore db.AppStore +} + +func NewServicesMdProfile(uStore db.AppStore) *ServicesMdProfile { + + return &ServicesMdProfile{ + + MdProfileStore: uStore, + } +} diff --git a/services/client/transaksisamplestation.services.go b/services/client/transaksisamplestation.services.go new file mode 100644 index 0000000..9f144b0 --- /dev/null +++ b/services/client/transaksisamplestation.services.go @@ -0,0 +1,15 @@ +package client_services + +import "cpone/db" + +type ServicesTransaksiSampleStation struct { + TransaksiSampleStationStore db.AppStore +} + +func NewServicesTransaksiSampleStation(uStore db.AppStore) *ServicesTransaksiSampleStation { + + return &ServicesTransaksiSampleStation{ + + TransaksiSampleStationStore: uStore, + } +} diff --git a/views/client/mcupreregister/mcupreregister.templ b/views/client/mcupreregister/mcupreregister.templ new file mode 100644 index 0000000..6e70bbd --- /dev/null +++ b/views/client/mcupreregister/mcupreregister.templ @@ -0,0 +1,40 @@ +package client_mcupreregister + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +templ Content() { +
+ @under_development.UnderDevelopment() +
+} + +templ Css() { + +} + +templ Js() { +} + +templ Show() { + @layout.PlaygroundLayout("Client MCU Preregister", Css(), Js()) { + @Content() + } +} diff --git a/views/client/mcupreregister/mcupreregister_templ.go b/views/client/mcupreregister/mcupreregister_templ.go new file mode 100644 index 0000000..62eb234 --- /dev/null +++ b/views/client/mcupreregister/mcupreregister_templ.go @@ -0,0 +1,131 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package client_mcupreregister + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +func Content() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = under_development.UnderDevelopment().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Css() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Js() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Show() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = Content().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = layout.PlaygroundLayout("Client MCU Preregister", Css(), Js()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} diff --git a/views/client/mcusetup/mcusetup.templ b/views/client/mcusetup/mcusetup.templ new file mode 100644 index 0000000..77e3c0e --- /dev/null +++ b/views/client/mcusetup/mcusetup.templ @@ -0,0 +1,40 @@ +package client_mcusetup + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +templ Content() { +
+ @under_development.UnderDevelopment() +
+} + +templ Css() { + +} + +templ Js() { +} + +templ Show() { + @layout.PlaygroundLayout("Client MCU Setup", Css(), Js()) { + @Content() + } +} diff --git a/views/client/mcusetup/mcusetup_templ.go b/views/client/mcusetup/mcusetup_templ.go new file mode 100644 index 0000000..b8616f9 --- /dev/null +++ b/views/client/mcusetup/mcusetup_templ.go @@ -0,0 +1,131 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package client_mcusetup + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +func Content() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = under_development.UnderDevelopment().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Css() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Js() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Show() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = Content().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = layout.PlaygroundLayout("Client MCU Setup", Css(), Js()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} diff --git a/views/client/mdprofile/mdprofile.templ b/views/client/mdprofile/mdprofile.templ new file mode 100644 index 0000000..01c19ee --- /dev/null +++ b/views/client/mdprofile/mdprofile.templ @@ -0,0 +1,40 @@ +package client_mdprofile + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +templ Content() { +
+ @under_development.UnderDevelopment() +
+} + +templ Css() { + +} + +templ Js() { +} + +templ Show() { + @layout.PlaygroundLayout("Client Md Profile", Css(), Js()) { + @Content() + } +} diff --git a/views/client/mdprofile/mdprofile_templ.go b/views/client/mdprofile/mdprofile_templ.go new file mode 100644 index 0000000..f4f54c2 --- /dev/null +++ b/views/client/mdprofile/mdprofile_templ.go @@ -0,0 +1,131 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package client_mdprofile + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +func Content() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = under_development.UnderDevelopment().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Css() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Js() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Show() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = Content().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = layout.PlaygroundLayout("Client Md Profile", Css(), Js()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} diff --git a/views/client/transaksisamplestation/transaksisamplestation.templ b/views/client/transaksisamplestation/transaksisamplestation.templ new file mode 100644 index 0000000..af8a33a --- /dev/null +++ b/views/client/transaksisamplestation/transaksisamplestation.templ @@ -0,0 +1,40 @@ +package client_transaksisamplestation + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +templ Content() { +
+ @under_development.UnderDevelopment() +
+} + +templ Css() { + +} + +templ Js() { +} + +templ Show() { + @layout.PlaygroundLayout("Client Transaksi Sample Station", Css(), Js()) { + @Content() + } +} diff --git a/views/client/transaksisamplestation/transaksisamplestation_templ.go b/views/client/transaksisamplestation/transaksisamplestation_templ.go new file mode 100644 index 0000000..18d2524 --- /dev/null +++ b/views/client/transaksisamplestation/transaksisamplestation_templ.go @@ -0,0 +1,131 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package client_transaksisamplestation + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/component/under_development" + "cpone/layout" +) + +func Content() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = under_development.UnderDevelopment().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Css() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Js() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func Show() templ.Component { + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + templ_7745c5c3_Err = Content().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } + return templ_7745c5c3_Err + }) + templ_7745c5c3_Err = layout.PlaygroundLayout("Client Transaksi Sample Station", Css(), Js()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +}