feature delete kelainan
This commit is contained in:
@@ -26,6 +26,7 @@ type MasterKelainanService interface {
|
||||
GetKelainanByID(id string) (models.Kelainan, error)
|
||||
AddKelainan(name string) (models.Kelainan, error)
|
||||
EditKelainan(id string, name string) (models.Kelainan, error)
|
||||
DeleteKelainan(id string) (models.Kelainan, error)
|
||||
}
|
||||
|
||||
func NewMasterKelainanHandler(us MasterKelainanService) *MasterKelainanHandler {
|
||||
@@ -88,8 +89,8 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
dialogAddBodyID := utils.GenerateRandomID("dialogaddbodyID")
|
||||
dialogEditID := utils.GenerateRandomID("dialogEditID")
|
||||
dialogEditBodyID := utils.GenerateRandomID("dialogEditBodyID")
|
||||
// dialogdeleteID := utils.GenerateRandomID("dialogdeleteID")
|
||||
// dialogdeleteBodyID := utils.GenerateRandomID("dialogdeleteBodyID")
|
||||
dialogDeleteID := utils.GenerateRandomID("dialogDeleteID")
|
||||
dialogDeleteBodyID := utils.GenerateRandomID("dialogDeletebodyID")
|
||||
|
||||
title := "Master Kelainan"
|
||||
|
||||
@@ -150,7 +151,7 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
Link: "/dev/kelainan/add",
|
||||
HxTarget: "#" + dialogAddBodyID,
|
||||
HxSwap: "outerHTML",
|
||||
HxInclude: "#tableID, #paginationID, #searchID, #dialogAddBodyID, #dialogAddID, #dialogDeleteBodyID, #dialogDeleteID, #dialogEditBodyID, #dialogEditID, #" + searchID + ", #currpage" + paginationID,
|
||||
HxInclude: "#tableID, #paginationID, #searchID, #dialogAddBodyID, #dialogAddID, #" + searchID + ", #currpage" + paginationID,
|
||||
ModalID: dialogAddID,
|
||||
ModalTitle: "New - Grup Kelainan",
|
||||
DialogBody: dialogAddBodyCmp,
|
||||
@@ -164,7 +165,11 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
"/dev/kelainan/openedit",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID")
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/kelainan/opendelete",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
|
||||
|
||||
// filter kelainan component
|
||||
kelainanFilterComponent := customtextfieldsearch.MainCustomTextFieldSearchV2(searchID,
|
||||
@@ -224,17 +229,58 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
},
|
||||
)
|
||||
|
||||
// modal delete form
|
||||
dialogDeleteBodyComponent := masterkelainan.BodyFormKelainan(
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Nama Grup Kelainan",
|
||||
Name: "kelainanname",
|
||||
Placeholder: "Nama Grup Kelainan",
|
||||
Type: "text", ID: "kelainaninputname"},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Nama Grup Kelainan",
|
||||
Name: "kelainanid",
|
||||
Placeholder: "Nama Grup Kelainan",
|
||||
Type: "hidden", ID: "kelainaninputid"},
|
||||
dialogDeleteBodyID, masterkelainan.JsHideModal(""))
|
||||
modalActioDeleteComponent := masterkelainan.ActionFormKelainanDelete(
|
||||
"/dev/kelainan/closedeleteform",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#"+dialogDeleteID)
|
||||
btnCloaseModalDelete := masterkelainan.BtnCloseFormKelainan(
|
||||
"/dev/kelainan/closedeleteform",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#"+dialogDeleteID)
|
||||
modalDeleteFormComponent := masterkelainan.KelainanForm(
|
||||
models.KelainanFormComponent{
|
||||
IDComponent: "formkelainan",
|
||||
Link: "/dev/kelainan/delete",
|
||||
HxTarget: "#" + dialogDeleteBodyID,
|
||||
HxSwap: "outerHTML",
|
||||
HxInclude: "#tableID, #paginationID, #searchID, #dialogDeleteBodyID, #dialogDeleteID, #" + searchID + ", #currpage" + paginationID,
|
||||
ModalID: dialogDeleteID,
|
||||
ModalTitle: "Konfirmasi",
|
||||
DialogBody: dialogDeleteBodyComponent,
|
||||
DialogAction: modalActioDeleteComponent,
|
||||
ButtonCLose: btnCloaseModalDelete,
|
||||
},
|
||||
)
|
||||
|
||||
// content, css, js
|
||||
content := masterkelainan.ContentMasterKelainan(
|
||||
tableID, paginationID, searchID, dialogAddID, dialogAddBodyID,
|
||||
dialogEditID,
|
||||
dialogEditBodyID,
|
||||
dialogDeleteID,
|
||||
dialogDeleteBodyID,
|
||||
breadcrumbComponent,
|
||||
contentKelainanComponent,
|
||||
kelainanFilterComponent,
|
||||
kelainanPaginationComponent,
|
||||
modaladdcomponent,
|
||||
modalEditFormComponent)
|
||||
modalEditFormComponent,
|
||||
modalDeleteFormComponent)
|
||||
css := masterkelainan.CssKelainan()
|
||||
js := masterkelainan.JsMdKelainan()
|
||||
|
||||
@@ -257,7 +303,7 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainanSearch(c echo.Context)
|
||||
tableID := c.QueryParam("tableID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
dialogEditBodyID := c.QueryParam("dialogEditBodyID")
|
||||
// dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
|
||||
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
dataKelainan, totalpage, err := lh.MasterKelainanService.GetListMasterKelainan(search, 1, 5)
|
||||
@@ -275,7 +321,11 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainanSearch(c echo.Context)
|
||||
"/dev/kelainan/openedit",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID")
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/kelainan/opendelete",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
|
||||
|
||||
kelainanPaginationComponent := pagination.PaginationV2(totalpage,
|
||||
1,
|
||||
@@ -298,7 +348,7 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainanPagination(c echo.Cont
|
||||
searchID := c.QueryParam("searchID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
dialogEditBodyID := c.QueryParam("dialogEditBodyID")
|
||||
// dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
|
||||
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
|
||||
page, err := strconv.Atoi(pageparam)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
@@ -324,7 +374,12 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainanPagination(c echo.Cont
|
||||
"/dev/kelainan/openedit",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID")
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/kelainan/opendelete",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
)
|
||||
|
||||
kelainanPaginationComponent := pagination.PaginationV2(totalpage,
|
||||
page,
|
||||
@@ -351,7 +406,7 @@ func (lh *MasterKelainanHandler) AddKelainan(c echo.Context) error {
|
||||
dialogAddBodyID := c.FormValue("dialogAddBodyID")
|
||||
dialogAddID := c.FormValue("dialogAddID")
|
||||
dialogEditBodyID := c.FormValue("dialogEditBodyID")
|
||||
// dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
|
||||
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
|
||||
|
||||
currPage, err := strconv.Atoi(currPagePrm)
|
||||
|
||||
@@ -454,10 +509,14 @@ func (lh *MasterKelainanHandler) AddKelainan(c echo.Context) error {
|
||||
// New table listing
|
||||
contentKelainanComponent := masterkelainan.TableKelainan(
|
||||
dataKelainanList, tableID,
|
||||
"",
|
||||
"/dev/kelainan/openedit",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID")
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/kelainan/opendelete",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
|
||||
|
||||
// New pagination
|
||||
kelainanPaginationComponent := pagination.PaginationV2(totalpage,
|
||||
@@ -565,6 +624,7 @@ func (lh *MasterKelainanHandler) HandleEditKelainan(c echo.Context) error {
|
||||
currPagePrm := c.FormValue("currpage" + paginationID)
|
||||
dialogEditID := c.FormValue("dialogEditID")
|
||||
dialogEditBodyID := c.FormValue("dialogEditBodyID")
|
||||
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
|
||||
|
||||
currPage, err := strconv.Atoi(currPagePrm)
|
||||
if err != nil {
|
||||
@@ -648,12 +708,17 @@ func (lh *MasterKelainanHandler) HandleEditKelainan(c echo.Context) error {
|
||||
}
|
||||
|
||||
// Table component
|
||||
tableComponent := masterkelainan.TableKelainan(dataKelainanList,
|
||||
tableComponent := masterkelainan.TableKelainan(
|
||||
dataKelainanList,
|
||||
tableID,
|
||||
"/dev/kelainan/openedit",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID")
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/kelainan/opendelete",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
|
||||
|
||||
// pagination component
|
||||
kelainanPaginationComponent := pagination.PaginationV2(
|
||||
@@ -661,7 +726,7 @@ func (lh *MasterKelainanHandler) HandleEditKelainan(c echo.Context) error {
|
||||
currPage,
|
||||
"/dev/kelainanpagination",
|
||||
paginationID,
|
||||
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID",
|
||||
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"#"+paginationID,
|
||||
"outerHTML", "", "true",
|
||||
)
|
||||
@@ -685,3 +750,147 @@ func (lh *MasterKelainanHandler) HandleEditKelainan(c echo.Context) error {
|
||||
|
||||
return utils.ViewMulti(c, retval)
|
||||
}
|
||||
|
||||
func (lh *MasterKelainanHandler) HandleOpenDeleteForm(c echo.Context) error {
|
||||
id := c.QueryParam("id")
|
||||
dialogDeleteID := c.QueryParam("dialogDeleteID")
|
||||
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
|
||||
|
||||
dataKelainan, err := lh.MasterKelainanService.GetKelainanByID(id)
|
||||
if err != nil {
|
||||
newForm := masterkelainan.DeleteConfirmationBody(
|
||||
models.CustomTextFieldv2Prm{Name: "kelainanid", Type: "hidden", Value: strconv.Itoa(dataKelainan.Mcu_KelainanGroupID)},
|
||||
dialogDeleteBodyID,
|
||||
"Apakah anda yakin menghapus grup kelainan berikut ?",
|
||||
[]string{"Kelainan Grup"},
|
||||
[]string{""},
|
||||
masterkelainan.JsShowModal(""))
|
||||
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Error", "Get kelainan grup error", "danger"), newForm})
|
||||
}
|
||||
newForm := masterkelainan.DeleteConfirmationBody(
|
||||
models.CustomTextFieldv2Prm{Name: "kelainanid", Type: "hidden", Value: strconv.Itoa(dataKelainan.Mcu_KelainanGroupID)},
|
||||
dialogDeleteBodyID,
|
||||
"Apakah anda yakin menghapus grup kelainan berikut ?",
|
||||
[]string{"Nama Grup"},
|
||||
[]string{dataKelainan.Mcu_KelainanGroupName},
|
||||
masterkelainan.JsShowModal("#"+dialogDeleteID))
|
||||
return utils.View(c, newForm)
|
||||
}
|
||||
|
||||
func (lh *MasterKelainanHandler) HandleCloseFormDelete(c echo.Context) error {
|
||||
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
|
||||
newForm := masterkelainan.DeleteConfirmationBody(
|
||||
models.CustomTextFieldv2Prm{Name: "kelainanid", Type: "hidden", Value: ""},
|
||||
dialogDeleteBodyID,
|
||||
"Apakah anda yakin menghapus grup kelainan berikut ?",
|
||||
[]string{"Grup Kelainan"},
|
||||
[]string{""},
|
||||
masterkelainan.JsShowModal(""))
|
||||
return utils.View(c, newForm)
|
||||
}
|
||||
|
||||
func (lh *MasterKelainanHandler) HandleDeleteKelainan(c echo.Context) error {
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
|
||||
//prm form kelainan
|
||||
id := c.FormValue("kelainanid")
|
||||
tableID := c.FormValue("tableID")
|
||||
paginationID := c.FormValue("paginationID")
|
||||
searchID := c.FormValue("searchID")
|
||||
search := c.FormValue("search")
|
||||
currPagePrm := c.FormValue("currpage" + paginationID)
|
||||
// dialogAddBodyID := c.FormValue("dialogAddBodyID")
|
||||
dialogDeleteID := c.FormValue("dialogDeleteID")
|
||||
dialogEditBodyID := c.FormValue("dialogEditBodyID")
|
||||
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
|
||||
|
||||
currPage, err := strconv.Atoi(currPagePrm)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
logger.Info("ADD KELAINAN PARAM",
|
||||
zap.Any("tableid", tableID),
|
||||
zap.Any("search", search),
|
||||
zap.Any("currpage", currPage),
|
||||
)
|
||||
|
||||
//edit user group service
|
||||
dataKelainan, err := lh.MasterKelainanService.DeleteKelainan(id)
|
||||
if err != nil {
|
||||
logger.Info("Error",
|
||||
zap.Any("Error", err),
|
||||
)
|
||||
newForm := masterkelainan.DeleteConfirmationBody(
|
||||
models.CustomTextFieldv2Prm{Name: "kelainanid", Type: "hidden", Value: ""},
|
||||
dialogDeleteBodyID,
|
||||
"Apakah anda yakin menghapus grup kelaian berikut ?",
|
||||
[]string{"Nama Grup"},
|
||||
[]string{""},
|
||||
masterkelainan.JsShowModal(""))
|
||||
return utils.ViewMulti(c, []templ.Component{
|
||||
customtoastv2.CustomToastV2Show("Error", err.Error(), "danger"),
|
||||
newForm})
|
||||
|
||||
}
|
||||
logger.Info("ADD KELAINAN",
|
||||
zap.Any("return", dataKelainan),
|
||||
)
|
||||
//get list user group for table
|
||||
dataKelainanList, totalPage, err := lh.MasterKelainanService.GetListMasterKelainan(search, currPage, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET KELAINAN",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataKelainan)
|
||||
return err
|
||||
}
|
||||
if len(dataKelainanList) == 0 && totalPage > 1 {
|
||||
currPage = currPage - 1
|
||||
dataKelainanList, _, err = lh.MasterKelainanService.GetListMasterKelainan(search, currPage, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET KELAINAN",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
return err
|
||||
}
|
||||
}
|
||||
//table component
|
||||
tableComponent := masterkelainan.TableKelainan(dataKelainanList,
|
||||
tableID,
|
||||
"/dev/kelainan/openedit",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/kelainan/opendelete",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
|
||||
|
||||
//pagination component
|
||||
kelainanPaginationComponent := pagination.PaginationV2(
|
||||
totalPage,
|
||||
currPage,
|
||||
"/dev/kelainanpagination",
|
||||
paginationID,
|
||||
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"#"+paginationID,
|
||||
"outerHTML", "", "true",
|
||||
)
|
||||
|
||||
newForm := masterkelainan.DeleteConfirmationBody(
|
||||
models.CustomTextFieldv2Prm{Name: "kelainanid", Type: "hidden", Value: ""},
|
||||
dialogDeleteBodyID,
|
||||
"Apakah anda yakin menghapus grup kelainan berikut ?",
|
||||
[]string{"Grup Kelainan"},
|
||||
[]string{""},
|
||||
masterkelainan.JsHideModal("#"+dialogDeleteID))
|
||||
toastSuccess := customtoastv2.CustomToastV2Show("Success", "Berhasil delete Grup Kelainan ", "success")
|
||||
|
||||
retVal := []templ.Component{toastSuccess, tableComponent, kelainanPaginationComponent, newForm}
|
||||
|
||||
return utils.ViewMulti(c, retVal)
|
||||
}
|
||||
|
||||
@@ -223,4 +223,7 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
|
||||
dev.GET("/kelainan/openedit", devKLhandlers.HandleOpenEditForm)
|
||||
dev.POST("/kelainan/closeeditform", devKLhandlers.HandleCloseFormEdit)
|
||||
dev.POST("/kelainan/edit", devKLhandlers.HandleEditKelainan)
|
||||
dev.GET("/kelainan/opendelete", devKLhandlers.HandleOpenDeleteForm)
|
||||
dev.POST("/kelainan/closedeleteform", devKLhandlers.HandleCloseFormDelete)
|
||||
dev.POST("/kelainan/delete", devKLhandlers.HandleDeleteKelainan)
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ func (su *ServicesMasterKelainan) GetListMasterKelainan(search string, currentPa
|
||||
|
||||
query := `
|
||||
SELECT
|
||||
ROW_NUMBER() OVER (ORDER BY Mcu_KelainanGroupID ASC) AS nomor,
|
||||
ROW_NUMBER() OVER (ORDER BY Mcu_KelainanGroupID DESC) AS nomor,
|
||||
Mcu_KelainanGroupID,
|
||||
Mcu_KelainanGroupName,
|
||||
Mcu_KelainanGroupIsActive,
|
||||
@@ -105,7 +105,7 @@ func (su *ServicesMasterKelainan) GetListMasterKelainan(search string, currentPa
|
||||
FROM mcu_kelainangroup
|
||||
WHERE Mcu_KelainanGroupIsActive = 'Y'
|
||||
AND (Mcu_KelainanGroupName LIKE ?)
|
||||
order by Mcu_KelainanGroupID ASC
|
||||
order by Mcu_KelainanGroupID DESC
|
||||
LIMIT ? OFFSET ?
|
||||
`
|
||||
|
||||
@@ -122,7 +122,7 @@ func (su *ServicesMasterKelainan) GetKelainanByID(id string) (models.Kelainan, e
|
||||
|
||||
var data models.Kelainan
|
||||
err := dbx.Handlex.Get(&data, `SELECT * FROM mcu_kelainangroup
|
||||
WHERE Mcu_KelainanGroupIsActive = 'Y' AND Mcu_KelainanGroupID = ?`, id)
|
||||
WHERE Mcu_KelainanGroupID = ?`, id)
|
||||
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
@@ -205,3 +205,34 @@ func (su *ServicesMasterKelainan) EditKelainan(id string, name string) (models.K
|
||||
|
||||
return data, nil
|
||||
}
|
||||
|
||||
func (su *ServicesMasterKelainan) DeleteKelainan(id string) (models.Kelainan, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var data models.Kelainan
|
||||
qry := `UPDATE mcu_kelainangroup
|
||||
SET Mcu_KelainanGroupIsActive = 'N',
|
||||
Mcu_KelainanGroupLastUpdated = NOW()
|
||||
WHERE Mcu_KelainanGroupID = ?`
|
||||
|
||||
rst := dbx.Handlex.MustExec(qry, id)
|
||||
_, err := rst.RowsAffected()
|
||||
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error delete kelainan grup",
|
||||
zap.String("id", id),
|
||||
)
|
||||
return data, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
data, err = su.GetKelainanByID(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get kelainan by id",
|
||||
zap.String("id", id),
|
||||
)
|
||||
return data, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
return data, nil
|
||||
}
|
||||
|
||||
@@ -14,12 +14,15 @@ templ ContentMasterKelainan(
|
||||
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,
|
||||
) {
|
||||
<div class="container-fluid">
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
|
||||
@@ -50,6 +53,14 @@ templ ContentMasterKelainan(
|
||||
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})
|
||||
<div class="row align-items-center mb-10">
|
||||
<div class="col-md-10 col-sm-12 p-0 ">
|
||||
@breadcrumb
|
||||
@@ -78,6 +89,7 @@ templ ContentMasterKelainan(
|
||||
@paginationComponent
|
||||
@modalAddform
|
||||
@modalEditForm
|
||||
@modalDeleteForm
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@@ -24,12 +24,15 @@ func ContentMasterKelainan(
|
||||
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)
|
||||
@@ -96,6 +99,20 @@ func ContentMasterKelainan(
|
||||
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("<div class=\"row align-items-center mb-10\"><div class=\"col-md-10 col-sm-12 p-0 \">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
@@ -111,7 +128,7 @@ func ContentMasterKelainan(
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs("#" + dialogAddID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\masterkelainan.templ`, Line: 63, Col: 37}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\masterkelainan.templ`, Line: 74, Col: 37}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -124,7 +141,7 @@ func ContentMasterKelainan(
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs("#" + dialogAddID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\masterkelainan.templ`, Line: 72, Col: 36}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\masterkelainan.templ`, Line: 83, Col: 36}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -154,6 +171,10 @@ func ContentMasterKelainan(
|
||||
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("</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
|
||||
@@ -85,7 +85,7 @@ templ ActionFormKelainan(LinkClose string, targetClose string, hxSwapClose strin
|
||||
type="submit"
|
||||
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact"
|
||||
>
|
||||
Save
|
||||
Simpan
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
@@ -104,3 +104,53 @@ templ BtnCloseFormKelainan(LinkClose string, targetClose string, hxSwapClose str
|
||||
<i aria-hidden="true" class="ki ki-close"></i>
|
||||
</button>
|
||||
}
|
||||
|
||||
templ DeleteConfirmationBody(inputId models.CustomTextFieldv2Prm,
|
||||
componentID string,
|
||||
message string,
|
||||
datHeader []string,
|
||||
dataText []string,
|
||||
hxOnLoad templ.ComponentScript) {
|
||||
<div id={ componentID } hx-on::load={ hxOnLoad }>
|
||||
<p>{ message }</p>
|
||||
<div class="card rounded-lg">
|
||||
<div class="card-body d-flex flex-row">
|
||||
<div class="d-flex flex-column">
|
||||
for _, v := range datHeader {
|
||||
<div class="mb-1 mt-1 text-disabled font-weight-bold mr-5">{ v }</div>
|
||||
}
|
||||
</div>
|
||||
<div class="d-flex flex-column ">
|
||||
for _, v := range dataText {
|
||||
<div class="mb-1 mt-1 font-weight-bold">
|
||||
{ v }
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@customtextfield.CustomTextFieldv2(inputId)
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ActionFormKelainanDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
|
||||
<div>
|
||||
<button
|
||||
hx-on::after-request={ JsHideModal(modalID) }
|
||||
hx-post={ LinkClose }
|
||||
hx-target={ targetClose }
|
||||
hx-swap={ hxSwapClose }
|
||||
type="button"
|
||||
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnaddact"
|
||||
data-dismiss="modal"
|
||||
>
|
||||
Batal
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact"
|
||||
>
|
||||
Yakin
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ func ActionFormKelainan(LinkClose string, targetClose string, hxSwapClose string
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnaddact\" data-dismiss=\"modal\">Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact\">Save\r</button></div>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnaddact\" data-dismiss=\"modal\">Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact\">Simpan\r</button></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -418,3 +418,205 @@ func BtnCloseFormKelainan(LinkClose string, targetClose string, hxSwapClose stri
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func DeleteConfirmationBody(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("<div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var23 string
|
||||
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainanformmodal.templ`, Line: 114, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::load=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var24 templ.ComponentScript = hxOnLoad
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><p>")
|
||||
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\masterkelainan\mdkelainanformmodal.templ`, Line: 115, 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("</p><div class=\"card rounded-lg\"><div class=\"card-body d-flex flex-row\"><div class=\"d-flex flex-column\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for _, v := range datHeader {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 text-disabled font-weight-bold mr-5\">")
|
||||
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\masterkelainan\mdkelainanformmodal.templ`, Line: 120, 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("</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"d-flex flex-column \">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for _, v := range dataText {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 font-weight-bold\">")
|
||||
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\masterkelainan\mdkelainanformmodal.templ`, Line: 126, 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("</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")
|
||||
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("</div>")
|
||||
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 ActionFormKelainanDelete(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("<div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModal(modalID))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-on::after-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var29 templ.ComponentScript = JsHideModal(modalID)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var30 string
|
||||
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainanformmodal.templ`, Line: 140, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var31 string
|
||||
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainanformmodal.templ`, Line: 141, Col: 26}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var32 string
|
||||
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainanformmodal.templ`, Line: 142, Col: 24}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnaddact\" data-dismiss=\"modal\">Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact\">Yakin\r</button></div>")
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
@@ -12,6 +12,10 @@ templ TableKelainan(data []models.Kelainan,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) {
|
||||
<div id={ tableID } hx-swap-oob="true">
|
||||
@tablecomponent.TableV3([]string{"NO", "GRUP KELAINAN", "AKSI"},
|
||||
@@ -21,6 +25,10 @@ templ TableKelainan(data []models.Kelainan,
|
||||
hxTargetEdit,
|
||||
hxSwapEdit,
|
||||
hxIncludeEdit,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
hxIncludeDelete,
|
||||
))
|
||||
</div>
|
||||
}
|
||||
@@ -30,6 +38,10 @@ templ TableRow(data []models.Kelainan,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) {
|
||||
if len(data) == 0 {
|
||||
<tr>
|
||||
@@ -46,6 +58,10 @@ templ TableRow(data []models.Kelainan,
|
||||
hxTargetEdit,
|
||||
hxSwapEdit,
|
||||
hxIncludeEdit,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
hxIncludeDelete,
|
||||
)
|
||||
</td>
|
||||
</tr>
|
||||
@@ -58,6 +74,10 @@ templ TableAction(
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) {
|
||||
<div class="row px-5 d-flex justify-content-around">
|
||||
<a
|
||||
@@ -75,6 +95,10 @@ templ TableAction(
|
||||
id="btndeleteug"
|
||||
type="button"
|
||||
class=" btndeleteug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2"
|
||||
hx-get={ hxGetDelete + "?id=" + strconv.Itoa(id) }
|
||||
hx-target={ hxTargetDelete }
|
||||
hx-swap={ hxSwapDelete }
|
||||
hx-include={ hxIncludeDelete }
|
||||
>
|
||||
Hapus
|
||||
</a>
|
||||
|
||||
@@ -22,6 +22,10 @@ func TableKelainan(data []models.Kelainan,
|
||||
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)
|
||||
@@ -42,7 +46,7 @@ func TableKelainan(data []models.Kelainan,
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(tableID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 16, Col: 18}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 20, Col: 18}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -59,6 +63,10 @@ func TableKelainan(data []models.Kelainan,
|
||||
hxTargetEdit,
|
||||
hxSwapEdit,
|
||||
hxIncludeEdit,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
hxIncludeDelete,
|
||||
)).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
@@ -79,6 +87,10 @@ func TableRow(data []models.Kelainan,
|
||||
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)
|
||||
@@ -106,7 +118,7 @@ func TableRow(data []models.Kelainan,
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(v.Nomor)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 41, Col: 16}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 53, Col: 16}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -119,7 +131,7 @@ func TableRow(data []models.Kelainan,
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v.Mcu_KelainanGroupName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 42, Col: 32}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 54, Col: 32}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -134,6 +146,10 @@ func TableRow(data []models.Kelainan,
|
||||
hxTargetEdit,
|
||||
hxSwapEdit,
|
||||
hxIncludeEdit,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
hxIncludeDelete,
|
||||
).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
@@ -156,6 +172,10 @@ func TableAction(
|
||||
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)
|
||||
@@ -176,7 +196,7 @@ func TableAction(
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetEdit + "?id=" + strconv.Itoa(id))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 67, Col: 49}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 87, Col: 49}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -189,7 +209,7 @@ func TableAction(
|
||||
var templ_7745c5c3_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetEdit)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 68, Col: 27}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 88, Col: 27}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -202,7 +222,7 @@ func TableAction(
|
||||
var templ_7745c5c3_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapEdit)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 69, Col: 23}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 89, Col: 23}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -215,13 +235,65 @@ func TableAction(
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeEdit)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 70, Col: 29}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 90, Col: 29}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">Edit\r</a> <a id=\"btndeleteug\" type=\"button\" class=\" btndeleteug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2\">Hapus\r</a></div>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">Edit\r</a> <a id=\"btndeleteug\" type=\"button\" class=\" btndeleteug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetDelete + "?id=" + strconv.Itoa(id))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 98, Col: 51}
|
||||
}
|
||||
_, 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("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var12 string
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 99, Col: 29}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 100, Col: 25}
|
||||
}
|
||||
_, 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("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var14 string
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\mdkelainantable.templ`, Line: 101, Col: 31}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">Hapus\r</a></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user