From 6deadec9a365d438ea0bcbb42ff3f777a05a2e0b Mon Sep 17 00:00:00 2001 From: adibwp Date: Thu, 13 Jun 2024 14:55:04 +0700 Subject: [PATCH] add redirect ke detail mcu --- handlers/corporate/dashboardpic.handlers.go | 13 ++ handlers/corporate/mcudetail.handlers.go | 69 +++++++++ handlers/routes.go | 18 ++- services/corporate/mcudetail.services.go | 37 +++++ .../dashboardpic/listingdashboardpic.templ | 4 +- .../dashboardpic/listingdashboardpic_templ.go | 66 +++++--- views/corporate/mcu/mcudetail.templ | 71 +++++++++ views/corporate/mcu/mcudetail_templ.go | 146 ++++++++++++++++++ views/corporate/mcu/mcutabview.templ | 52 +++++++ views/corporate/mcu/mcutabview_templ.go | 35 +++++ .../listingemployeeanalytic.templ | 4 +- .../listingemployeeanalytic_templ.go | 8 +- 12 files changed, 489 insertions(+), 34 deletions(-) create mode 100644 handlers/corporate/mcudetail.handlers.go create mode 100644 services/corporate/mcudetail.services.go create mode 100644 views/corporate/mcu/mcudetail.templ create mode 100644 views/corporate/mcu/mcudetail_templ.go create mode 100644 views/corporate/mcu/mcutabview.templ create mode 100644 views/corporate/mcu/mcutabview_templ.go diff --git a/handlers/corporate/dashboardpic.handlers.go b/handlers/corporate/dashboardpic.handlers.go index 4676d70..5333418 100644 --- a/handlers/corporate/dashboardpic.handlers.go +++ b/handlers/corporate/dashboardpic.handlers.go @@ -9,6 +9,7 @@ import ( "cpone/services" "cpone/utils" corporate_dashboardpic "cpone/views/corporate/dashboardpic" + "net/http" "strconv" "github.com/a-h/templ" @@ -178,3 +179,15 @@ func (ea *DashboardPicHandler) HandleFilter(c echo.Context) error { retval = append(retval, paginationcomponent) return utils.ViewMulti(c, retval) } + +func (ea *DashboardPicHandler) HandleToDetail(c echo.Context) error { + logger, _ := zap.NewProduction() + id := c.Param("id") + + logger.Info("params", zap.Any("id", id)) + + url := "/dev/detail/" + id + c.Response().Header().Set("HX-Redirect", url) + + return c.String(http.StatusOK, url) +} diff --git a/handlers/corporate/mcudetail.handlers.go b/handlers/corporate/mcudetail.handlers.go new file mode 100644 index 0000000..7783c8f --- /dev/null +++ b/handlers/corporate/mcudetail.handlers.go @@ -0,0 +1,69 @@ +package corporate_handlers + +import ( + breadcrumadmin "cpone/component/breadcrumbadmin" + navbarmenu "cpone/component/navbar" + sidebaruserprofile "cpone/component/sidebar_user_profile" + "cpone/models" + "cpone/services" + "cpone/utils" + corporate_mcudetail "cpone/views/corporate/mcu" + + "github.com/labstack/echo/v4" + "go.uber.org/zap" +) + +type McuDetailServices interface { + GetBreadcrumb(title string) (models.BreadCrumbV1, error) +} + +type McuDetailHandler struct { + McuDetailServices McuDetailServices +} + +func NewMcuDetailHandler(mcud McuDetailServices) *McuDetailHandler { + return &McuDetailHandler{ + McuDetailServices: mcud, + } +} + +func (mcud *McuDetailHandler) HandlerShowMcuDetailScreen(c echo.Context) error { + logger, _ := zap.NewProduction() + title := "PT. Sadhana Abiyasa Sampoerna" + + user, err := services.GetUserLogin() + if err != nil { + defer logger.Sync() + logger.Info("Error get user corp", zap.Any("error", err)) + return err + } + + dataBreadcrumb, err := mcud.McuDetailServices.GetBreadcrumb(title) + if err != nil { + defer logger.Sync() + logger.Info("Error breadcrumb corp", zap.Any("error", err)) + return err + } + + breadcrumb := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadcrumb) + navbaruser := navbarmenu.NavbarWithLogo(user) + sidbaruser := sidebaruserprofile.Navbaruserprofile(user) + + content := corporate_mcudetail.McuDetailScreen( + breadcrumb, + corporate_mcudetail.TabViewMcuDetail(), + ) + css := corporate_mcudetail.CSSMcuDetail() + js := corporate_mcudetail.JSMcuDetail() + + view := corporate_mcudetail.ShowMcuDetail( + title, + content, + css, + js, + navbaruser, + sidbaruser, + ) + + return utils.View(c, view) +} diff --git a/handlers/routes.go b/handlers/routes.go index e7f14a2..c5bb868 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -97,20 +97,26 @@ func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) { public.GET("redirectsurveymcu", publicKartuKontrolhandlers.HandlerRedirectToSurveyMcu) } func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) { - public := app.Group("/corp") + corp := app.Group("/corp") l := corporate_services.NewServicesCompany(appStore) lh := corporate_handlers.NewCompanyHandler(l) - public.GET("/company", lh.ShowCompany) + corp.GET("/company", lh.ShowCompany) // dashboard_pic dashbrdPicServ := corporate_services.NewDashboardPicServices(appStore) dashbrdPicHandl := corporate_handlers.NewDashboardPicHandler(dashbrdPicServ) - public.GET("/dashboard_pic", dashbrdPicHandl.HandleShowEmployeeAnalyticScreen) - public.GET("/dashboard_pic/changepage", dashbrdPicHandl.HandlePagination) - public.GET("/dashboard_pic/filter", dashbrdPicHandl.HandleFilter) + corp.GET("/dashboard_pic", dashbrdPicHandl.HandleShowEmployeeAnalyticScreen) + corp.GET("/dashboard_pic/changepage", dashbrdPicHandl.HandlePagination) + corp.GET("/dashboard_pic/filter", dashbrdPicHandl.HandleFilter) + corp.GET("/dashboard_pic/click/:id", dashbrdPicHandl.HandleToDetail) + + // mcu detail + mcudServ := corporate_services.NewMcuDetailServices(appStore) + mcudHandr := corporate_handlers.NewMcuDetailHandler(mcudServ) + corp.GET("/detail/:id", mcudHandr.HandlerShowMcuDetailScreen) patientHandler := corporate_handlers.NewPatientHandler(l) - public.GET("/patient", patientHandler.ShowPatient) + corp.GET("/patient", patientHandler.ShowPatient) } func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) { diff --git a/services/corporate/mcudetail.services.go b/services/corporate/mcudetail.services.go new file mode 100644 index 0000000..4986515 --- /dev/null +++ b/services/corporate/mcudetail.services.go @@ -0,0 +1,37 @@ +package corporate_services + +import ( + "cpone/db" + "cpone/models" +) + +type McuDetailServices struct { + McuDetailStore db.AppStore +} + +func NewMcuDetailServices(uStore db.AppStore) *McuDetailServices { + return &McuDetailServices{ + McuDetailStore: uStore, + } +} + +func (mcud *McuDetailServices) GetBreadcrumb(title string) (models.BreadCrumbV1, error) { + breadcrumb := models.BreadCrumbV1{ + Title: title, + Item: []models.ItemBreadCrumbV1{ + { + Item: "Dashboard", + Url: "/dev/dashboard", + }, + { + Item: "Employee Health Medical Analytic", + Url: "/dev/employeeanalytic/", + }, + { + Item: title, + Url: "", + }, + }, + } + return breadcrumb, nil +} diff --git a/views/corporate/dashboardpic/listingdashboardpic.templ b/views/corporate/dashboardpic/listingdashboardpic.templ index b12bcd2..4ef975e 100644 --- a/views/corporate/dashboardpic/listingdashboardpic.templ +++ b/views/corporate/dashboardpic/listingdashboardpic.templ @@ -12,11 +12,11 @@ templ ListingData(
for i, d := range data { if i == (len(data) - 1) { -
+
@ItemCard(d)
} else { -
+
@ItemCard(d)
} diff --git a/views/corporate/dashboardpic/listingdashboardpic_templ.go b/views/corporate/dashboardpic/listingdashboardpic_templ.go index 9ac8f8c..bd87717 100644 --- a/views/corporate/dashboardpic/listingdashboardpic_templ.go +++ b/views/corporate/dashboardpic/listingdashboardpic_templ.go @@ -61,7 +61,20 @@ func ListingData( if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"card shadow p-8\">") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"card shadow p-8\" hx-get=\"") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs("/dev/employeeanalytic/click/" + strconv.Itoa(d.Mgm_McuID)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 15, Col: 157} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + 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 } @@ -78,16 +91,29 @@ func ListingData( if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(int(d.Mgm_McuID))) + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(int(d.Mgm_McuID))) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 19, Col: 64} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"card shadow p-8 mb-8\">") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"card shadow p-8 mb-8\" hx-get=\"") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("/dev/employeeanalytic/click/" + strconv.Itoa(d.Mgm_McuID)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 19, Col: 162} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) + 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 } @@ -120,21 +146,21 @@ func ItemCard(data models.DashboardPic) templ.Component { defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent } ctx = templ.ClearChildren(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuLabel) + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuLabel) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 32, Col: 54} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -142,12 +168,12 @@ func ItemCard(data models.DashboardPic) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuNote) + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuNote) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 35, Col: 74} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -155,12 +181,12 @@ func ItemCard(data models.DashboardPic) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var8 string - templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuStartDate) + var templ_7745c5c3_Var10 string + templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuStartDate) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 38, Col: 79} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -168,12 +194,12 @@ func ItemCard(data models.DashboardPic) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var9 string - templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuEndDate) + var templ_7745c5c3_Var11 string + templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuEndDate) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 38, Col: 105} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/views/corporate/mcu/mcudetail.templ b/views/corporate/mcu/mcudetail.templ new file mode 100644 index 0000000..a4a7155 --- /dev/null +++ b/views/corporate/mcu/mcudetail.templ @@ -0,0 +1,71 @@ +package corporate_mcudetail + +import "cpone/layout" + +templ McuDetailScreen( + breadcrumb templ.Component, + content templ.Component, +) { +
+
+
+ @breadcrumb +
+
+
+ @content +
+
+ Loading.... +
+
+
+
+
+} + +templ CSSMcuDetail() { + + + + +} + +templ JSMcuDetail() { +} + +templ ShowMcuDetail( + title string, + cmp templ.Component, + css templ.Component, + js templ.Component, + navbaruser templ.Component, + userprofile templ.Component, +) { + @layout.EmployeeAnalyticLayout(title, css, js, navbaruser, userprofile) { + @cmp + } +} \ No newline at end of file diff --git a/views/corporate/mcu/mcudetail_templ.go b/views/corporate/mcu/mcudetail_templ.go new file mode 100644 index 0000000..1e32e4d --- /dev/null +++ b/views/corporate/mcu/mcudetail_templ.go @@ -0,0 +1,146 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package corporate_mcudetail + +//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 McuDetailScreen( + breadcrumb templ.Component, + content 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_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 = breadcrumb.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 = content.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Loading....
") + 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 CSSMcuDetail() 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 JSMcuDetail() 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 ShowMcuDetail( + title string, + cmp templ.Component, + css templ.Component, + js templ.Component, + navbaruser templ.Component, + userprofile 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.EmployeeAnalyticLayout(title, css, js, navbaruser, userprofile).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/corporate/mcu/mcutabview.templ b/views/corporate/mcu/mcutabview.templ new file mode 100644 index 0000000..6de40a1 --- /dev/null +++ b/views/corporate/mcu/mcutabview.templ @@ -0,0 +1,52 @@ +package corporate_mcudetail + +templ TabViewMcuDetail() { + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ tab 6 +
+
+ tab 7 +
+
+} \ No newline at end of file diff --git a/views/corporate/mcu/mcutabview_templ.go b/views/corporate/mcu/mcutabview_templ.go new file mode 100644 index 0000000..c3e1f1b --- /dev/null +++ b/views/corporate/mcu/mcutabview_templ.go @@ -0,0 +1,35 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package corporate_mcudetail + +//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 TabViewMcuDetail() 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("
tab 6\r
tab 7\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 + }) +} diff --git a/views/dev/employeeanalytic/listingemployeeanalytic.templ b/views/dev/employeeanalytic/listingemployeeanalytic.templ index 9579beb..1382be3 100644 --- a/views/dev/employeeanalytic/listingemployeeanalytic.templ +++ b/views/dev/employeeanalytic/listingemployeeanalytic.templ @@ -12,11 +12,11 @@ templ ListingData(
for i, d := range data { if i == (len(data) - 1) { -
+
@ItemCard(d)
} else { -
+
@ItemCard(d)
} diff --git a/views/dev/employeeanalytic/listingemployeeanalytic_templ.go b/views/dev/employeeanalytic/listingemployeeanalytic_templ.go index 19ed2f8..9401cbb 100644 --- a/views/dev/employeeanalytic/listingemployeeanalytic_templ.go +++ b/views/dev/employeeanalytic/listingemployeeanalytic_templ.go @@ -66,9 +66,9 @@ func ListingData( return templ_7745c5c3_Err } var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs("/dev/employeeanalytic/click/" + strconv.Itoa(i)) + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs("/corp/dashboard_pic/click/" + strconv.Itoa(d.Mgm_McuID)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 15, Col: 147} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 15, Col: 155} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -105,9 +105,9 @@ func ListingData( return templ_7745c5c3_Err } var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("/dev/employeeanalytic/click/" + strconv.Itoa(i)) + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("/corp/dashboard_pic/click/" + strconv.Itoa(d.Mgm_McuID)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 19, Col: 152} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 19, Col: 160} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil {