diff --git a/component/table/tablev3.templ b/component/table/tablev3.templ index 432eb50..2182cf8 100644 --- a/component/table/tablev3.templ +++ b/component/table/tablev3.templ @@ -10,7 +10,11 @@ templ TableV3(thName []string, thWidth []string, trComponent templ.Component) { for i, item := range thName { - { item } + if item == "AKSI" { + { item } + } else { + { item } + } } diff --git a/component/table/tablev3_templ.go b/component/table/tablev3_templ.go index 80090b7..636ba48 100644 --- a/component/table/tablev3_templ.go +++ b/component/table/tablev3_templ.go @@ -38,35 +38,68 @@ func TableV3(thName []string, thWidth []string, trComponent templ.Component) tem 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 - } - 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: `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 + if item == "AKSI" { + _, 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: `component\table\tablev3.templ`, Line: 14, Col: 71} + } + _, 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 + } + } else { + _, 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(item) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 16, Col: 51} + } + _, 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(" ") @@ -101,9 +134,9 @@ func DivEmptyV3() templ.Component { 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 + templ_7745c5c3_Var6 := templ.GetChildren(ctx) + if templ_7745c5c3_Var6 == nil { + templ_7745c5c3_Var6 = templ.NopComponent } ctx = templ.ClearChildren(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") diff --git a/handlers/corporate/mcudetail/tabdaftarpeserta.handlers.go b/handlers/corporate/mcudetail/tabdaftarpeserta.handlers.go index 37e439d..7ea25c8 100644 --- a/handlers/corporate/mcudetail/tabdaftarpeserta.handlers.go +++ b/handlers/corporate/mcudetail/tabdaftarpeserta.handlers.go @@ -23,7 +23,10 @@ func NewTabDaftarPesertaHandlers(tdp TabDaftarPesertaServices) *TabDaftarPeserta func (tdp *TabDaftarPesertaHandlers) HandleShowTabDaftarPeserta(c echo.Context) error { title := "Daftar Peserta" - content := corporate_mcudetail.TabDaftarPesertaScreen() + data := []string{"Ananda Mara", "Nanda Arisu"} + table := corporate_mcudetail.TableDaftarPeserta(data, "sas012") + + content := corporate_mcudetail.TabDaftarPesertaScreen(table) css := corporate_mcudetail.CSSTabDaftarPeserta() js := corporate_mcudetail.JsTabDaftarPeserta() diff --git a/views/corporate/mcu/mcutab/modaldaftarpeserta.templ b/views/corporate/mcu/mcutab/modaldaftarpeserta.templ new file mode 100644 index 0000000..5102abe --- /dev/null +++ b/views/corporate/mcu/mcutab/modaldaftarpeserta.templ @@ -0,0 +1,7 @@ +package corporate_mcudetail + +templ ModalDaftarPeserta() { +
+ +
+} \ No newline at end of file diff --git a/views/corporate/mcu/mcutab/tabdaftarpeserta.templ b/views/corporate/mcu/mcutab/tabdaftarpeserta.templ index 3fe7851..9917059 100644 --- a/views/corporate/mcu/mcutab/tabdaftarpeserta.templ +++ b/views/corporate/mcu/mcutab/tabdaftarpeserta.templ @@ -2,115 +2,14 @@ package corporate_mcudetail import "cpone/layout" -templ TabDaftarPesertaScreen() { -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NO LABNAMAJENIS KELAMINUMURKESIMPULANAKSI
21304Abraham KurniawanLaki - Laki24 -
-
- Fit - -
-
-
-
- -
21305Anastasia ClaudiaPerempuan24 -
-
- Unfit - -
-
- Anti HBs (Positif : 752), Cholesterol sedikit meningkat - (218), LDL Cholesterol Direct meningkat (173) -
-
-
- -
+templ TabDaftarPesertaScreen( + tablecomponent templ.Component, +) { +
+
+

Daftar Peserta

+
+ @tablecomponent
} diff --git a/views/corporate/mcu/mcutab/tabdaftarpeserta_templ.go b/views/corporate/mcu/mcutab/tabdaftarpeserta_templ.go index 6d592fc..c5f2f6a 100644 --- a/views/corporate/mcu/mcutab/tabdaftarpeserta_templ.go +++ b/views/corporate/mcu/mcutab/tabdaftarpeserta_templ.go @@ -12,7 +12,9 @@ import "bytes" import "cpone/layout" -func TabDaftarPesertaScreen() templ.Component { +func TabDaftarPesertaScreen( + tablecomponent 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 { @@ -25,7 +27,15 @@ func TabDaftarPesertaScreen() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
NO LABNAMAJENIS KELAMINUMURKESIMPULANAKSI
21304Abraham KurniawanLaki - Laki24
Fit
21305Anastasia ClaudiaPerempuan24
Unfit
Anti HBs (Positif : 752), Cholesterol sedikit meningkat\r (218), LDL Cholesterol Direct meningkat (173)\r
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Daftar Peserta

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = tablecomponent.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 } diff --git a/views/corporate/mcu/mcutab/tabledaftarpeserta.templ b/views/corporate/mcu/mcutab/tabledaftarpeserta.templ new file mode 100644 index 0000000..30bd0db --- /dev/null +++ b/views/corporate/mcu/mcutab/tabledaftarpeserta.templ @@ -0,0 +1,69 @@ +package corporate_mcudetail + +import "cpone/component/table" + +templ TableDaftarPeserta( + data []string, + tableID string, +) { +
+ @tablecomponent.TableV3([]string{"NOLAB", "NAMA", "JENIS KELAMIN", "UMUR", "KESIMPULAN", "AKSI"}, + []string{"10%","20%","10%","10%","30%","20%"}, + ItemRow(data)) +
+} + +templ ItemRow(data []string) { + if len(data) == 0 { + + Data Tidak Ditemukan + + } + for _, v := range data { + + 123123 + { v } + Perempuan + 24 + +
+
+ if v == "Nanda Arisu" { + Unfit + } else { + Fit + } +
+
+ Lorem Ipsum In Dolor Ad Sasum Mara Naka Adhum In Horem +
+
+ + + @ItemAction("1") + + + } +} + +templ ItemAction( + id string, +) { +
+ + + + + + + + + +
+} \ No newline at end of file diff --git a/views/corporate/mcu/mcutab/tabledaftarpeserta_templ.go b/views/corporate/mcu/mcutab/tabledaftarpeserta_templ.go new file mode 100644 index 0000000..a14511f --- /dev/null +++ b/views/corporate/mcu/mcutab/tabledaftarpeserta_templ.go @@ -0,0 +1,157 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package corporate_mcudetail + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import "cpone/component/table" + +func TableDaftarPeserta( + data []string, + tableID 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{"NOLAB", "NAMA", "JENIS KELAMIN", "UMUR", "KESIMPULAN", "AKSI"}, + []string{"10%", "20%", "10%", "10%", "30%", "20%"}, + ItemRow(data)).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 ItemRow(data []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("123123") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(v) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 25, Col: 19} + } + _, 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("Perempuan24
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if v == "Nanda Arisu" { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Unfit") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Fit") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Lorem Ipsum In Dolor Ad Sasum Mara Naka Adhum In Horem\r
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = ItemAction("1").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 ItemAction( + id 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_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 + }) +}