From 98f698821ca505d7fbeaa9b1c99a658cb48c34f5 Mon Sep 17 00:00:00 2001 From: sindhu Date: Mon, 27 May 2024 12:14:07 +0700 Subject: [PATCH] step 1 : initial, loading search and pagination --- .../customcheckbox/customcheckboxv1.templ | 25 + .../customcheckbox/customcheckboxv1_templ.go | 143 +++ component/customdropdown/customdropdown.templ | 61 ++ .../customdropdown/customdropdown_templ.go | 343 +++++++ handlers/dev/md.groupresult.handlers.go | 479 ++++++++++ handlers/routes.go | 22 + .../breadcrumbadmin/breadcrumbadmin.templ | 23 + .../breadcrumbadmin/breadcrumbadmin_templ.go | 35 + .../breadcrumbadmin/breadcrumbadminv1.templ | 26 + .../breadcrumbadminv1_templ.go | 102 ++ models/component/chart/chart.templ | 30 + models/component/chart/chart_templ.go | 82 ++ .../customcheckbox/customcheckboxv1.templ | 25 + .../customcheckbox/customcheckboxv1_templ.go | 143 +++ .../customdropdown/customdropdown.templ | 61 ++ .../customdropdown/customdropdown_templ.go | 343 +++++++ .../customtextfield/customtextfield.templ | 17 + .../customtextfield/customtextfield_templ.go | 103 ++ .../customtextfield/customtextfieldv2.templ | 31 + .../customtextfieldv2_templ.go | 158 ++++ .../customtextfieldautocomplete.templ | 126 +++ .../customtextfieldautocomplete_templ.go | 268 ++++++ .../customtextfieldsearch.templ | 85 ++ .../customtextfieldsearch_templ.go | 488 ++++++++++ models/component/modal/modal.templ | 30 + .../component/modal/modal_confirmation.templ | 52 ++ .../modal/modal_confirmation_templ.go | 143 +++ models/component/modal/modal_templ.go | 85 ++ models/component/navbar/navbar.templ | 74 ++ models/component/navbar/navbar_templ.go | 112 +++ models/component/pagination/pagination.templ | 59 ++ .../component/pagination/pagination_templ.go | 216 +++++ .../component/pagination/paginationv1.templ | 55 ++ .../pagination/paginationv1_templ.go | 154 +++ .../component/pagination/paginationv2.templ | 52 ++ .../pagination/paginationv2_templ.go | 258 +++++ .../sidebar_user_profile.templ | 82 ++ .../sidebar_user_profile_templ.go | 127 +++ .../sidebarmaster/sidebarmaster.templ | 102 ++ .../sidebarmaster/sidebarmaster_templ.go | 167 ++++ models/component/table/table.templ | 25 + models/component/table/table_templ.go | 94 ++ models/component/table/tablev1.templ | 25 + models/component/table/tablev1_templ.go | 107 +++ models/component/table/tablev2.templ | 31 + models/component/table/tablev2_templ.go | 135 +++ models/component/table/tablev3.templ | 27 + models/component/table/tablev3_templ.go | 118 +++ .../toastbootstrap/customtoastv1.templ | 15 + .../toastbootstrap/customtoastv1_templ.go | 48 + .../toastbootstrap/customtoastv2.templ | 86 ++ .../toastbootstrap/customtoastv2_templ.go | 175 ++++ .../under_development/under_development.templ | 17 + .../under_development_templ.go | 35 + models/customcheckbox.models.go | 18 + models/customdropdown.models.go | 18 + models/groupresult.models.go | 38 + services/dev/md.groupresult.services.go | 878 ++++++++++++++++++ views/dev/mdgroupresult/mdgroupresult.templ | 237 +++++ .../dev/mdgroupresult/mdgroupresult_templ.go | 433 +++++++++ .../mdgroupresultformmodal.templ | 203 ++++ .../mdgroupresultformmodal_templ.go | 665 +++++++++++++ .../mdgroupresult/mdgroupresulttable.templ | 131 +++ .../mdgroupresult/mdgroupresulttable_templ.go | 464 +++++++++ 64 files changed, 9010 insertions(+) create mode 100644 component/customcheckbox/customcheckboxv1.templ create mode 100644 component/customcheckbox/customcheckboxv1_templ.go create mode 100644 component/customdropdown/customdropdown.templ create mode 100644 component/customdropdown/customdropdown_templ.go create mode 100644 handlers/dev/md.groupresult.handlers.go create mode 100644 models/component/breadcrumbadmin/breadcrumbadmin.templ create mode 100644 models/component/breadcrumbadmin/breadcrumbadmin_templ.go create mode 100644 models/component/breadcrumbadmin/breadcrumbadminv1.templ create mode 100644 models/component/breadcrumbadmin/breadcrumbadminv1_templ.go create mode 100644 models/component/chart/chart.templ create mode 100644 models/component/chart/chart_templ.go create mode 100644 models/component/customcheckbox/customcheckboxv1.templ create mode 100644 models/component/customcheckbox/customcheckboxv1_templ.go create mode 100644 models/component/customdropdown/customdropdown.templ create mode 100644 models/component/customdropdown/customdropdown_templ.go create mode 100644 models/component/customtextfield/customtextfield.templ create mode 100644 models/component/customtextfield/customtextfield_templ.go create mode 100644 models/component/customtextfield/customtextfieldv2.templ create mode 100644 models/component/customtextfield/customtextfieldv2_templ.go create mode 100644 models/component/customtextfieldautocomplete/customtextfieldautocomplete.templ create mode 100644 models/component/customtextfieldautocomplete/customtextfieldautocomplete_templ.go create mode 100644 models/component/customtextfieldsearch/customtextfieldsearch.templ create mode 100644 models/component/customtextfieldsearch/customtextfieldsearch_templ.go create mode 100644 models/component/modal/modal.templ create mode 100644 models/component/modal/modal_confirmation.templ create mode 100644 models/component/modal/modal_confirmation_templ.go create mode 100644 models/component/modal/modal_templ.go create mode 100644 models/component/navbar/navbar.templ create mode 100644 models/component/navbar/navbar_templ.go create mode 100644 models/component/pagination/pagination.templ create mode 100644 models/component/pagination/pagination_templ.go create mode 100644 models/component/pagination/paginationv1.templ create mode 100644 models/component/pagination/paginationv1_templ.go create mode 100644 models/component/pagination/paginationv2.templ create mode 100644 models/component/pagination/paginationv2_templ.go create mode 100644 models/component/sidebar_user_profile/sidebar_user_profile.templ create mode 100644 models/component/sidebar_user_profile/sidebar_user_profile_templ.go create mode 100644 models/component/sidebarmaster/sidebarmaster.templ create mode 100644 models/component/sidebarmaster/sidebarmaster_templ.go create mode 100644 models/component/table/table.templ create mode 100644 models/component/table/table_templ.go create mode 100644 models/component/table/tablev1.templ create mode 100644 models/component/table/tablev1_templ.go create mode 100644 models/component/table/tablev2.templ create mode 100644 models/component/table/tablev2_templ.go create mode 100644 models/component/table/tablev3.templ create mode 100644 models/component/table/tablev3_templ.go create mode 100644 models/component/toastbootstrap/customtoastv1.templ create mode 100644 models/component/toastbootstrap/customtoastv1_templ.go create mode 100644 models/component/toastbootstrap/customtoastv2.templ create mode 100644 models/component/toastbootstrap/customtoastv2_templ.go create mode 100644 models/component/under_development/under_development.templ create mode 100644 models/component/under_development/under_development_templ.go create mode 100644 models/customcheckbox.models.go create mode 100644 models/customdropdown.models.go create mode 100644 models/groupresult.models.go create mode 100644 services/dev/md.groupresult.services.go create mode 100644 views/dev/mdgroupresult/mdgroupresult.templ create mode 100644 views/dev/mdgroupresult/mdgroupresult_templ.go create mode 100644 views/dev/mdgroupresult/mdgroupresultformmodal.templ create mode 100644 views/dev/mdgroupresult/mdgroupresultformmodal_templ.go create mode 100644 views/dev/mdgroupresult/mdgroupresulttable.templ create mode 100644 views/dev/mdgroupresult/mdgroupresulttable_templ.go diff --git a/component/customcheckbox/customcheckboxv1.templ b/component/customcheckbox/customcheckboxv1.templ new file mode 100644 index 0000000..cac9ce4 --- /dev/null +++ b/component/customcheckbox/customcheckboxv1.templ @@ -0,0 +1,25 @@ +package customcheckbox + +import "cpone/models" + +templ MainCustomCheckboxInput(inp models.CustomCheckboxv1Prm) { +
+
+ +
+ +
+
+
+ { inp.ErrorMsg } +
+
+} diff --git a/component/customcheckbox/customcheckboxv1_templ.go b/component/customcheckbox/customcheckboxv1_templ.go new file mode 100644 index 0000000..7c154a4 --- /dev/null +++ b/component/customcheckbox/customcheckboxv1_templ.go @@ -0,0 +1,143 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package customcheckbox + +//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/models" + +func MainCustomCheckboxInput(inp models.CustomCheckboxv1Prm) 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 + } + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 22, Col: 17} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + 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 + }) +} diff --git a/component/customdropdown/customdropdown.templ b/component/customdropdown/customdropdown.templ new file mode 100644 index 0000000..49b3b31 --- /dev/null +++ b/component/customdropdown/customdropdown.templ @@ -0,0 +1,61 @@ +package customdropdown; + +import "cpone/models" + +templ MainCustomDropdown(inp models.CustomDropdownv1Prm, listItem templ.Component) { +
+ +
+ { inp.ErrorMsg } +
+
+} + +templ MainCustomDropdownInput(inp models.CustomDropdownv1Prm, listItem templ.Component) { +
+ +
+ { inp.ErrorMsg } +
+
+} + +templ MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string, listItem templ.Component) { +
+ +
+} diff --git a/component/customdropdown/customdropdown_templ.go b/component/customdropdown/customdropdown_templ.go new file mode 100644 index 0000000..3430837 --- /dev/null +++ b/component/customdropdown/customdropdown_templ.go @@ -0,0 +1,343 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package customdropdown + +//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/models" + +func MainCustomDropdown(inp models.CustomDropdownv1Prm, listItem 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 + } + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 22, Col: 17} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + 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 MainCustomDropdownInput(inp models.CustomDropdownv1Prm, listItem 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_Var10 := templ.GetChildren(ctx) + if templ_7745c5c3_Var10 == nil { + templ_7745c5c3_Var10 = 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_Var13 string + templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 39, Col: 17} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) + 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 MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string, listItem 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_Var14 := templ.GetChildren(ctx) + if templ_7745c5c3_Var14 == nil { + templ_7745c5c3_Var14 = 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 + }) +} diff --git a/handlers/dev/md.groupresult.handlers.go b/handlers/dev/md.groupresult.handlers.go new file mode 100644 index 0000000..009c814 --- /dev/null +++ b/handlers/dev/md.groupresult.handlers.go @@ -0,0 +1,479 @@ +package dev_handlers + +import ( + breadcrumadmin "cpone/component/breadcrumbadmin" + customtextfieldsearch "cpone/component/customtextfieldsearch" + navbarmenu "cpone/component/navbar" + "cpone/component/pagination" + sidebaruserprofile "cpone/component/sidebar_user_profile" + "cpone/models" + "cpone/services" + "cpone/utils" + dev_mdgroupresultview "cpone/views/dev/mdgroupresult" + "fmt" + "strconv" + + "github.com/a-h/templ" + "github.com/labstack/echo/v4" + "go.uber.org/zap" +) + +type MdGroupResultServices interface { + GetListMdGroupResult(search string, currentPage int, rowPerPage int) ([]models.GroupResult, int, error) + GetMdGroupResultByID(id string) (models.GroupResult, error) + AddMdGroupResult(groupresultname string, groupresultflagpertest string, groupresultflagnonlab string, groupresultresumemcu string) (models.GroupResult, error) + EditMdGroupResult(id string, groupresultname string, groupresultflagpertest string, groupresultflagnonlab string, groupresultresumemcu string) (models.GroupResult, error) + DeleteMdGroupResult(id string) (models.GroupResult, error) + GetMdGroupResultBreadcrumb(title string) (models.BreadCrumbV1, error) + GetMdGroupResultResumeMcu() ([]models.GroupResultResumeMcu, error) +} + +func NewMdGroupResultHandler(us MdGroupResultServices) *MdGroupResultHandler { + return &MdGroupResultHandler{ + MdGroupResultServices: us, + } +} + +type MdGroupResultHandler struct { + MdGroupResultServices MdGroupResultServices +} + +// INITIAL +func (lh *MdGroupResultHandler) HandleShowMdGroupResultScreen(c echo.Context) error { + logger, _ := zap.NewProduction() + //get sidebarmenu + tableID := utils.GenerateRandomID("tablebody") + paginationID := utils.GenerateRandomID("paginationid") + searchID := utils.GenerateRandomID("searchid") + dialogAddID := utils.GenerateRandomID("dialogaddID") + dialogAddBodyID := utils.GenerateRandomID("dialogaddbodyID") + dialogEditID := utils.GenerateRandomID("dialogEditID") + dialogEditBodyID := utils.GenerateRandomID("dialogEditbodyID") + dialogDeleteID := utils.GenerateRandomID("dialogDeleteID") + dialogDeleteBodyID := utils.GenerateRandomID("dialogDeletebodyID") + dataMenu, err := services.GetMenu() + fmt.Println(dataMenu) + fmt.Println(err) + if err != nil { + fmt.Println(dataMenu) + return err + } + + //get user login + dataUser, err := services.GetUserLogin() + fmt.Println(dataUser) + fmt.Println(err) + if err != nil { + fmt.Println(dataUser) + return err + } + defer logger.Sync() + logger.Info("LOAD USER DEV", + zap.Any("data", dataUser), + ) + + title := "Master Group Result" + + dataBreadCrumb, err := lh.MdGroupResultServices.GetMdGroupResultBreadcrumb(title) + fmt.Println(dataBreadCrumb) + fmt.Println(err) + if err != nil { + defer logger.Sync() + logger.Info("ERROR BREADCRUMB DEV", + zap.Any("error", err), + ) + fmt.Println(dataBreadCrumb) + return err + } + + defer logger.Sync() + logger.Info("LOAD BREADCRUMB DEV", + zap.Any("data", dataBreadCrumb), + ) + //Breadcrumb component + breadcrumbComponent := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadCrumb) + // navbar menu + navbarmenuComponent := navbarmenu.NavbarMenu(dataMenu) + + // navbar user + navbaruserComponent := navbarmenu.Navbar(dataUser) + + // sidebar + sidebaruserprofileComponent := sidebaruserprofile.Navbaruserprofile(dataUser) + + //Table component + dataGroupResult, totalPage, err := lh.MdGroupResultServices.GetListMdGroupResult("", 1, 5) + if err != nil { + defer logger.Sync() + logger.Info("ERROR GET GROUP RESULT", + zap.Any("error", err), + ) + fmt.Println(dataGroupResult) + return err + } + + tableComponent := dev_mdgroupresultview.TableGroupResult(dataGroupResult, + tableID, + "/dev/md/groupresultv2/openedit", + "#"+dialogEditBodyID, + "outerHTML", + "#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID", + "/dev/md/groupresultv2/opendelete", + "#"+dialogDeleteBodyID, + "outerHTML", + "#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID", + ) + + //filter user group component + usergroupFilterComponent := customtextfieldsearch.MainCustomTextFieldSearchV3(searchID, + "search", + "Cari Group Result Name / Result Resume MCU", + "text", + "/dev/md/groupresultv2/filter", + "input changed delay:500ms, search", + "#"+paginationID, "#loadingcontent", "", "outerHTML", "#tableID, #paginationID, #searchID,#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID", + dev_mdgroupresultview.BeforeRequestContentMdGroupResult(), + dev_mdgroupresultview.AfterRequestContentMdGroupResult()) + //Pagination + userGroupPaginationComponent := pagination.PaginationV3( + totalPage, + 1, + "/dev/md/groupresultv2/changepage", + paginationID, + "#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID", + "#"+paginationID, + "outerHTML", "", "", + dev_mdgroupresultview.BeforeRequestContentMdGroupResult(), + dev_mdgroupresultview.AfterRequestContentMdGroupResult(), + ) + + // listItem + dataResultMcu, err := lh.MdGroupResultServices.GetMdGroupResultResumeMcu() + fmt.Println(dataResultMcu) + fmt.Println(err) + if err != nil { + defer logger.Sync() + logger.Info("ERROR BREADCRUMB DEV", + zap.Any("error", err), + ) + fmt.Println(dataResultMcu) + return err + } + + defer logger.Sync() + logger.Info("LOAD BREADCRUMB DEV", + zap.Any("data", dataBreadCrumb), + ) + + // Component Dropdown MCU + listItemResultMcuComponent := dev_mdgroupresultview.ItemDropdown(dataResultMcu, 0) + + //modal add form + dialogAddBodyCmp := dev_mdgroupresultview.BodyFormGroupResult( + models.CustomTextFieldv2Prm{ + Label: "Group Result name", + Name: "groupresultid", + Placeholder: "Group Result name", + Type: "hidden", + ID: "groupresultid", + }, + models.CustomTextFieldv2Prm{ + Label: "Group Result Name", + Name: "groupresultname", + Placeholder: "Group Result Name", + Type: "text", ID: "groupresultname"}, + models.CustomCheckboxv1Prm{ + Label: "Group Result Flag Per Test (Dicentang Maka Ya)", + Name: "groupresultflagpertest", + ID: "groupresultflagpertest", + Value: "N", + }, + models.CustomCheckboxv1Prm{ + Label: "Group Result Flag Non Lab (Dicentang Maka Ya)", + Name: "groupresultflagnonlab", + ID: "groupresultflagnonlab", + Value: "N", + }, + models.CustomDropdownv1Prm{ + Label: "Group Result Resume MCU", + Name: "groupresultresumemcu", + ID: "groupresultresumemcu", + }, + listItemResultMcuComponent, + dialogAddBodyID, dev_mdgroupresultview.JsHideModalGroupResult("")) + + modalActioAddCmp := dev_mdgroupresultview.ActionFormGroupResult( + "/dev/md/groupresultv2/closeaddform", + "#"+dialogAddBodyID, + "outerHTML", + "#"+dialogAddID) + btnCloaseModalAdd := dev_mdgroupresultview.BtnCloseFormGroupResult( + "/dev/md/groupresultv2/closeaddform", + "#"+dialogAddBodyID, + "outerHTML", + "#"+dialogAddID) + + // add + modalAddFormComponent := dev_mdgroupresultview.GroupResultForm( + models.GroupResultFormComponent{ + IDComponent: "formgroupresult", + Link: "/dev/md/groupresultv2/add", + HxTarget: "#" + dialogAddBodyID, + HxSwap: "outerHTML", + HxInclude: "#tableID, #paginationID, #searchID, #dialogAddBodyID, #dialogAddID, #dialogDeleteBodyID, #dialogEditBodyID, #" + searchID + ", #currpage" + paginationID, + ModalID: dialogAddID, + ModalTitle: "New-Group Result", + DialogBody: dialogAddBodyCmp, + DialogAction: modalActioAddCmp, + ButtonCLose: btnCloaseModalAdd, + }, + ) + + //modal edit form + dialogEditBodyCmp := dev_mdgroupresultview.BodyFormGroupResult( + models.CustomTextFieldv2Prm{ + Label: "Group Result name", + Name: "groupresultid", + Placeholder: "Group Result name", + Type: "hidden", + ID: "groupresultid", + }, + models.CustomTextFieldv2Prm{ + Label: "Group Result Name", + Name: "groupresultname", + Placeholder: "Group Result Name", + Type: "text", ID: "groupresultname"}, + models.CustomCheckboxv1Prm{ + Label: "Group Result Flag Per Test (Dicentang Maka Ya)", + Name: "groupresultflagpertest", + ID: "groupresultflagpertest", + Value: "N", + }, + models.CustomCheckboxv1Prm{ + Label: "Group Result Flag Non Lab (Dicentang Maka Ya)", + Name: "groupresultflagnonlab", + ID: "groupresultflagnonlab", + Value: "N", + }, + models.CustomDropdownv1Prm{ + Label: "Group Result Resume MCU", + Name: "groupresultresumemcu", + ID: "groupresultresumemcu", + }, + listItemResultMcuComponent, + dialogEditBodyID, dev_mdgroupresultview.JsHideModalGroupResult("")) + modalActioEditCmp := dev_mdgroupresultview.ActionFormGroupResult( + "/dev/md/groupresultv2/closeeditform", + "#"+dialogEditBodyID, + "outerHTML", + "#"+dialogEditID) + btnCloaseModalEdit := dev_mdgroupresultview.BtnCloseFormGroupResult( + "/dev/md/groupresultv2/closeeditform", + "#"+dialogEditBodyID, + "outerHTML", + "#"+dialogEditID) + + modalEditFormComponent := dev_mdgroupresultview.GroupResultForm( + models.GroupResultFormComponent{ + IDComponent: "formgroupresult", + Link: "/dev/md/groupresultv2/edit", + HxTarget: "#" + dialogEditBodyID, + HxSwap: "outerHTML", + HxInclude: "#tableID, #paginationID, #searchID, #dialogDeleteBodyID, #dialogEditBodyID, #dialogEditID, #" + searchID + ", #currpage" + paginationID, + ModalID: dialogEditID, + ModalTitle: "New-Group Result", + DialogBody: dialogEditBodyCmp, + DialogAction: modalActioEditCmp, + ButtonCLose: btnCloaseModalEdit, + }, + ) + //modal delete form + dialogDeleteBodyCmp := dev_mdgroupresultview.BodyFormGroupResult( + models.CustomTextFieldv2Prm{ + Label: "Group Result name", + Name: "groupresultid", + Placeholder: "Group Result name", + Type: "hidden", + ID: "groupresultid", + }, + models.CustomTextFieldv2Prm{ + Label: "Group Result Name", + Name: "groupresultname", + Placeholder: "Group Result Name", + Type: "text", ID: "groupresultname"}, + models.CustomCheckboxv1Prm{ + Label: "Group Result Flag Per Test (Dicentang Maka Ya)", + Name: "groupresultflagpertest", + ID: "groupresultflagpertest", + Value: "N", + }, + models.CustomCheckboxv1Prm{ + Label: "Group Result Flag Non Lab (Dicentang Maka Ya)", + Name: "groupresultflagnonlab", + ID: "groupresultflagnonlab", + Value: "N", + }, + models.CustomDropdownv1Prm{ + Label: "Group Result Resume MCU", + Name: "groupresultresumemcu", + ID: "groupresultresumemcu", + }, + listItemResultMcuComponent, + dialogDeleteBodyID, dev_mdgroupresultview.JsHideModalGroupResult("")) + modalActioDeleteCmp := dev_mdgroupresultview.ActionFormGroupResultDelete( + "/dev/md/groupresultv2/closedeleteform", + "#"+dialogDeleteBodyID, + "outerHTML", + "#"+dialogDeleteID) + btnCloaseModalDelete := dev_mdgroupresultview.BtnCloseFormGroupResult( + "/dev/md/groupresultv2/closedeleteform", + "#"+dialogDeleteBodyID, + "outerHTML", + "#"+dialogDeleteID) + modalDeleteFormComponent := dev_mdgroupresultview.GroupResultForm( + models.GroupResultFormComponent{ + IDComponent: "formgroupresult", + Link: "/dev/md/groupresultv2/delete", + HxTarget: "#" + dialogDeleteBodyID, + HxSwap: "outerHTML", + HxInclude: "#tableID, #paginationID, #searchID, #dialogDeleteBodyID, #dialogDeleteID, #dialogEditBodyID, #" + searchID + ", #currpage" + paginationID, + ModalID: dialogDeleteID, + ModalTitle: "New-Group Result", + DialogBody: dialogDeleteBodyCmp, + DialogAction: modalActioDeleteCmp, + ButtonCLose: btnCloaseModalDelete, + }, + ) + + //content js & css + content := dev_mdgroupresultview.MdGroupResultScreen( + tableID, + paginationID, + searchID, + dialogAddID, + dialogAddBodyID, + dialogEditID, + dialogEditBodyID, + dialogDeleteID, + dialogDeleteBodyID, + breadcrumbComponent, + tableComponent, + usergroupFilterComponent, + userGroupPaginationComponent, + modalAddFormComponent, + modalEditFormComponent, + modalDeleteFormComponent) + css := dev_mdgroupresultview.CssMdGroupResult() + js := dev_mdgroupresultview.JsMdGroupResult() + + view := dev_mdgroupresultview.ShowMdGroupResultScreen(title, + content, + css, + js, + navbarmenuComponent, + navbaruserComponent, + sidebaruserprofileComponent) + return utils.View(c, view) +} + +// SEARCHING +func (lh *MdGroupResultHandler) HandleFilterMdGroupResult(c echo.Context) error { + search := c.QueryParam("search") + searchID := c.QueryParam("searchID") + tableID := c.QueryParam("tableID") + paginationID := c.QueryParam("paginationID") + dialogEditBodyID := c.QueryParam("dialogEditBodyID") + dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID") + var retval []templ.Component + logger, _ := zap.NewProduction() + + dataGroupResult, totalpage, err := lh.MdGroupResultServices.GetListMdGroupResult(search, 1, 5) + if err != nil { + defer logger.Sync() + logger.Info("ERROR GET GROUP RESULT", + zap.Any("error", err), + ) + fmt.Println(dataGroupResult) + return err + } + tableComponent := dev_mdgroupresultview.TableGroupResult(dataGroupResult, + tableID, + "/dev/md/groupresultv2/openedit", + "#"+dialogEditBodyID, + "outerHTML", + "#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID", + "/dev/md/groupresultv2/opendelete", + "#"+dialogDeleteBodyID, + "outerHTML", + "#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID") + userGroupPaginationComponent := pagination.PaginationV3( + totalpage, + 1, + "/dev/md/groupresultv2/changepage", + paginationID, + "#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID", + "#"+paginationID, + "outerHTML", "", "", + dev_mdgroupresultview.BeforeRequestContentMdGroupResult(), + dev_mdgroupresultview.AfterRequestContentMdGroupResult(), + ) + retval = append(retval, tableComponent) + retval = append(retval, userGroupPaginationComponent) + return utils.ViewMulti(c, retval) +} + +// PAGINATION +func (lh *MdGroupResultHandler) HandleChangePageMdGroupResult(c echo.Context) error { + search := c.QueryParam("search") + pageparam := c.QueryParam("page") + tableID := c.QueryParam("tableID") + searchID := c.QueryParam("searchID") + paginationID := c.QueryParam("paginationID") + dialogEditBodyID := c.QueryParam("dialogEditBodyID") + dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID") + var retval []templ.Component + logger, _ := zap.NewProduction() + page, err := strconv.Atoi(pageparam) + if err != nil { + defer logger.Sync() + logger.Info("ERROR CONVERT PAGE PARAM", + zap.Any("page", page), + zap.Any("error ", err), + ) + return err + } + dataGroupResult, totalpage, err := lh.MdGroupResultServices.GetListMdGroupResult(search, page, 5) + if err != nil { + defer logger.Sync() + logger.Info("ERROR GET USER GROUP", + zap.Any("error", err), + ) + fmt.Println(dataGroupResult) + return err + } + tableComponent := dev_mdgroupresultview.TableGroupResult(dataGroupResult, + tableID, + "/dev/md/groupresultv2/openedit", + "#"+dialogEditBodyID, + "outerHTML", + "#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID", + "/dev/md/groupresultv2/opendelete", + "#"+dialogDeleteBodyID, + "outerHTML", + "#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID", + ) + userGroupPaginationComponent := pagination.PaginationV3( + totalpage, + page, + "/dev/md/groupresultv2/changepage", + paginationID, + "#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID", + "#"+paginationID, + "outerHTML", "", "", + dev_mdgroupresultview.BeforeRequestContentMdGroupResult(), + dev_mdgroupresultview.AfterRequestContentMdGroupResult(), + ) + retval = append(retval, tableComponent) + retval = append(retval, userGroupPaginationComponent) + return utils.ViewMulti(c, retval) +} diff --git a/handlers/routes.go b/handlers/routes.go index 84520a4..305a866 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -247,4 +247,26 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) { dev.POST("/md/usergroupv2/closedeleteform", devMdUserGroupHandlers.HandleCloseFormDelete) dev.POST("/md/usergroupv2/delete", devMdUserGroupHandlers.HandleDeleteUserGroup) + // // group result + // devGRServices := dev_services.NewServicesGroupResult(appStore) + // devGRhandlers := dev_handlers.NewGroupResultHandler(devGRServices) + // dev.GET("/groupresult", devGRhandlers.HandlerShowGroupResultV1) + // dev.GET("/searchgroupresultv1", devGRhandlers.HandlerShowGroupResultSearchV1) + // dev.GET("/groupresultv1pagination", devGRhandlers.HandlerShowGroupResultPaginationV1) + // dev.POST("/groupresulthandlecloseform", devGRhandlers.HandleCloseForm) + // dev.POST("/groupresulthandlecloseformedit", devGRhandlers.HandleCloseFormEdit) + // dev.GET("/groupresultshoweditform", devGRhandlers.HandleEditForm) + // dev.GET("/groupresultshowdeleteform", devGRhandlers.HandleDeleteForm) + // // dev.GET("/groupresultshowdeleteform", devGRhandlers.HandleDeleteForm) + // // form add + // dev.POST("/groupresult/add", devGRhandlers.AddGroupResult) + // dev.POST("/groupresult/edit", devGRhandlers.EditGroupResult) + // dev.POST("/groupresult/delete", devGRhandlers.DeleteGroupResult) + + // group result v2 + devMdGRServices := dev_services.NewServicesMdGroupResult(appStore) + devMdGRhandlers := dev_handlers.NewMdGroupResultHandler(devMdGRServices) + dev.GET("/md/groupresultv2", devMdGRhandlers.HandleShowMdGroupResultScreen) + dev.GET("/md/groupresultv2/filter", devMdGRhandlers.HandleFilterMdGroupResult) + dev.GET("/md/groupresultv2/changepage", devMdGRhandlers.HandleChangePageMdGroupResult) } diff --git a/models/component/breadcrumbadmin/breadcrumbadmin.templ b/models/component/breadcrumbadmin/breadcrumbadmin.templ new file mode 100644 index 0000000..db99334 --- /dev/null +++ b/models/component/breadcrumbadmin/breadcrumbadmin.templ @@ -0,0 +1,23 @@ +package breadcrumadmin + +templ MainBreadcrumbAdmin() { +
+

+ PT. Sadhana Abiyasa Sampoerna +

+ +
+} diff --git a/models/component/breadcrumbadmin/breadcrumbadmin_templ.go b/models/component/breadcrumbadmin/breadcrumbadmin_templ.go new file mode 100644 index 0000000..7711057 --- /dev/null +++ b/models/component/breadcrumbadmin/breadcrumbadmin_templ.go @@ -0,0 +1,35 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package breadcrumadmin + +//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 MainBreadcrumbAdmin() 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("

PT. Sadhana Abiyasa Sampoerna\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/models/component/breadcrumbadmin/breadcrumbadminv1.templ b/models/component/breadcrumbadmin/breadcrumbadminv1.templ new file mode 100644 index 0000000..041e2e5 --- /dev/null +++ b/models/component/breadcrumbadmin/breadcrumbadminv1.templ @@ -0,0 +1,26 @@ +package breadcrumadmin + +import "cpone/models" + +templ MainBreadcrumbAdminV1(data models.BreadCrumbV1) { +
+

+ { data.Title } +

+ +
+} diff --git a/models/component/breadcrumbadmin/breadcrumbadminv1_templ.go b/models/component/breadcrumbadmin/breadcrumbadminv1_templ.go new file mode 100644 index 0000000..1272d28 --- /dev/null +++ b/models/component/breadcrumbadmin/breadcrumbadminv1_templ.go @@ -0,0 +1,102 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package breadcrumadmin + +//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/models" + +func MainBreadcrumbAdminV1(data models.BreadCrumbV1) 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 + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(data.Title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\breadcrumbadmin\breadcrumbadminv1.templ`, Line: 8, Col: 15} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + 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 + }) +} diff --git a/models/component/chart/chart.templ b/models/component/chart/chart.templ new file mode 100644 index 0000000..2776c4e --- /dev/null +++ b/models/component/chart/chart.templ @@ -0,0 +1,30 @@ +package chart + +templ ShowChart(idDiv string, udata string) { +
+ @GenerateChart(idDiv, udata) +} + +script GenerateChart(idDiv string, udata string) { + htmx.onLoad(function(elt) { + console.log("elt ",elt) + var element = document.getElementById(idDiv); + console.log("element ",element) + if (element) { + element.style.height = "400px"; + element.style.width = "100%"; + } + + var myChart = {}; + var option = {}; + + // var myChart_001 = echarts.init(document.getElementById(idDiv)); + myChart[idDiv] = echarts.init(element); + + // var option_001 = JSON.parse(udata); + option[idDiv] = JSON.parse(udata); + console.log("option ", option) + // myChart_001.setOption(option_001); + myChart[idDiv].setOption(option[idDiv]); + }); +} \ No newline at end of file diff --git a/models/component/chart/chart_templ.go b/models/component/chart/chart_templ.go new file mode 100644 index 0000000..ee2a9f6 --- /dev/null +++ b/models/component/chart/chart_templ.go @@ -0,0 +1,82 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package chart + +//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 ShowChart(idDiv string, udata string) 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 = GenerateChart(idDiv, udata).Render(ctx, 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 + }) +} + +func GenerateChart(idDiv string, udata string) templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_GenerateChart_4c73`, + Function: `function __templ_GenerateChart_4c73(idDiv, udata){htmx.onLoad(function(elt) { + console.log("elt ",elt) + var element = document.getElementById(idDiv); + console.log("element ",element) + if (element) { + element.style.height = "400px"; + element.style.width = "100%"; + } + + var myChart = {}; + var option = {}; + + // var myChart_001 = echarts.init(document.getElementById(idDiv)); + myChart[idDiv] = echarts.init(element); + + // var option_001 = JSON.parse(udata); + option[idDiv] = JSON.parse(udata); + console.log("option ", option) + // myChart_001.setOption(option_001); + myChart[idDiv].setOption(option[idDiv]); + }); +}`, + Call: templ.SafeScript(`__templ_GenerateChart_4c73`, idDiv, udata), + CallInline: templ.SafeScriptInline(`__templ_GenerateChart_4c73`, idDiv, udata), + } +} diff --git a/models/component/customcheckbox/customcheckboxv1.templ b/models/component/customcheckbox/customcheckboxv1.templ new file mode 100644 index 0000000..cac9ce4 --- /dev/null +++ b/models/component/customcheckbox/customcheckboxv1.templ @@ -0,0 +1,25 @@ +package customcheckbox + +import "cpone/models" + +templ MainCustomCheckboxInput(inp models.CustomCheckboxv1Prm) { +
+
+ +
+ +
+
+
+ { inp.ErrorMsg } +
+
+} diff --git a/models/component/customcheckbox/customcheckboxv1_templ.go b/models/component/customcheckbox/customcheckboxv1_templ.go new file mode 100644 index 0000000..fe62ec3 --- /dev/null +++ b/models/component/customcheckbox/customcheckboxv1_templ.go @@ -0,0 +1,143 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package customcheckbox + +//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/models" + +func MainCustomCheckboxInput(inp models.CustomCheckboxv1Prm) 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 + } + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customcheckbox\customcheckboxv1.templ`, Line: 22, Col: 17} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + 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 + }) +} diff --git a/models/component/customdropdown/customdropdown.templ b/models/component/customdropdown/customdropdown.templ new file mode 100644 index 0000000..49b3b31 --- /dev/null +++ b/models/component/customdropdown/customdropdown.templ @@ -0,0 +1,61 @@ +package customdropdown; + +import "cpone/models" + +templ MainCustomDropdown(inp models.CustomDropdownv1Prm, listItem templ.Component) { +
+ +
+ { inp.ErrorMsg } +
+
+} + +templ MainCustomDropdownInput(inp models.CustomDropdownv1Prm, listItem templ.Component) { +
+ +
+ { inp.ErrorMsg } +
+
+} + +templ MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string, listItem templ.Component) { +
+ +
+} diff --git a/models/component/customdropdown/customdropdown_templ.go b/models/component/customdropdown/customdropdown_templ.go new file mode 100644 index 0000000..8702c57 --- /dev/null +++ b/models/component/customdropdown/customdropdown_templ.go @@ -0,0 +1,343 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package customdropdown + +//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/models" + +func MainCustomDropdown(inp models.CustomDropdownv1Prm, listItem 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 + } + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customdropdown\customdropdown.templ`, Line: 22, Col: 17} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + 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 MainCustomDropdownInput(inp models.CustomDropdownv1Prm, listItem 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_Var10 := templ.GetChildren(ctx) + if templ_7745c5c3_Var10 == nil { + templ_7745c5c3_Var10 = 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_Var13 string + templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customdropdown\customdropdown.templ`, Line: 39, Col: 17} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) + 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 MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string, listItem 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_Var14 := templ.GetChildren(ctx) + if templ_7745c5c3_Var14 == nil { + templ_7745c5c3_Var14 = 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 + }) +} diff --git a/models/component/customtextfield/customtextfield.templ b/models/component/customtextfield/customtextfield.templ new file mode 100644 index 0000000..73c5598 --- /dev/null +++ b/models/component/customtextfield/customtextfield.templ @@ -0,0 +1,17 @@ +package customtextfield + +templ MainCustomTextField(inpLabelText, + inpName, + inpPlaceHolder, + inpType string) { +
+ + +
+} diff --git a/models/component/customtextfield/customtextfield_templ.go b/models/component/customtextfield/customtextfield_templ.go new file mode 100644 index 0000000..f51f8e8 --- /dev/null +++ b/models/component/customtextfield/customtextfield_templ.go @@ -0,0 +1,103 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package customtextfield + +//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 MainCustomTextField(inpLabelText, + inpName, + inpPlaceHolder, + inpType string) 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 + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} diff --git a/models/component/customtextfield/customtextfieldv2.templ b/models/component/customtextfield/customtextfieldv2.templ new file mode 100644 index 0000000..30d3e28 --- /dev/null +++ b/models/component/customtextfield/customtextfieldv2.templ @@ -0,0 +1,31 @@ +package customtextfield + +import "cpone/models" + +templ CustomTextFieldv2(inp models.CustomTextFieldv2Prm) { +
+ + +
+ { inp.ErrorMsg } +
+
+} diff --git a/models/component/customtextfield/customtextfieldv2_templ.go b/models/component/customtextfield/customtextfieldv2_templ.go new file mode 100644 index 0000000..20eb177 --- /dev/null +++ b/models/component/customtextfield/customtextfieldv2_templ.go @@ -0,0 +1,158 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package customtextfield + +//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/models" + +func CustomTextFieldv2(inp models.CustomTextFieldv2Prm) 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 + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Label) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfield\customtextfieldv2.templ`, Line: 14, Col: 14} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + 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 + } + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfield\customtextfieldv2.templ`, Line: 28, Col: 17} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + 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 + }) +} diff --git a/models/component/customtextfieldautocomplete/customtextfieldautocomplete.templ b/models/component/customtextfieldautocomplete/customtextfieldautocomplete.templ new file mode 100644 index 0000000..3846a38 --- /dev/null +++ b/models/component/customtextfieldautocomplete/customtextfieldautocomplete.templ @@ -0,0 +1,126 @@ +package customtextfieldautocomplete; + +import ( + "cpone/layout" + "cpone/models" +) + +templ MainCustomAutoComplete(value string) { +
+ +
+
+ Loading... +
+
+
+} + +templ ListCustomAutoCompleteHide() { +
+} + +templ ListCustomAutoComplete(limit string, param string, totalDataInt int, foundCount int, pageOf string, textFound string, data []models.AutoComplete) { + +} + +templ JsCustomAutoComplete() { +} + +templ CssCustomAutoComplete() { + +} + +templ ShowCustomAutoComplete(title string, cmp templ.Component, css templ.Component, js templ.Component) { + @layout.PlaygroundLayout(title, css, js) { + @cmp + } +} diff --git a/models/component/customtextfieldautocomplete/customtextfieldautocomplete_templ.go b/models/component/customtextfieldautocomplete/customtextfieldautocomplete_templ.go new file mode 100644 index 0000000..924a788 --- /dev/null +++ b/models/component/customtextfieldautocomplete/customtextfieldautocomplete_templ.go @@ -0,0 +1,268 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package customtextfieldautocomplete + +//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" + "cpone/models" +) + +func MainCustomAutoComplete(value string) 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("
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 ListCustomAutoCompleteHide() 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 ListCustomAutoComplete(limit string, param string, totalDataInt int, foundCount int, pageOf string, textFound string, data []models.AutoComplete) 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("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if len(data) == 0 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Data Tidak Ditemukan") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + for _, d := range data { + _, 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(d.Name) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldautocomplete\customtextfieldautocomplete.templ`, Line: 48, Col: 13} + } + _, 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 + } + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Loading...

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(textFound) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldautocomplete\customtextfieldautocomplete.templ`, Line: 59, Col: 76} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + 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 foundCount == totalDataInt { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Show More") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Show More") + 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 JsCustomAutoComplete() 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_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = 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 CssCustomAutoComplete() 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_Var10 := templ.GetChildren(ctx) + if templ_7745c5c3_Var10 == nil { + templ_7745c5c3_Var10 = 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 ShowCustomAutoComplete(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_Var11 := templ.GetChildren(ctx) + if templ_7745c5c3_Var11 == nil { + templ_7745c5c3_Var11 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var12 := 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_Var12), 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/models/component/customtextfieldsearch/customtextfieldsearch.templ b/models/component/customtextfieldsearch/customtextfieldsearch.templ new file mode 100644 index 0000000..dec85a3 --- /dev/null +++ b/models/component/customtextfieldsearch/customtextfieldsearch.templ @@ -0,0 +1,85 @@ +package customtextfieldsearch + +templ MainCustomTextFieldSearch( + inpName, + inpPlaceHolder, + inpType, + hxPost, + hxTrigger, + hxTarget, + hxIndicator string) { + +} + +templ MainCustomTextFieldSearchV1( + inpId, + inpName, + inpPlaceHolder, + inpType, + hxGet, + hxTrigger, + hxTarget, + hxIndicator, + value, + hxExt string) { + +} + +templ MainCustomTextFieldSearchV2( + inpId, + inpName, + inpPlaceHolder, + inpType, + hxGet, + hxTrigger, + hxTarget, + hxIndicator, + value, + hxSwap string, + hxInclude string) { + + +} diff --git a/models/component/customtextfieldsearch/customtextfieldsearch_templ.go b/models/component/customtextfieldsearch/customtextfieldsearch_templ.go new file mode 100644 index 0000000..8f04b16 --- /dev/null +++ b/models/component/customtextfieldsearch/customtextfieldsearch_templ.go @@ -0,0 +1,488 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package customtextfieldsearch + +//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 MainCustomTextFieldSearch( + inpName, + inpPlaceHolder, + inpType, + hxPost, + hxTrigger, + hxTarget, + hxIndicator string) 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 + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func MainCustomTextFieldSearchV1( + inpId, + inpName, + inpPlaceHolder, + inpType, + hxGet, + hxTrigger, + hxTarget, + hxIndicator, + value, + hxExt string) 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_Var10 := templ.GetChildren(ctx) + if templ_7745c5c3_Var10 == nil { + templ_7745c5c3_Var10 = 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 MainCustomTextFieldSearchV2( + inpId, + inpName, + inpPlaceHolder, + inpType, + hxGet, + hxTrigger, + hxTarget, + hxIndicator, + value, + hxSwap string, + hxInclude string) 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_Var21 := templ.GetChildren(ctx) + if templ_7745c5c3_Var21 == nil { + templ_7745c5c3_Var21 = 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 + }) +} diff --git a/models/component/modal/modal.templ b/models/component/modal/modal.templ new file mode 100644 index 0000000..9742c2f --- /dev/null +++ b/models/component/modal/modal.templ @@ -0,0 +1,30 @@ +package modalcomponent + +templ Modal(modalID string, modalTitle string, modalBody templ.Component, modalAction templ.Component, btnClose templ.Component) { + +} diff --git a/models/component/modal/modal_confirmation.templ b/models/component/modal/modal_confirmation.templ new file mode 100644 index 0000000..499dd66 --- /dev/null +++ b/models/component/modal/modal_confirmation.templ @@ -0,0 +1,52 @@ +package modalcomponent + +templ ModalConfirmation( + id string, + modalTitle string, + message string, + btnClose templ.Component, + datHeader []string, + dataText []string, + modalAction templ.Component) { + +} diff --git a/models/component/modal/modal_confirmation_templ.go b/models/component/modal/modal_confirmation_templ.go new file mode 100644 index 0000000..8ffdce8 --- /dev/null +++ b/models/component/modal/modal_confirmation_templ.go @@ -0,0 +1,143 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package modalcomponent + +//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 ModalConfirmation( + id string, + modalTitle string, + message string, + btnClose templ.Component, + datHeader []string, + dataText []string, + modalAction 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 + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(modalTitle) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\modal\modal_confirmation.templ`, Line: 23, Col: 18} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + 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 = btnClose.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 + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(message) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\modal\modal_confirmation.templ`, Line: 28, Col: 17} + } + _, 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 + } + for _, v := range datHeader { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\modal\modal_confirmation.templ`, Line: 33, Col: 71} + } + _, 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("
") + 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 + } + for _, v := range dataText { + _, 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(v) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\modal\modal_confirmation.templ`, Line: 39, Col: 13} + } + _, 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 + } + } + _, 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 + }) +} diff --git a/models/component/modal/modal_templ.go b/models/component/modal/modal_templ.go new file mode 100644 index 0000000..f07b36e --- /dev/null +++ b/models/component/modal/modal_templ.go @@ -0,0 +1,85 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package modalcomponent + +//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 Modal(modalID string, modalTitle string, modalBody templ.Component, modalAction templ.Component, btnClose 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 + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(modalTitle) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\modal\modal.templ`, Line: 17, Col: 18} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + 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 = btnClose.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 = modalBody.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 + }) +} diff --git a/models/component/navbar/navbar.templ b/models/component/navbar/navbar.templ new file mode 100644 index 0000000..75da30c --- /dev/null +++ b/models/component/navbar/navbar.templ @@ -0,0 +1,74 @@ +package navbar + +import ( + "cpone/component/sidebarmaster" + + "cpone/models" +) + +templ Navbar(dataUser models.User) { +
+ +
+ +
+ + +
+ +
+
+ Hi, + { dataUser.Username } + + + +
+
+ +
+ +
+ +
+} + +templ NavbarMenu(datamenu []models.Menu) { +
+ +
+ + + +
+ +
+} diff --git a/models/component/navbar/navbar_templ.go b/models/component/navbar/navbar_templ.go new file mode 100644 index 0000000..020185e --- /dev/null +++ b/models/component/navbar/navbar_templ.go @@ -0,0 +1,112 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package navbar + +//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/sidebarmaster" + + "cpone/models" +) + +func Navbar(dataUser models.User) 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("
Hi, ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(dataUser.Username) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\navbar\navbar.templ`, Line: 29, Col: 26} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + 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 NavbarMenu(datamenu []models.Menu) 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 + } + for index, d := range datamenu { + if index == 0 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sidebarmaster.MenuDashboard(d.ParentMenuName, d.ParentUrl).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
  • Menu

  • ") + 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 index+1 < len(datamenu) { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = sidebarmaster.ListMenuNavbar(datamenu[index+1].ParentMenuName, datamenu[index+1].Children).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 + }) +} diff --git a/models/component/pagination/pagination.templ b/models/component/pagination/pagination.templ new file mode 100644 index 0000000..72a1b7d --- /dev/null +++ b/models/component/pagination/pagination.templ @@ -0,0 +1,59 @@ +package pagination + +import "strconv" + +templ Pagination(length int, currentPage int, link string, contentID string) { + // hx-on::before-request={ HideContent(contentID) } + // hx-on::after-request="alert('Done making a request!')" +
+
+ for i:=0; i{ strconv.Itoa(i+1) } + } else { + { strconv.Itoa(i+1) } + } + } +
+
+} + +script ShowContent(contentID string) { + console.log("Show Content"); + console.log(contentID); + document.getElementById(contentID).setAttribute("visible",""); + // document.querySelector('#'+contentID).style.display = 'block'; + // document.querySelector('#'+contentID).setAttribute("visible",""); + +} + +script HideContent(contentID string) { + console.log("Hide Content"); + console.log(contentID); + document.getElementById(contentID).setAttribute("hidden",""); + // document.querySelector('#'+contentID).style.display = 'none'; + // document.querySelector('#'+contentID).setAttribute("hidden",""); +} + +script CobaContent(contentID string) { + console.log(contentID); + +} diff --git a/models/component/pagination/pagination_templ.go b/models/component/pagination/pagination_templ.go new file mode 100644 index 0000000..0d8822e --- /dev/null +++ b/models/component/pagination/pagination_templ.go @@ -0,0 +1,216 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package pagination + +//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 "strconv" + +func Pagination(length int, currentPage int, link string, contentID string) 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 + } + for i := 0; i < length; i++ { + if (i + 1) == currentPage { + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HideContent(contentID), ShowContent(contentID)) + 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 + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\pagination.templ`, Line: 21, Col: 25} + } + _, 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 + } + } else { + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HideContent(contentID), ShowContent(contentID)) + 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 + } + var templ_7745c5c3_Var11 string + templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\pagination.templ`, Line: 32, Col: 25} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) + 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 = 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 ShowContent(contentID string) templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_ShowContent_cf70`, + Function: `function __templ_ShowContent_cf70(contentID){console.log("Show Content"); + console.log(contentID); + document.getElementById(contentID).setAttribute("visible",""); + // document.querySelector('#'+contentID).style.display = 'block'; + // document.querySelector('#'+contentID).setAttribute("visible",""); + +}`, + Call: templ.SafeScript(`__templ_ShowContent_cf70`, contentID), + CallInline: templ.SafeScriptInline(`__templ_ShowContent_cf70`, contentID), + } +} + +func HideContent(contentID string) templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_HideContent_0799`, + Function: `function __templ_HideContent_0799(contentID){console.log("Hide Content"); + console.log(contentID); + document.getElementById(contentID).setAttribute("hidden",""); + // document.querySelector('#'+contentID).style.display = 'none'; + // document.querySelector('#'+contentID).setAttribute("hidden",""); +}`, + Call: templ.SafeScript(`__templ_HideContent_0799`, contentID), + CallInline: templ.SafeScriptInline(`__templ_HideContent_0799`, contentID), + } +} + +func CobaContent(contentID string) templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_CobaContent_ef1c`, + Function: `function __templ_CobaContent_ef1c(contentID){console.log(contentID); + +}`, + Call: templ.SafeScript(`__templ_CobaContent_ef1c`, contentID), + CallInline: templ.SafeScriptInline(`__templ_CobaContent_ef1c`, contentID), + } +} diff --git a/models/component/pagination/paginationv1.templ b/models/component/pagination/paginationv1.templ new file mode 100644 index 0000000..db442af --- /dev/null +++ b/models/component/pagination/paginationv1.templ @@ -0,0 +1,55 @@ +package pagination + +import "strconv" + +templ PaginationV1(length int, currentPage int, link string, contentID string, searchQueryParam string) { + // hx-on::before-request={ HideContent(contentID) } + // hx-on::after-request="alert('Done making a request!')" +
+
+ for i:=0; i{ strconv.Itoa(i+1) } + } else { + { strconv.Itoa(i+1) } + } + } +
+
+} + +// script ShowContent(contentID string) { +// console.log("Show Content"); +// console.log(contentID); +// document.getElementById(contentID).setAttribute("visible",""); +// // document.querySelector('#'+contentID).style.display = 'block'; +// // document.querySelector('#'+contentID).setAttribute("visible",""); + +// } + +// script HideContent(contentID string) { +// console.log("Hide Content"); +// console.log(contentID); +// document.getElementById(contentID).setAttribute("hidden",""); +// // document.querySelector('#'+contentID).style.display = 'none'; +// // document.querySelector('#'+contentID).setAttribute("hidden",""); +// } + +// script CobaContent(contentID string) { +// console.log(contentID); + +// } diff --git a/models/component/pagination/paginationv1_templ.go b/models/component/pagination/paginationv1_templ.go new file mode 100644 index 0000000..94b2e89 --- /dev/null +++ b/models/component/pagination/paginationv1_templ.go @@ -0,0 +1,154 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package pagination + +//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 "strconv" + +func PaginationV1(length int, currentPage int, link string, contentID string, searchQueryParam string) 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 + } + for i := 0; i < length; i++ { + if (i + 1) == currentPage { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\paginationv1.templ`, Line: 19, Col: 25} + } + _, 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 + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\paginationv1.templ`, Line: 28, Col: 25} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + 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 = 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 + }) +} + +// script ShowContent(contentID string) { +// console.log("Show Content"); +// console.log(contentID); +// document.getElementById(contentID).setAttribute("visible",""); +// // document.querySelector('#'+contentID).style.display = 'block'; +// // document.querySelector('#'+contentID).setAttribute("visible",""); + +// } + +// script HideContent(contentID string) { +// console.log("Hide Content"); +// console.log(contentID); +// document.getElementById(contentID).setAttribute("hidden",""); +// // document.querySelector('#'+contentID).style.display = 'none'; +// // document.querySelector('#'+contentID).setAttribute("hidden",""); +// } + +// script CobaContent(contentID string) { +// console.log(contentID); + +// } diff --git a/models/component/pagination/paginationv2.templ b/models/component/pagination/paginationv2.templ new file mode 100644 index 0000000..926256b --- /dev/null +++ b/models/component/pagination/paginationv2.templ @@ -0,0 +1,52 @@ +package pagination + +import "strconv" +import "cpone/component/customtextfield" +import "cpone/models" + +templ PaginationV2(length int, + currentPage int, + link string, + paginationID string, + hxInclude string, + hxTarget string, + hxSwap string, + hxIndicator string, + hxSwapOob string) { + // hx-on::before-request={ HideContent(contentID) } + // hx-on::after-request="alert('Done making a request!')" +
+
+ for i:=0; i{ strconv.Itoa(i+1) } + } else { + { strconv.Itoa(i+1) } + } + } +
+ @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ + ID: "currpage" + paginationID, + Name: "currpage" + paginationID, + Type: "hidden", + Value: strconv.Itoa(currentPage)}) +
+} diff --git a/models/component/pagination/paginationv2_templ.go b/models/component/pagination/paginationv2_templ.go new file mode 100644 index 0000000..e2cece9 --- /dev/null +++ b/models/component/pagination/paginationv2_templ.go @@ -0,0 +1,258 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package pagination + +//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 "strconv" +import "cpone/component/customtextfield" +import "cpone/models" + +func PaginationV2(length int, + currentPage int, + link string, + paginationID string, + hxInclude string, + hxTarget string, + hxSwap string, + hxIndicator string, + hxSwapOob string) 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 + } + for i := 0; i < length; i++ { + if (i + 1) == currentPage { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\paginationv2.templ`, Line: 31, Col: 25} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + 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 + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var15 string + templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\paginationv2.templ`, Line: 42, Col: 25} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) + 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 = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ + ID: "currpage" + paginationID, + Name: "currpage" + paginationID, + Type: "hidden", + Value: strconv.Itoa(currentPage)}).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 + }) +} diff --git a/models/component/sidebar_user_profile/sidebar_user_profile.templ b/models/component/sidebar_user_profile/sidebar_user_profile.templ new file mode 100644 index 0000000..06b932f --- /dev/null +++ b/models/component/sidebar_user_profile/sidebar_user_profile.templ @@ -0,0 +1,82 @@ +package sidebaruserprofile + +import "cpone/models" + +templ Navbaruserprofile(dataUser models.User) { +
+ +
+

+ User Profile + // 12 messages +

+ + + +
+ + +
+ + @ProfileHeader(dataUser) + + +
+ + +
+ +
+ Recent Notifications +
+ + + @NotificationCard() + +
+ +
+ +
+} + +templ ProfileHeader(dataUser models.User) { +
+
+ //
+ // + +
+
+ + { dataUser.UserFullName } + +
+ { dataUser.UserPosition } +
+ +
+
+} + +templ NotificationCard() { +
+ + + + + + + +
+} diff --git a/models/component/sidebar_user_profile/sidebar_user_profile_templ.go b/models/component/sidebar_user_profile/sidebar_user_profile_templ.go new file mode 100644 index 0000000..1d2c6e6 --- /dev/null +++ b/models/component/sidebar_user_profile/sidebar_user_profile_templ.go @@ -0,0 +1,127 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package sidebaruserprofile + +//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/models" + +func Navbaruserprofile(dataUser models.User) 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("

User Profile\r

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = ProfileHeader(dataUser).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Recent Notifications\r
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = NotificationCard().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 ProfileHeader(dataUser models.User) 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 + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(dataUser.UserFullName) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\sidebar_user_profile\sidebar_user_profile.templ`, Line: 52, Col: 27} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + 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 + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(dataUser.UserPosition) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\sidebar_user_profile\sidebar_user_profile.templ`, Line: 55, Col: 27} + } + _, 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 + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func NotificationCard() 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_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = 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 + }) +} diff --git a/models/component/sidebarmaster/sidebarmaster.templ b/models/component/sidebarmaster/sidebarmaster.templ new file mode 100644 index 0000000..686839e --- /dev/null +++ b/models/component/sidebarmaster/sidebarmaster.templ @@ -0,0 +1,102 @@ +package sidebarmaster + +import ( + "cpone/models" +) + +templ MenuDashboard(ParentMenuName string, ParentMenuUrl string) { + +} + +templ ListMenuChildren(ChildrenMenuURL string, ChildrenMenuName string) { + +} + +templ ListMenuNavbar(ParentMenuName string, datamenuchildren []models.ChildrenMenu) { + +} diff --git a/models/component/sidebarmaster/sidebarmaster_templ.go b/models/component/sidebarmaster/sidebarmaster_templ.go new file mode 100644 index 0000000..239c1b0 --- /dev/null +++ b/models/component/sidebarmaster/sidebarmaster_templ.go @@ -0,0 +1,167 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package sidebarmaster + +//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/models" +) + +func MenuDashboard(ParentMenuName string, ParentMenuUrl string) 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 + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(ParentMenuName) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\sidebarmaster\sidebarmaster.templ`, Line: 39, Col: 50} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + 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 ListMenuChildren(ChildrenMenuURL string, ChildrenMenuName string) 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("
  • ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(ChildrenMenuName) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\sidebarmaster\sidebarmaster.templ`, Line: 48, Col: 45} + } + _, 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 + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func ListMenuNavbar(ParentMenuName string, datamenuchildren []models.ChildrenMenu) 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_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_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(ParentMenuName) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\sidebarmaster\sidebarmaster.templ`, Line: 84, Col: 50} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + 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 + } + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(ParentMenuName) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\sidebarmaster\sidebarmaster.templ`, Line: 94, Col: 46} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + 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 + } + for _, dx := range datamenuchildren { + templ_7745c5c3_Err = ListMenuChildren(dx.ChildrenMenuURL, dx.ChildrenMenuName).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 + }) +} diff --git a/models/component/table/table.templ b/models/component/table/table.templ new file mode 100644 index 0000000..ef66f32 --- /dev/null +++ b/models/component/table/table.templ @@ -0,0 +1,25 @@ +package tablecomponent + +templ Table(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component) { + if len(thName) != len(thWidth) { +
    length array thname berbeda dengan array thwidth
    + } else { +
    + + + + for i, item := range thName { + + } + + + + @trComponent + +
    { item }
    +
    +
    + @pagination +
    + } +} diff --git a/models/component/table/table_templ.go b/models/component/table/table_templ.go new file mode 100644 index 0000000..16ed521 --- /dev/null +++ b/models/component/table/table_templ.go @@ -0,0 +1,94 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package tablecomponent + +//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 Table(thName []string, thWidth []string, trComponent templ.Component, pagination 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) + if len(thName) != len(thWidth) { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    length array thname berbeda dengan array thwidth
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for i, item := range thName { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + 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 = trComponent.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 + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(item) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\table\table.templ`, Line: 12, Col: 50} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + 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 = pagination.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 + }) +} diff --git a/models/component/table/tablev1.templ b/models/component/table/tablev1.templ new file mode 100644 index 0000000..dee84ad --- /dev/null +++ b/models/component/table/tablev1.templ @@ -0,0 +1,25 @@ +package tablecomponent + +templ TableV1(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component, idunique string) { + if len(thName) != len(thWidth) { +
    length array thname berbeda dengan array thwidth
    + } else { +
    + + + + for i, item := range thName { + + } + + + + @trComponent + +
    { item }
    +
    + @pagination +
    +
    + } +} diff --git a/models/component/table/tablev1_templ.go b/models/component/table/tablev1_templ.go new file mode 100644 index 0000000..c229a49 --- /dev/null +++ b/models/component/table/tablev1_templ.go @@ -0,0 +1,107 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package tablecomponent + +//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 TableV1(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component, idunique string) 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) + if len(thName) != len(thWidth) { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    length array thname berbeda dengan array thwidth
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for i, item := range thName { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + 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 = trComponent.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 + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(item) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\table\tablev1.templ`, Line: 12, Col: 50} + } + _, 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 + } + templ_7745c5c3_Err = pagination.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 + }) +} diff --git a/models/component/table/tablev2.templ b/models/component/table/tablev2.templ new file mode 100644 index 0000000..e2d26b6 --- /dev/null +++ b/models/component/table/tablev2.templ @@ -0,0 +1,31 @@ +package tablecomponent + +templ TableV2(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component, idunique string, inputanSearch templ.Component) { + if len(thName) != len(thWidth) { +
    length array thname berbeda dengan array thwidth
    + } else { + @inputanSearch +
    +
    + + + + for i, item := range thName { + + } + + + + @trComponent + +
    { item }
    +
    + @pagination +
    +
    + } +} + +templ DivEmpty() { +
    +} diff --git a/models/component/table/tablev2_templ.go b/models/component/table/tablev2_templ.go new file mode 100644 index 0000000..9cfeb0d --- /dev/null +++ b/models/component/table/tablev2_templ.go @@ -0,0 +1,135 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package tablecomponent + +//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 TableV2(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component, idunique string, inputanSearch 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) + if len(thName) != len(thWidth) { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    length array thname berbeda dengan array thwidth
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + templ_7745c5c3_Err = inputanSearch.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 + } + for i, item := range thName { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + 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 = trComponent.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 + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(item) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\table\tablev2.templ`, Line: 14, Col: 50} + } + _, 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 + } + templ_7745c5c3_Err = pagination.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 DivEmpty() 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_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = 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 + }) +} diff --git a/models/component/table/tablev3.templ b/models/component/table/tablev3.templ new file mode 100644 index 0000000..432eb50 --- /dev/null +++ b/models/component/table/tablev3.templ @@ -0,0 +1,27 @@ +package tablecomponent + +templ TableV3(thName []string, thWidth []string, trComponent templ.Component) { +
    + if len(thName) != len(thWidth) { +
    length array thname berbeda dengan array thwidth
    + } else { +
    + + + + for i, item := range thName { + + } + + + + @trComponent + +
    { item }
    + } +
    +} + +templ DivEmptyV3() { +
    +} diff --git a/models/component/table/tablev3_templ.go b/models/component/table/tablev3_templ.go new file mode 100644 index 0000000..6ed9782 --- /dev/null +++ b/models/component/table/tablev3_templ.go @@ -0,0 +1,118 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package tablecomponent + +//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 TableV3(thName []string, thWidth []string, trComponent 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 + } + if len(thName) != len(thWidth) { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    length array thname berbeda dengan array thwidth
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for i, item := range thName { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + 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 = trComponent.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 + } + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(item) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\table\tablev3.templ`, Line: 13, Col: 50} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + 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 = 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 DivEmptyV3() 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("
    ") + 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/models/component/toastbootstrap/customtoastv1.templ b/models/component/toastbootstrap/customtoastv1.templ new file mode 100644 index 0000000..85379df --- /dev/null +++ b/models/component/toastbootstrap/customtoastv1.templ @@ -0,0 +1,15 @@ +package customtoastv1 + +templ CustomToastV1(message string, idUniqueCustomToast string) { +
    + +
    +} diff --git a/models/component/toastbootstrap/customtoastv1_templ.go b/models/component/toastbootstrap/customtoastv1_templ.go new file mode 100644 index 0000000..0262dfd --- /dev/null +++ b/models/component/toastbootstrap/customtoastv1_templ.go @@ -0,0 +1,48 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package customtoastv1 + +//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 CustomToastV1(message string, idUniqueCustomToast string) 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("
    Pemberitahuan
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(message) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\toastbootstrap\customtoastv1.templ`, Line: 11, Col: 25} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + 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 + }) +} diff --git a/models/component/toastbootstrap/customtoastv2.templ b/models/component/toastbootstrap/customtoastv2.templ new file mode 100644 index 0000000..63db879 --- /dev/null +++ b/models/component/toastbootstrap/customtoastv2.templ @@ -0,0 +1,86 @@ +package customtoastv1 + +// kalau eror => bg nya danger +// kalau sukses => bgnya success +// kalau warning => bgnya warning + +func toastBackground(typeToast string) string { + return "bg-" + typeToast +} + +func toastBody(typeToastBody string) string { + return "bg-" + typeToastBody + "-transparent" +} + +func toastIcon(typeToast string) string { + var stringx string + if typeToast == "success" { + stringx = "solar:check-circle-broken" + } else { + if typeToast == "danger" { + stringx = "solar:close-circle-broken" + } else { + if typeToast == "warning" { + stringx = "solar:shield-warning-bold" + } else { + if typeToast == "information" { + stringx = "solar:info-square-broken" + } + } + } + } + + return stringx +} + +templ CustomToastV2Show(title string, message string, typeToast string) { + +} + +templ CustomToastV2Hide() { + +} diff --git a/models/component/toastbootstrap/customtoastv2_templ.go b/models/component/toastbootstrap/customtoastv2_templ.go new file mode 100644 index 0000000..a50fd6d --- /dev/null +++ b/models/component/toastbootstrap/customtoastv2_templ.go @@ -0,0 +1,175 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package customtoastv1 + +//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" + +// kalau eror => bg nya danger +// kalau sukses => bgnya success +// kalau warning => bgnya warning + +func toastBackground(typeToast string) string { + return "bg-" + typeToast +} + +func toastBody(typeToastBody string) string { + return "bg-" + typeToastBody + "-transparent" +} + +func toastIcon(typeToast string) string { + var stringx string + if typeToast == "success" { + stringx = "solar:check-circle-broken" + } else { + if typeToast == "danger" { + stringx = "solar:close-circle-broken" + } else { + if typeToast == "warning" { + stringx = "solar:shield-warning-bold" + } else { + if typeToast == "information" { + stringx = "solar:info-square-broken" + } + } + } + } + + return stringx +} + +func CustomToastV2Show(title string, message string, typeToast string) 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 + } + var templ_7745c5c3_Var2 = []any{"toast-header", toastBackground(typeToast), "text-white"} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + 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 + } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\toastbootstrap\customtoastv2.templ`, Line: 54, Col: 34} + } + _, 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("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 = []any{"toast-body", toastBody(typeToast)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, 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 + } + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(message) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\toastbootstrap\customtoastv2.templ`, Line: 60, Col: 12} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + 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 CustomToastV2Hide() 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_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    Success just now
    This is a success toast.\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/models/component/under_development/under_development.templ b/models/component/under_development/under_development.templ new file mode 100644 index 0000000..f3d1b3b --- /dev/null +++ b/models/component/under_development/under_development.templ @@ -0,0 +1,17 @@ +package under_development + +templ UnderDevelopment() { +
    +
    Site Under Development
    +
    + "Stay Tuned, We're Building Excitement!" +
    +
    + Your Brand +
    +
    +} diff --git a/models/component/under_development/under_development_templ.go b/models/component/under_development/under_development_templ.go new file mode 100644 index 0000000..b43e4d9 --- /dev/null +++ b/models/component/under_development/under_development_templ.go @@ -0,0 +1,35 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package under_development + +//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 UnderDevelopment() 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("
    Site Under Development
    \"Stay Tuned, We're Building Excitement!\"\r
    \"Your
    ") + 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/models/customcheckbox.models.go b/models/customcheckbox.models.go new file mode 100644 index 0000000..ba456db --- /dev/null +++ b/models/customcheckbox.models.go @@ -0,0 +1,18 @@ +package models + +// name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string, + +type CustomCheckboxv1Prm struct { + HxTarget string `default:"hxTarget"` + HxGet string `default:"hxGet"` + HxIndicator string `default:"hxIndicator"` + HxInclude string `default:"hxInclude"` + HxTrigger string `default:"hxTrigger"` + Label string `default:"Label"` + Name string `default:"name"` + Text string `default:"text"` + // Type string `default:"text"` + Value string `default:""` + ErrorMsg string `default:""` + ID string +} diff --git a/models/customdropdown.models.go b/models/customdropdown.models.go new file mode 100644 index 0000000..7bc3001 --- /dev/null +++ b/models/customdropdown.models.go @@ -0,0 +1,18 @@ +package models + +// name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string, + +type CustomDropdownv1Prm struct { + HxTarget string `default:"hxTarget"` + HxGet string `default:"hxGet"` + HxIndicator string `default:"hxIndicator"` + HxInclude string `default:"hxInclude"` + HxTrigger string `default:"hxTrigger"` + Label string `default:"Label"` + Name string `default:"name"` + // Placeholder string `default:"Placeholder"` + // Type string `default:"text"` + // Value string `default:""` + ErrorMsg string `default:""` + ID string +} diff --git a/models/groupresult.models.go b/models/groupresult.models.go new file mode 100644 index 0000000..fc6146d --- /dev/null +++ b/models/groupresult.models.go @@ -0,0 +1,38 @@ +package models + +import "github.com/a-h/templ" + +type GroupResultResumeMcu struct { + Text string `default:"text"` + ID int `default:"id"` +} + +type GroupResult struct { + Nomor string `db:"nomor"` + Group_ResultID int `db:"Group_ResultID"` + Group_ResultName string `db:"Group_ResultName"` + Group_ResultFlagPerTest string `db:"Group_ResultFlagPerTest"` + Group_ResultFlagNonLab string `db:"Group_ResultFlagNonLab"` + Group_ResultResumeMcu string `db:"Group_ResultResumeMcu"` + Group_ResultIsActive string `db:"Group_ResultIsActive"` +} + +// form component +type GroupResultFormComponent struct { + IDComponent string + Link string + HxTarget string + HxSwap string + HxInclude string + ModalID string + ModalTitle string + InputGroupResultName CustomTextFieldv2Prm + InputGroupResult CustomTextFieldv2Prm + CheckboxGroupResultFlagPerTest CustomCheckboxv1Prm + CheckboxGroupResultFlagNonLab CustomCheckboxv1Prm + InputID CustomTextFieldv2Prm + DropdownGroupResultResumeMcu CustomDropdownv1Prm + DialogBody templ.Component + DialogAction templ.Component + ButtonCLose templ.Component +} diff --git a/services/dev/md.groupresult.services.go b/services/dev/md.groupresult.services.go new file mode 100644 index 0000000..3ad8ecd --- /dev/null +++ b/services/dev/md.groupresult.services.go @@ -0,0 +1,878 @@ +package dev_services + +import ( + "cpone/db" + "cpone/models" + "fmt" + "math" + "strconv" + "strings" + + dbx "cpone/package/database" + + "go.uber.org/zap" +) + +func NewServicesMdGroupResult(uStore db.AppStore) *ServicesMdGroupResult { + + return &ServicesMdGroupResult{ + MdGroupResultStore: uStore, + } +} + +type ServicesMdGroupResult struct { + MdGroupResultStore db.AppStore +} + +func (su *ServicesMdGroupResult) GetMasterMenus() ([]MasterMenu, error) { + + // dummyBreadcrumb := []Breadcrumb{ + // { + // Name: "Dashboard", + // Url: "/client/dashboard", + // }, + // { + // Name: "Front Office", + // Url: "/client/usermanagement", + // }, + // } + + dummyMenu := []MasterMenu{ + // 1. Dashboard + { + ID: "1", + ParentMenuID: "0", + ParentMenuName: "Dashboard", + ParentUrl: "/client/md/dashboard", + ParentIcon: "", + Children: []ChildrenMenu{ + { + ChildrenParentID: "1", + ChildrenMenuID: "1", + ChildrenMenuName: "Master User", + ChildrenMenuURL: "/client/md/user", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "Y", + // }, + // }, + }, + }, + }, + + // 2. Front Office + { + ID: "2", + ParentMenuID: "1", + ParentMenuName: "Front Office", + ParentUrl: "#", + ParentIcon: "", + Children: []ChildrenMenu{ + { + ChildrenParentID: "1", + ChildrenMenuID: "1", + ChildrenMenuName: "Registrasi", + ChildrenMenuURL: "/fo/registrasi", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User", + // IsActive: "Y", + // }, + // }, + }, + }, + }, + + // 3. Station + { + ID: "3", + ParentMenuID: "2", + ParentMenuName: "Station", + ParentUrl: "#", + ParentIcon: "", + Children: []ChildrenMenu{ + { + ChildrenParentID: "2", + ChildrenMenuID: "1", + ChildrenMenuName: "Sample Station", + ChildrenMenuURL: "/station/sample", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User", + // IsActive: "Y", + // }, + // }, + }, + }, + }, + + // 4. Management MCU + { + ID: "4", + ParentMenuID: "3", + ParentMenuName: "Management MCU", + ParentUrl: "#", + ParentIcon: "", + Children: []ChildrenMenu{ + { + ChildrenParentID: "3", + ChildrenMenuID: "1", + ChildrenMenuName: "Setup MCU", + ChildrenMenuURL: "/mcu/setup", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User", + // IsActive: "Y", + // }, + // }, + }, + { + ChildrenParentID: "3", + ChildrenMenuID: "2", + ChildrenMenuName: "Pre-Registrasi", + ChildrenMenuURL: "/mcu/preregister", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User", + // IsActive: "Y", + // }, + // }, + }, + }, + }, + + // 5. Master Data + { + ID: "5", + ParentMenuID: "4", + ParentMenuName: "Master Data", + ParentUrl: "#", + ParentIcon: "", + Children: []ChildrenMenu{ + // * Master User + { + ChildrenParentID: "4", + ChildrenMenuID: "1", + ChildrenMenuName: "Master User", + ChildrenMenuURL: "/client/md/user", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User", + // IsActive: "Y", + // }, + // }, + }, + + // * Master User Group + { + ChildrenParentID: "4", + ChildrenMenuID: "2", + ChildrenMenuName: "Master User Group", + ChildrenMenuURL: "/client/md/usergroup", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User Group", + // IsActive: "Y", + // }, + // }, + }, + + // * Master Corporate + { + ChildrenParentID: "4", + ChildrenMenuID: "3", + ChildrenMenuName: "Corporate", + ChildrenMenuURL: "/client/md/corp", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User Group", + // IsActive: "Y", + // }, + // }, + }, + + // * Test + { + ChildrenParentID: "4", + ChildrenMenuID: "4", + ChildrenMenuName: "Test", + ChildrenMenuURL: "/client/md/test", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User Group", + // IsActive: "Y", + // }, + // }, + }, + + // * Bahan + { + ChildrenParentID: "4", + ChildrenMenuID: "5", + ChildrenMenuName: "Bahan", + ChildrenMenuURL: "/client/md/bahan", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User Group", + // IsActive: "Y", + // }, + // }, + }, + + // * Sample Type + { + ChildrenParentID: "4", + ChildrenMenuID: "6", + ChildrenMenuName: "Sample Type", + ChildrenMenuURL: "/client/sample/type", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User Group", + // IsActive: "Y", + // }, + // }, + }, + + // * Sample Station + { + ChildrenParentID: "4", + ChildrenMenuID: "7", + ChildrenMenuName: "Sample Station", + ChildrenMenuURL: "/station/sample", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User Group", + // IsActive: "Y", + // }, + // }, + }, + + // * Result Non Lab + { + ChildrenParentID: "4", + ChildrenMenuID: "8", + ChildrenMenuName: "Result Non Lab", + ChildrenMenuURL: "/client/md/resultnonlab", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User Group", + // IsActive: "Y", + // }, + // }, + }, + + // * Template Fisik + { + ChildrenParentID: "4", + ChildrenMenuID: "9", + ChildrenMenuName: "Template Fisik", + ChildrenMenuURL: "/client/md/template-fisik", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User Group", + // IsActive: "Y", + // }, + // }, + }, + + // * Pasien + { + ChildrenParentID: "4", + ChildrenMenuID: "10", + ChildrenMenuName: "Pasien", + ChildrenMenuURL: "/client/md/pasien", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User Group", + // IsActive: "Y", + // }, + // }, + }, + + // * Dokter + { + ChildrenParentID: "4", + ChildrenMenuID: "11", + ChildrenMenuName: "Dokter", + ChildrenMenuURL: "/client/md/dokter", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User Group", + // IsActive: "Y", + // }, + // }, + }, + + // * Paket + { + ChildrenParentID: "4", + ChildrenMenuID: "12", + ChildrenMenuName: "Paket", + ChildrenMenuURL: "/client/md/paket", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User Group", + // IsActive: "Y", + // }, + // }, + }, + + // * Harga Single + { + ChildrenParentID: "4", + ChildrenMenuID: "13", + ChildrenMenuName: "Harga Single", + ChildrenMenuURL: "/client/md/hargasingle", + // Breadcrumb: []Breadcrumb{ + // { + // IDBreadcrumb: "1", + // Title: "Dashboard", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "2", + // Title: "Master", + // IsActive: "N", + // }, + // { + // IDBreadcrumb: "3", + // Title: "User Group", + // IsActive: "Y", + // }, + // }, + }, + }, + }, + } + + return dummyMenu, nil +} + +func (ug *ServicesMdGroupResult) GetUserGroup() ([]models.UserGroup, error) { + data := []models.UserGroup{ + {UserGroupID: 1, UserGroupKode: "A", UserGroupName: "UG1"}, + {UserGroupID: 2, UserGroupKode: "B", UserGroupName: "UG2"}, + {UserGroupID: 3, UserGroupKode: "C", UserGroupName: "UG3"}, + } + return data, nil +} + +func (su *ServicesMdGroupResult) GetMdGroupResultBreadcrumb(title string) (models.BreadCrumbV1, error) { + var ret models.BreadCrumbV1 + + dummyBreadcrumb := []models.BreadCrumbV1{ + { + Title: "Master User Group", + Item: []models.ItemBreadCrumbV1{ + { + Item: "Dashboard", + Url: "/dev/dashboard", + }, + { + Item: "Master", + Url: "/dev/master", + }, + { + Item: "User Group", + Url: "", + }, + }, + }, + + { + Title: "Master User", + Item: []models.ItemBreadCrumbV1{ + { + Item: "Dashboard", + Url: "/dev/dashboard", + }, + { + Item: "Master", + Url: "/dev/master", + }, + { + Item: "User", + Url: "", + }, + }, + }, + + { + Title: "Master Group Result", + Item: []models.ItemBreadCrumbV1{ + { + Item: "Dashboard", + Url: "/dev/dashboard", + }, + { + Item: "Master", + Url: "/dev/master", + }, + { + Item: "Group Result", + Url: "", + }, + }, + }, + } + + for _, breadcrumb := range dummyBreadcrumb { + // if utils.Contains(breadcrumb.Title, title) { + // ret = breadcrumb + // return ret, nil + // } + if breadcrumb.Title == title { + ret = breadcrumb + return ret, nil + } + } + + return ret, nil +} + +// (LAB, NONLAB, FISIK, DOCTOR) +// hardcore group result resume mcu +func (ug *ServicesMdGroupResult) GetMdGroupResultResumeMcu() ([]models.GroupResultResumeMcu, error) { + data := []models.GroupResultResumeMcu{ + { + ID: 1, + Text: "LAB", + }, + { + ID: 2, + Text: "NONLAB", + }, + { + ID: 3, + Text: "FISIK", + }, + { + ID: 4, + Text: "DOCTOR", + }, + } + return data, nil +} + +// versi 2 +func (su *ServicesMdGroupResult) GetListMdGroupResult(search string, currentPage int, rowPerPage int) ([]models.GroupResult, int, error) { + var groupresultList []models.GroupResult + + logger, _ := zap.NewProduction() + defer logger.Sync() + + var totalData int + offset := (currentPage - 1) * rowPerPage + + prm := "%" + strings.TrimSpace(search) + "%" + querytotal := ` + SELECT COUNT(*) + FROM group_result + WHERE Group_ResultIsActive = 'Y' + AND (Group_ResultName LIKE ? OR Group_ResultResumeMcu LIKE ?) + ` + + logger.Info("QUERY SEARCH INITIAL TOTAL COUNT", + zap.String("query search", querytotal), + ) + + if err := dbx.Handlex.Get(&totalData, querytotal, prm, prm); err != nil { + return nil, 0, fmt.Errorf("error querying database: %v", err) + } + + query := ` + SELECT + ROW_NUMBER() OVER () AS nomor, + Group_ResultID, + IFNULL(Group_ResultName, '') AS Group_ResultName, + IFNULL(Group_ResultFlagPerTest, '') AS Group_ResultFlagPerTest, + IFNULL(Group_ResultFlagNonLab, '') AS Group_ResultFlagNonLab, + IFNULL(Group_ResultResumeMcu, '') AS Group_ResultResumeMcu, + Group_ResultIsActive + FROM group_result + WHERE Group_ResultIsActive = 'Y' + AND (Group_ResultName LIKE ? OR Group_ResultResumeMcu LIKE ?) + ORDER BY Group_ResultID ASC + LIMIT ? OFFSET ? + ` + + logger.Info("QUERY SEARCH INITIAL", + zap.String("query search", query), + ) + + if err := dbx.Handlex.Select(&groupresultList, query, prm, prm, rowPerPage, offset); err != nil { + return nil, 0, fmt.Errorf("error querying database: %v", err) + } + + totalPage := int(math.Ceil(float64(totalData) / float64(rowPerPage))) + + return groupresultList, totalPage, nil +} + +// GET BY ID +func (ug *ServicesMdGroupResult) GetMdGroupResultByID(id string) (models.GroupResult, error) { + logger, _ := zap.NewProduction() + + var data models.GroupResult + err := dbx.Handlex.Get(&data, `SELECT + Group_ResultID, + Group_ResultName, + CASE + WHEN Group_ResultFlagPerTest = 'Y' THEN 'on' + ELSE Group_ResultFlagPerTest + END AS Group_ResultFlagPerTest, + CASE + WHEN Group_ResultFlagNonLab = 'Y' THEN 'on' + ELSE Group_ResultFlagNonLab + END AS Group_ResultFlagNonLab, + Group_ResultResumeMcu, + Group_ResultIsActive + FROM group_result + WHERE Group_ResultID = ?`, id) + + if err != nil { + defer logger.Sync() + logger.Error("Error get data gr by id vs", + zap.String("ID", id), + zap.Error(err), + ) + return data, fmt.Errorf("QUERY_FAILED") + } + return data, nil +} + +// ADD DATA +func (ug *ServicesMdGroupResult) AddMdGroupResult(groupresultname string, groupresultflagpertest string, groupresultflagnonlab string, groupresultresumemcu string) (models.GroupResult, error) { + logger, _ := zap.NewProduction() + var data models.GroupResult + var datacek []models.GroupResult + // var groupresultflagpertestConvert string = "" + // var groupresultflagnonlabConvert string = "" + // var groupresultresumemcuConvert string = "" + + prm := "%" + strings.TrimSpace(groupresultname) + "%" + qryCek := `SELECT Group_ResultName FROM group_result WHERE Group_ResultName LIKE ? AND Group_ResultIsActive = 'Y'` + err := dbx.Handlex.Select(&datacek, qryCek, prm) + + if err != nil { + defer logger.Sync() + logger.Error("Error cek data by groupresultname", + zap.String("groupresultname", groupresultname), + zap.Any("datacek", datacek), + ) + return data, fmt.Errorf("QUERY_FAILED") + } + if len(datacek) > 0 { + defer logger.Sync() + logger.Error("Group Result Name already taken by another data", + zap.String("groupresultname", groupresultname), + ) + return data, fmt.Errorf("group result name sudah dipakai") + } + qry := `INSERT INTO group_result + ( + Group_ResultName, + Group_ResultFlagPerTest, + Group_ResultFlagNonLab, + Group_ResultResumeMcu + ) + VALUES ( + ?, + ?, + ?, + ? + );` + // time.Sleep(5 * time.Second) + rst := dbx.Handlex.MustExec(qry, groupresultname, groupresultflagpertest, groupresultflagnonlab, groupresultresumemcu) + insertedID, err := rst.LastInsertId() + if err != nil { + defer logger.Sync() + logger.Error("Error Insert group result", + zap.Any("groupresultname", groupresultname), + zap.Any("groupresultflagpertest", groupresultflagpertest), + zap.Any("groupresultflagnonlab", groupresultflagnonlab), + zap.Any("groupresultresumemcu", groupresultresumemcu), + ) + return data, fmt.Errorf("QUERY_FAILED") + } + s := strconv.Itoa(int(insertedID)) + data, err = ug.GetMdGroupResultByID(s) + if err != nil { + defer logger.Sync() + logger.Error("Error get usergroup by id", + zap.Any("groupresultname", groupresultname), + zap.Any("groupresultflagpertest", groupresultflagpertest), + zap.Any("groupresultflagnonlab", groupresultflagnonlab), + zap.Any("groupresultresumemcu", groupresultresumemcu), + ) + return data, fmt.Errorf("QUERY_FAILED") + } + return data, nil +} + +// EDIT DATA +func (ug *ServicesMdGroupResult) EditMdGroupResult(id string, groupresultname string, groupresultflagpertest string, groupresultflagnonlab string, groupresultresumemcu string) (models.GroupResult, error) { + logger, _ := zap.NewProduction() + var data models.GroupResult + var datacek []models.GroupResult + + prm := "%" + strings.TrimSpace(groupresultname) + "%" + qryCek := `SELECT Group_ResultName FROM group_result WHERE Group_ResultName LIKE ? AND Group_ResultIsActive = 'Y' AND Group_ResultID <> ?` + err := dbx.Handlex.Select(&datacek, qryCek, prm, id) + + if err != nil { + defer logger.Sync() + logger.Error("Error cek data by code", + zap.String("groupresultname", groupresultname), + zap.Any("datacek", datacek), + ) + return data, fmt.Errorf("QUERY_FAILED") + } + if len(datacek) > 0 { + defer logger.Sync() + logger.Error("Code already taken by another data", + zap.String("groupresultname", groupresultname), + ) + return data, fmt.Errorf("group result name sudah dipakai") + } + + qry := `UPDATE group_result + SET Group_ResultName = ?, + Group_ResultFlagPerTest = ?, + Group_ResultFlagNonLab = ?, + Group_ResultResumeMcu = ? + WHERE Group_ResultID = ?` + // time.Sleep(5 * time.Second) + rst := dbx.Handlex.MustExec(qry, groupresultname, groupresultflagpertest, groupresultflagnonlab, groupresultresumemcu, id) + _, err = rst.RowsAffected() + if err != nil { + defer logger.Sync() + logger.Error("Error Update group result", + zap.Any("groupresultname", groupresultname), + zap.Any("groupresultflagpertest", groupresultflagpertest), + zap.Any("groupresultflagnonlab", groupresultflagnonlab), + zap.Any("groupresultresumemcu", groupresultresumemcu), + ) + return data, fmt.Errorf("QUERY_FAILED") + } + + data, err = ug.GetMdGroupResultByID(id) + if err != nil { + defer logger.Sync() + logger.Error("Error get group result by id", + zap.Any("groupresultname", groupresultname), + zap.Any("groupresultflagpertest", groupresultflagpertest), + zap.Any("groupresultflagnonlab", groupresultflagnonlab), + zap.Any("groupresultresumemcu", groupresultresumemcu), + ) + return data, fmt.Errorf("QUERY_FAILED") + } + return data, nil +} + +// DELETE DATA +func (ug *ServicesMdGroupResult) DeleteMdGroupResult(id string) (models.GroupResult, error) { + logger, _ := zap.NewProduction() + var data models.GroupResult + qry := `UPDATE group_result + SET Group_ResultIsActive = 'N' + WHERE Group_ResultID = ?;` + // time.Sleep(5 * time.Second) + rst := dbx.Handlex.MustExec(qry, id) + _, err := rst.RowsAffected() + if err != nil { + defer logger.Sync() + logger.Error("Error delete group result", + zap.String("id", id), + ) + return data, fmt.Errorf("QUERY_FAILED") + } + + data, err = ug.GetMdGroupResultByID(id) + if err != nil { + defer logger.Sync() + logger.Error("Error get group result by id", + zap.String("id", id), + ) + return data, fmt.Errorf("QUERY_FAILED") + } + return data, nil +} diff --git a/views/dev/mdgroupresult/mdgroupresult.templ b/views/dev/mdgroupresult/mdgroupresult.templ new file mode 100644 index 0000000..2e0620c --- /dev/null +++ b/views/dev/mdgroupresult/mdgroupresult.templ @@ -0,0 +1,237 @@ +package dev_mdgroupresultview + +import ( + "cpone/layout" + "cpone/component/customtextfield" + "cpone/models" + "strconv" +) + +templ MdGroupResultScreen( + tableID string, + paginationID string, + searchID string, + dialogAddID string, + dialogAddBodyID string, + dialogEditID string, + dialogEditBodyID string, + dialogDeleteID string, + dialogDeleteBodyID string, + breadcrumb templ.Component, + tablecontent templ.Component, + filterComponent templ.Component, + paginationComponent templ.Component, + modalAddForm templ.Component, + modalEditForm templ.Component, + modalDeleteForm templ.Component) { +
    + @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID", + Name: "tableID", + Type: "hidden", + Value: tableID}) + @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID", + Name: "paginationID", + Type: "hidden", + Value: paginationID}) + @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "searchID", + Name: "searchID", + Type: "hidden", + Value: searchID}) + @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddID", + Name: "dialogAddID", + Type: "hidden", + Value: dialogAddID}) + @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddBodyID", + Name: "dialogAddBodyID", + Type: "hidden", + Value: dialogAddBodyID}) + @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditID", + Name: "dialogEditID", + Type: "hidden", + Value: dialogEditID}) + @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditBodyID", + Name: "dialogEditBodyID", + Type: "hidden", + Value: dialogEditBodyID}) + @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteID", + Name: "dialogDeleteID", + Type: "hidden", + Value: dialogDeleteID}) + @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteBodyID", + Name: "dialogDeleteBodyID", + Type: "hidden", + Value: dialogDeleteBodyID}) +
    +
    + @breadcrumb +
    +
    + //
    +
    + +
    +
    +
    + +
    +
    + @filterComponent +
    + @tablecontent + @paginationComponent + @modalAddForm + @modalEditForm + @modalDeleteForm +
    + //
    +
    + Loading... +
    +
    +
    +
    +
    +} + +// for item dropdown +templ ItemDropdown(dataDropdown []models.GroupResultResumeMcu, selectedId int) { + if len(dataDropdown) == 0 { + + } else { + for _, v := range dataDropdown { + if (selectedId == v.ID) { + + } else { + + } + } + } +} + +// for empty div +templ EmptyDiv1() { +
    +} + +templ CssMdGroupResult() { + + + + +} + +templ JsMdGroupResult() { + +} + +script BeforeRequestContentMdGroupResult() { + const loadingParent = document.getElementById("loading-parent"); + const loadingChild = document.getElementById("loading-child"); + const loadingSpinner = document.getElementById("loading-spinner"); + + loadingParent.classList.add("overlay"); + loadingParent.classList.add("overlay-block"); + loadingChild.classList.add("overlay-layer"); + loadingSpinner.classList.remove("d-none"); +} + +script AfterRequestContentMdGroupResult() { + const loadingParent = document.getElementById("loading-parent"); + const loadingChild = document.getElementById("loading-child"); + const loadingSpinner = document.getElementById("loading-spinner"); + + loadingParent.classList.remove("overlay"); + loadingParent.classList.remove("overlay-block"); + loadingChild.classList.remove("overlay-layer"); + loadingSpinner.classList.add("d-none"); +} + +templ ShowMdGroupResultScreen(title string, cmp templ.Component, css templ.Component, js templ.Component, + navbarmenu templ.Component, + navbaruser templ.Component, + userprofile templ.Component) { + @layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile) { + @cmp + } +} diff --git a/views/dev/mdgroupresult/mdgroupresult_templ.go b/views/dev/mdgroupresult/mdgroupresult_templ.go new file mode 100644 index 0000000..64e84d6 --- /dev/null +++ b/views/dev/mdgroupresult/mdgroupresult_templ.go @@ -0,0 +1,433 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package dev_mdgroupresultview + +//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/customtextfield" + "cpone/layout" + "cpone/models" + "strconv" +) + +func MdGroupResultScreen( + tableID string, + paginationID string, + searchID string, + dialogAddID string, + dialogAddBodyID string, + dialogEditID string, + dialogEditBodyID string, + dialogDeleteID string, + dialogDeleteBodyID string, + breadcrumb templ.Component, + tablecontent templ.Component, + filterComponent templ.Component, + paginationComponent templ.Component, + modalAddForm templ.Component, + modalEditForm templ.Component, + modalDeleteForm 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 = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID", + Name: "tableID", + Type: "hidden", + Value: tableID}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID", + Name: "paginationID", + Type: "hidden", + Value: paginationID}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "searchID", + Name: "searchID", + Type: "hidden", + Value: searchID}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddID", + Name: "dialogAddID", + Type: "hidden", + Value: dialogAddID}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddBodyID", + Name: "dialogAddBodyID", + Type: "hidden", + Value: dialogAddBodyID}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditID", + Name: "dialogEditID", + Type: "hidden", + Value: dialogEditID}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditBodyID", + Name: "dialogEditBodyID", + Type: "hidden", + Value: dialogEditBodyID}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteID", + Name: "dialogDeleteID", + Type: "hidden", + Value: dialogDeleteID}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteBodyID", + Name: "dialogDeleteBodyID", + Type: "hidden", + Value: dialogDeleteBodyID}).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 = 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 = filterComponent.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 = tablecontent.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = paginationComponent.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = modalAddForm.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = modalEditForm.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = modalDeleteForm.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 + }) +} + +// for item dropdown +func ItemDropdown(dataDropdown []models.GroupResultResumeMcu, selectedId int) 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) + if len(dataDropdown) == 0 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + for _, v := range dataDropdown { + if selectedId == v.ID { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, 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 + }) +} + +// for empty div +func EmptyDiv1() 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_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = 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 CssMdGroupResult() 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_Var10 := templ.GetChildren(ctx) + if templ_7745c5c3_Var10 == nil { + templ_7745c5c3_Var10 = 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 JsMdGroupResult() 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_Var11 := templ.GetChildren(ctx) + if templ_7745c5c3_Var11 == nil { + templ_7745c5c3_Var11 = 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 BeforeRequestContentMdGroupResult() templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_BeforeRequestContentMdGroupResult_911f`, + Function: `function __templ_BeforeRequestContentMdGroupResult_911f(){const loadingParent = document.getElementById("loading-parent"); + const loadingChild = document.getElementById("loading-child"); + const loadingSpinner = document.getElementById("loading-spinner"); + + loadingParent.classList.add("overlay"); + loadingParent.classList.add("overlay-block"); + loadingChild.classList.add("overlay-layer"); + loadingSpinner.classList.remove("d-none"); +}`, + Call: templ.SafeScript(`__templ_BeforeRequestContentMdGroupResult_911f`), + CallInline: templ.SafeScriptInline(`__templ_BeforeRequestContentMdGroupResult_911f`), + } +} + +func AfterRequestContentMdGroupResult() templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_AfterRequestContentMdGroupResult_6cc0`, + Function: `function __templ_AfterRequestContentMdGroupResult_6cc0(){const loadingParent = document.getElementById("loading-parent"); + const loadingChild = document.getElementById("loading-child"); + const loadingSpinner = document.getElementById("loading-spinner"); + + loadingParent.classList.remove("overlay"); + loadingParent.classList.remove("overlay-block"); + loadingChild.classList.remove("overlay-layer"); + loadingSpinner.classList.add("d-none"); +}`, + Call: templ.SafeScript(`__templ_AfterRequestContentMdGroupResult_6cc0`), + CallInline: templ.SafeScriptInline(`__templ_AfterRequestContentMdGroupResult_6cc0`), + } +} + +func ShowMdGroupResultScreen(title string, cmp templ.Component, css templ.Component, js templ.Component, + navbarmenu 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_Var12 := templ.GetChildren(ctx) + if templ_7745c5c3_Var12 == nil { + templ_7745c5c3_Var12 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Var13 := 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.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var13), 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/dev/mdgroupresult/mdgroupresultformmodal.templ b/views/dev/mdgroupresult/mdgroupresultformmodal.templ new file mode 100644 index 0000000..b510d6f --- /dev/null +++ b/views/dev/mdgroupresult/mdgroupresultformmodal.templ @@ -0,0 +1,203 @@ +package dev_mdgroupresultview + +import "cpone/models" +import "cpone/component/modal" +import "cpone/component/customtextfield" +import "cpone/component/customcheckbox" +import "cpone/component/customdropdown" + +templ GroupResultForm(data models.GroupResultFormComponent) { +
    +
    + @modalcomponent.Modal(data.ModalID, + data.ModalTitle, + data.DialogBody, + data.DialogAction, + data.ButtonCLose) +
    +
    +} + +script HandleFormBeforeRequest() { + console.log("handle disable btn add"); + const btnActCancel = document.querySelectorAll('.btnactcancel'); + const btnactsavedata = document.querySelectorAll('.btnactsavedata'); + + for (let i = 0; i < btnActCancel.length; i++) { + btnActCancel[i].setAttribute('disabled', 'true'); + + } + for (let i = 0; i < btnactsavedata.length; i++) { + btnactsavedata[i].setAttribute('disabled', 'true'); + + } +} + +script HandleFormAfterRequest() { + console.log("handle enable btn add"); + + const btnactcancel = document.querySelectorAll('.btnactcancel'); + const btnactsavedata = document.querySelectorAll('.btnactsavedata'); + + + for (let i = 0; i < btnactcancel.length; i++) { + btnactcancel[i].removeAttribute('disabled'); + + } + for (let i = 0; i < btnactsavedata.length; i++) { + btnactsavedata[i].removeAttribute('disabled'); + + } +} + +templ BodyFormGroupResult(inputId models.CustomTextFieldv2Prm, + inputGrName models.CustomTextFieldv2Prm, + checkboxGrFlagPerTest models.CustomCheckboxv1Prm, + checkboxGrFlagNonLab models.CustomCheckboxv1Prm, + dropdownGrResumeMcu models.CustomDropdownv1Prm, + listItem templ.Component, + componentID string, + hxOnLoad templ.ComponentScript) { +
    + @customtextfield.CustomTextFieldv2( + inputId) + @customtextfield.CustomTextFieldv2( + inputGrName) + @customcheckbox.MainCustomCheckboxInput( + checkboxGrFlagPerTest) + @customcheckbox.MainCustomCheckboxInput( + checkboxGrFlagNonLab) + @customdropdown.MainCustomDropdownInput( + dropdownGrResumeMcu, + listItem) +
    + +} + +script JsHideModalGroupResult(modalID string) { + $(modalID).modal('hide') +} + +script JsShowModalGroupResult(modalID string) { + $(modalID).modal('show') + const btnactcancel = document.querySelectorAll('.btnactcancel'); + const btnactsavedata = document.querySelectorAll('.btnactsavedata'); + + + for (let i = 0; i < btnactcancel.length; i++) { + btnactcancel[i].removeAttribute('disabled'); + + } + for (let i = 0; i < btnactsavedata.length; i++) { + btnactsavedata[i].removeAttribute('disabled'); + + } +} + +templ ActionFormGroupResult(LinkClose string, targetClose string, hxSwapClose string, modalID string) { +
    + + +
    +} + +templ BtnCloseFormGroupResult(LinkClose string, targetClose string, hxSwapClose string, modalID string) { + +} + +templ DeleteConfirmationBodyGroupResult(inputId models.CustomTextFieldv2Prm, + componentID string, + message string, + datHeader []string, + dataText []string, + hxOnLoad templ.ComponentScript) { +
    +

    { message }

    +
    +
    +
    + for _, v := range datHeader { +
    { v }
    + } +
    +
    + for _, v := range dataText { +
    + { v } +
    + } +
    +
    +
    + @customtextfield.CustomTextFieldv2(inputId) +
    +} + +templ ActionFormGroupResultDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) { +
    + + +
    +} diff --git a/views/dev/mdgroupresult/mdgroupresultformmodal_templ.go b/views/dev/mdgroupresult/mdgroupresultformmodal_templ.go new file mode 100644 index 0000000..5e68db2 --- /dev/null +++ b/views/dev/mdgroupresult/mdgroupresultformmodal_templ.go @@ -0,0 +1,665 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package dev_mdgroupresultview + +//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/models" +import "cpone/component/modal" +import "cpone/component/customtextfield" +import "cpone/component/customcheckbox" +import "cpone/component/customdropdown" + +func GroupResultForm(data models.GroupResultFormComponent) 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 = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleFormBeforeRequest(), HandleFormAfterRequest()) + 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 = modalcomponent.Modal(data.ModalID, + data.ModalTitle, + data.DialogBody, + data.DialogAction, + data.ButtonCLose).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 HandleFormBeforeRequest() templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_HandleFormBeforeRequest_2922`, + Function: `function __templ_HandleFormBeforeRequest_2922(){console.log("handle disable btn add"); + const btnActCancel = document.querySelectorAll('.btnactcancel'); + const btnactsavedata = document.querySelectorAll('.btnactsavedata'); + + for (let i = 0; i < btnActCancel.length; i++) { + btnActCancel[i].setAttribute('disabled', 'true'); + + } + for (let i = 0; i < btnactsavedata.length; i++) { + btnactsavedata[i].setAttribute('disabled', 'true'); + + } +}`, + Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_2922`), + CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_2922`), + } +} + +func HandleFormAfterRequest() templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_HandleFormAfterRequest_956b`, + Function: `function __templ_HandleFormAfterRequest_956b(){console.log("handle enable btn add"); + + const btnactcancel = document.querySelectorAll('.btnactcancel'); + const btnactsavedata = document.querySelectorAll('.btnactsavedata'); + + + for (let i = 0; i < btnactcancel.length; i++) { + btnactcancel[i].removeAttribute('disabled'); + + } + for (let i = 0; i < btnactsavedata.length; i++) { + btnactsavedata[i].removeAttribute('disabled'); + + } +}`, + Call: templ.SafeScript(`__templ_HandleFormAfterRequest_956b`), + CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_956b`), + } +} + +func BodyFormGroupResult(inputId models.CustomTextFieldv2Prm, + inputGrName models.CustomTextFieldv2Prm, + checkboxGrFlagPerTest models.CustomCheckboxv1Prm, + checkboxGrFlagNonLab models.CustomCheckboxv1Prm, + dropdownGrResumeMcu models.CustomDropdownv1Prm, + listItem templ.Component, + componentID string, + hxOnLoad templ.ComponentScript) 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_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxOnLoad) + 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 = customtextfield.CustomTextFieldv2( + inputId).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2( + inputGrName).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customcheckbox.MainCustomCheckboxInput( + checkboxGrFlagPerTest).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customcheckbox.MainCustomCheckboxInput( + checkboxGrFlagNonLab).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customdropdown.MainCustomDropdownInput( + dropdownGrResumeMcu, + listItem).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 JsHideModalGroupResult(modalID string) templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_JsHideModalGroupResult_da6c`, + Function: `function __templ_JsHideModalGroupResult_da6c(modalID){$(modalID).modal('hide') +}`, + Call: templ.SafeScript(`__templ_JsHideModalGroupResult_da6c`, modalID), + CallInline: templ.SafeScriptInline(`__templ_JsHideModalGroupResult_da6c`, modalID), + } +} + +func JsShowModalGroupResult(modalID string) templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_JsShowModalGroupResult_b74d`, + Function: `function __templ_JsShowModalGroupResult_b74d(modalID){$(modalID).modal('show') + const btnactcancel = document.querySelectorAll('.btnactcancel'); + const btnactsavedata = document.querySelectorAll('.btnactsavedata'); + + + for (let i = 0; i < btnactcancel.length; i++) { + btnactcancel[i].removeAttribute('disabled'); + + } + for (let i = 0; i < btnactsavedata.length; i++) { + btnactsavedata[i].removeAttribute('disabled'); + + } +}`, + Call: templ.SafeScript(`__templ_JsShowModalGroupResult_b74d`, modalID), + CallInline: templ.SafeScriptInline(`__templ_JsShowModalGroupResult_b74d`, modalID), + } +} + +func ActionFormGroupResult(LinkClose string, targetClose string, hxSwapClose string, modalID string) 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_Var12 := templ.GetChildren(ctx) + if templ_7745c5c3_Var12 == nil { + templ_7745c5c3_Var12 = 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 = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModalGroupResult(modalID)) + 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 BtnCloseFormGroupResult(LinkClose string, targetClose string, hxSwapClose string, modalID string) 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_Var17 := templ.GetChildren(ctx) + if templ_7745c5c3_Var17 == nil { + templ_7745c5c3_Var17 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModalGroupResult(modalID)) + 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 DeleteConfirmationBodyGroupResult(inputId models.CustomTextFieldv2Prm, + componentID string, + message string, + datHeader []string, + dataText []string, + hxOnLoad templ.ComponentScript) 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_Var22 := templ.GetChildren(ctx) + if templ_7745c5c3_Var22 == nil { + templ_7745c5c3_Var22 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxOnLoad) + 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 + } + var templ_7745c5c3_Var25 string + templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(message) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 159, Col: 14} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) + 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 + } + for _, v := range datHeader { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var26 string + templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(v) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 164, Col: 68} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26)) + 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 = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, v := range dataText { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var27 string + templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(v) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 170, Col: 10} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) + 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 = templ_7745c5c3_Buffer.WriteString("
    ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputId).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 ActionFormGroupResultDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) 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_Var28 := templ.GetChildren(ctx) + if templ_7745c5c3_Var28 == nil { + templ_7745c5c3_Var28 = 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 = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModalGroupResult(modalID)) + 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 + }) +} diff --git a/views/dev/mdgroupresult/mdgroupresulttable.templ b/views/dev/mdgroupresult/mdgroupresulttable.templ new file mode 100644 index 0000000..b5d3f48 --- /dev/null +++ b/views/dev/mdgroupresult/mdgroupresulttable.templ @@ -0,0 +1,131 @@ +package dev_mdgroupresultview + +import "cpone/component/table" +import "cpone/models" +import "strconv" + +templ TableGroupResult(data []models.GroupResult, + tableID string, + hxGetEdit string, + hxTargetEdit string, + hxSwapEdit string, + hxIncludeEdit string, + hxGetDelete string, + hxTargetDelete string, + hxSwapDelete string, + hxIncludeDelete string, +) { +
    + @tablecomponent.TableV3([]string{"GROUP RESULT NAME", "RESULT FLAG PER TEST", "RESULT FLAG NON LAB", "RESULT RESUME MCU", "AKSI"}, + []string{"20%", "20%", "20%", "20%", "20%"}, + RowGroupResult(data, + hxGetEdit, + hxTargetEdit, + hxSwapEdit, + hxIncludeEdit, + hxGetDelete, + hxTargetDelete, + hxSwapDelete, + hxIncludeDelete, + )) +
    +} + +templ RowGroupResult(data []models.GroupResult, + hxGetEdit string, + hxTargetEdit string, + hxSwapEdit string, + hxIncludeEdit string, + hxGetDelete string, + hxTargetDelete string, + hxSwapDelete string, + hxIncludeDelete string, +) { + if len(data) == 0 { + + Data Tidak Ditemukan + + } + for _, v := range data { + + { v.Group_ResultName } + { v.Group_ResultFlagPerTest } + { v.Group_ResultFlagNonLab } + { v.Group_ResultResumeMcu } + + @TableAction(v.Group_ResultID, + hxGetEdit, + hxTargetEdit, + hxSwapEdit, + hxIncludeEdit, + hxGetDelete, + hxTargetDelete, + hxSwapDelete, + hxIncludeDelete, + ) + + + } +} + +templ TableAction( + id int, + hxGetEdit string, + hxTargetEdit string, + hxSwapEdit string, + hxIncludeEdit string, + hxGetDelete string, + hxTargetDelete string, + hxSwapDelete string, + hxIncludeDelete string, + +) { + +} + +script HandleBeforeRequestRow(id string) { + var cusid_ele = document.getElementsByClassName('btnactiongr'); + for (var i = 0; i < cusid_ele.length; ++i) { + var item = cusid_ele[i]; + item.classList.add('disabled'); + } + console.log(id) +} + +script HandleAfterRequestRow(id string) { + var cusid_ele = document.getElementsByClassName('btnactiongr'); + for (var i = 0; i < cusid_ele.length; ++i) { + var item = cusid_ele[i]; + item.classList.remove('disabled'); + } + console.log(id) +} diff --git a/views/dev/mdgroupresult/mdgroupresulttable_templ.go b/views/dev/mdgroupresult/mdgroupresulttable_templ.go new file mode 100644 index 0000000..3e7ba7e --- /dev/null +++ b/views/dev/mdgroupresult/mdgroupresulttable_templ.go @@ -0,0 +1,464 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package dev_mdgroupresultview + +//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/table" +import "cpone/models" +import "strconv" + +func TableGroupResult(data []models.GroupResult, + tableID string, + hxGetEdit string, + hxTargetEdit string, + hxSwapEdit string, + hxIncludeEdit string, + hxGetDelete string, + hxTargetDelete string, + hxSwapDelete string, + hxIncludeDelete string, +) 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 = tablecomponent.TableV3([]string{"GROUP RESULT NAME", "RESULT FLAG PER TEST", "RESULT FLAG NON LAB", "RESULT RESUME MCU", "AKSI"}, + []string{"20%", "20%", "20%", "20%", "20%"}, + RowGroupResult(data, + hxGetEdit, + hxTargetEdit, + hxSwapEdit, + hxIncludeEdit, + hxGetDelete, + hxTargetDelete, + hxSwapDelete, + hxIncludeDelete, + )).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 RowGroupResult(data []models.GroupResult, + hxGetEdit string, + hxTargetEdit string, + hxSwapEdit string, + hxIncludeEdit string, + hxGetDelete string, + hxTargetDelete string, + hxSwapDelete string, + hxIncludeDelete string, +) 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 len(data) == 0 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Data Tidak Ditemukan") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + for _, v := range data { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(v.Group_ResultName) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 51, Col: 27} + } + _, 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 + } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v.Group_ResultFlagPerTest) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 52, Col: 34} + } + _, 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("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.Group_ResultFlagNonLab) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 53, Col: 33} + } + _, 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 + } + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(v.Group_ResultResumeMcu) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 54, Col: 32} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + 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 = TableAction(v.Group_ResultID, + hxGetEdit, + hxTargetEdit, + hxSwapEdit, + hxIncludeEdit, + hxGetDelete, + hxTargetDelete, + hxSwapDelete, + hxIncludeDelete, + ).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 TableAction( + id int, + hxGetEdit string, + hxTargetEdit string, + hxSwapEdit string, + hxIncludeEdit string, + hxGetDelete string, + hxTargetDelete string, + hxSwapDelete string, + hxIncludeDelete string, + +) 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_Var8 := templ.GetChildren(ctx) + if templ_7745c5c3_Var8 == nil { + templ_7745c5c3_Var8 = 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 = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleBeforeRequestRow(strconv.Itoa(id)), HandleAfterRequestRow(strconv.Itoa(id))) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" Edit\r ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleBeforeRequestRow(strconv.Itoa(id)), HandleAfterRequestRow(strconv.Itoa(id))) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" Hapus\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 HandleBeforeRequestRow(id string) templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_HandleBeforeRequestRow_8869`, + Function: `function __templ_HandleBeforeRequestRow_8869(id){var cusid_ele = document.getElementsByClassName('btnactiongr'); + for (var i = 0; i < cusid_ele.length; ++i) { + var item = cusid_ele[i]; + item.classList.add('disabled'); + } + console.log(id) +}`, + Call: templ.SafeScript(`__templ_HandleBeforeRequestRow_8869`, id), + CallInline: templ.SafeScriptInline(`__templ_HandleBeforeRequestRow_8869`, id), + } +} + +func HandleAfterRequestRow(id string) templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_HandleAfterRequestRow_ef01`, + Function: `function __templ_HandleAfterRequestRow_ef01(id){var cusid_ele = document.getElementsByClassName('btnactiongr'); + for (var i = 0; i < cusid_ele.length; ++i) { + var item = cusid_ele[i]; + item.classList.remove('disabled'); + } + console.log(id) +}`, + Call: templ.SafeScript(`__templ_HandleAfterRequestRow_ef01`, id), + CallInline: templ.SafeScriptInline(`__templ_HandleAfterRequestRow_ef01`, id), + } +}