add autologon, + generate password btn peserta dashboard pic
This commit is contained in:
@@ -15,6 +15,13 @@ var IsLoggedIn = echojwt.WithConfig(
|
||||
},
|
||||
)
|
||||
|
||||
var IsAlreadyLogin = echojwt.WithConfig(
|
||||
echojwt.Config{
|
||||
SigningKey: []byte("--one_api-secret-2019-04-01"),
|
||||
ErrorHandler: JWTErrorChecker,
|
||||
},
|
||||
)
|
||||
|
||||
func JWTErrorChecker(c echo.Context, err error) error {
|
||||
return c.Redirect(http.StatusTemporaryRedirect, "/login")
|
||||
}
|
||||
|
||||
@@ -2,11 +2,13 @@ package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/component/pagination"
|
||||
customtoastv2 "cpone/component/toastbootstrap"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_mcudetail "cpone/views/corporate/mcu/mcutab"
|
||||
"strconv"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
@@ -15,6 +17,8 @@ type TabDaftarPesertaServices interface {
|
||||
GetListMcuDaftarPeserta(id string, currentpage int, rowperpage int) ([]models.ModelMcuDaftarPeserta, int, error)
|
||||
GetReportMcu(orderheaderID string) ([]models.TabViewReportMcu, error)
|
||||
GetListReportPeserta(orderheaderID string, host string) ([]models.TabViewReportMcu, error)
|
||||
GenerataPasswordMCU(mgmMCUID string, host string) (models.GeneratePasswordResponse, error)
|
||||
GetAkunPeserta(patientID string) (models.AuthPatient, error)
|
||||
}
|
||||
|
||||
type TabDaftarPesertaHandlers struct {
|
||||
@@ -32,9 +36,16 @@ func (tdp *TabDaftarPesertaHandlers) HandleShowTabDaftarPeserta(c echo.Context)
|
||||
title := "Daftar Report"
|
||||
tableID := utils.GenerateRandomID("tableid")
|
||||
paginationID := utils.GenerateRandomID("paginationID")
|
||||
|
||||
dialogReportID := utils.GenerateRandomID("dialogreportid")
|
||||
dialogReportBodyID := utils.GenerateRandomID("dialogreportbodyid")
|
||||
|
||||
dialogGeneratePassID := utils.GenerateRandomID("generatepasswordID")
|
||||
dialogGeneratePassBodyID := utils.GenerateRandomID("generatepasswordBodyID")
|
||||
|
||||
dialogAkunID := utils.GenerateRandomID("dialogakunID")
|
||||
dialogAkunBodyID := utils.GenerateRandomID("dialogakunbodyID")
|
||||
|
||||
id := c.Param("id")
|
||||
logger.Info("Params", zap.Any("id", id))
|
||||
|
||||
@@ -42,14 +53,17 @@ func (tdp *TabDaftarPesertaHandlers) HandleShowTabDaftarPeserta(c echo.Context)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
logger.Info("totalPage", zap.Any("total", totalPage))
|
||||
|
||||
table := corporate_mcudetail.TableDaftarPeserta(
|
||||
dataTable,
|
||||
tableID,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openreport",
|
||||
"#"+dialogReportBodyID,
|
||||
"#tableID, #paginationID, #dialogReportID, #dialogReportBodyID",
|
||||
"#tableID, #paginationID, #dialogReportID, #dialogReportBodyID, #dialogGenPassID, #dialogGenPassBodyID, #dialogAkunID, #dialogAkunBodyID",
|
||||
"outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openviewakun",
|
||||
"#"+dialogAkunBodyID,
|
||||
"#tableID, #paginationID, #dialogReportID, #dialogReportBodyID, #dialogGenPassID, #dialogGenPassBodyID, #dialogAkunID, #dialogAkunBodyID",
|
||||
"outerHTML",
|
||||
)
|
||||
|
||||
@@ -58,7 +72,7 @@ func (tdp *TabDaftarPesertaHandlers) HandleShowTabDaftarPeserta(c echo.Context)
|
||||
1,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/changepage",
|
||||
paginationID,
|
||||
"#tableID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogReportID, #dialogReportBodyID",
|
||||
"#tableID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogReportID, #dialogReportBodyID, #dialogGenPassID, #dialogGenPassBodyID, #dialogAkunID, #dialogAkunBodyID",
|
||||
"#contentlayout",
|
||||
"outerHTML", "", "",
|
||||
corporate_mcudetail.BeforeRequestContent(),
|
||||
@@ -70,10 +84,11 @@ func (tdp *TabDaftarPesertaHandlers) HandleShowTabDaftarPeserta(c echo.Context)
|
||||
pagination,
|
||||
)
|
||||
|
||||
// modal dialog tab rpt
|
||||
tabData := []models.TabViewReportMcu{}
|
||||
tabview := corporate_mcudetail.TabReportView(tabData)
|
||||
|
||||
bodymodal := corporate_mcudetail.ModalBody(
|
||||
bodymodal := corporate_mcudetail.ModalRptBody(
|
||||
dialogReportBodyID,
|
||||
tabview,
|
||||
corporate_mcudetail.JsShowModal(""),
|
||||
@@ -87,34 +102,123 @@ func (tdp *TabDaftarPesertaHandlers) HandleShowTabDaftarPeserta(c echo.Context)
|
||||
)
|
||||
|
||||
modaldialog := corporate_mcudetail.DialogReport(
|
||||
"",
|
||||
"generatepasswordform",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/dialogreport",
|
||||
"#"+dialogReportBodyID,
|
||||
"outerHTML",
|
||||
"#tableID, #paginationID, #dialogReportID, #dialogReportBodyID"+paginationID,
|
||||
"#tableID, #paginationID, #dialogAkunID, #dialogAkunBodyID, #dialogGenPassID, #dialogGenPassBodyID, #dialogReportID, #dialogReportBodyID"+paginationID,
|
||||
dialogReportID,
|
||||
title,
|
||||
bodymodal,
|
||||
closemodal,
|
||||
)
|
||||
|
||||
// dialog generate password
|
||||
modalGenPassBody := corporate_mcudetail.ModalGenPassBody(
|
||||
dialogGeneratePassBodyID,
|
||||
"Apakah anda yakin untuk men-generate password untuk seluruh karyawan",
|
||||
corporate_mcudetail.JsShowModal(""),
|
||||
)
|
||||
|
||||
closeGenPass := corporate_mcudetail.ModalClose(
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/closegenpass",
|
||||
"#"+dialogGeneratePassBodyID,
|
||||
"outerHTML",
|
||||
"#"+dialogGeneratePassID,
|
||||
)
|
||||
|
||||
actionGenPass := corporate_mcudetail.ModalGenPassAction(
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/closegenpass",
|
||||
"#"+dialogGeneratePassBodyID,
|
||||
"outerHTML",
|
||||
"#"+dialogGeneratePassID,
|
||||
)
|
||||
|
||||
modalGenPass := corporate_mcudetail.DialogGeneratePass(
|
||||
"",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/dialoggenpass",
|
||||
"#"+dialogGeneratePassBodyID,
|
||||
"outerHTML",
|
||||
"#tableID, #paginationID, #contentlayout, #dialogAkunID, #dialogAkunBodyID, #dialogGenPassID, #dialogGenPassBodyID, #dialogReportID, #dialogReportBodyID, #currpage"+paginationID,
|
||||
dialogGeneratePassID,
|
||||
"Generate Password MCU",
|
||||
modalGenPassBody,
|
||||
closeGenPass,
|
||||
actionGenPass,
|
||||
)
|
||||
|
||||
// dialog view akun
|
||||
dialogAkunBody := corporate_mcudetail.ModalViewAkunBody(
|
||||
dialogAkunBodyID,
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "ID Akun Peserta",
|
||||
Name: "akunpesertaid",
|
||||
Placeholder: "ID Akun Peserta",
|
||||
Type: "hidden",
|
||||
ID: "akunpesertaidid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Email",
|
||||
Name: "akunpesertaemail",
|
||||
Type: "text",
|
||||
ID: "akunpesertaemailid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Password",
|
||||
Name: "akunpesertapass",
|
||||
Type: "password",
|
||||
ID: "akunpesertapassid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Ketik ulang password",
|
||||
Name: "akunpesertapasscek",
|
||||
Type: "password",
|
||||
ID: "akunpesertapasscekid",
|
||||
},
|
||||
corporate_mcudetail.JsShowModal(""),
|
||||
)
|
||||
|
||||
dialogAkunClose := corporate_mcudetail.ModalClose(
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/closeviewakun",
|
||||
"#"+dialogAkunBodyID,
|
||||
"outerHTML",
|
||||
"#"+dialogAkunID,
|
||||
)
|
||||
|
||||
dialogAkunAction := corporate_mcudetail.ModalGenPassAction(
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/closeviewakun",
|
||||
"#"+dialogAkunBodyID,
|
||||
"outerHTML",
|
||||
"#"+dialogAkunID,
|
||||
)
|
||||
|
||||
dialogAkunView := corporate_mcudetail.DialogGeneratePass(
|
||||
"viewakunform",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/viewakun",
|
||||
"#"+dialogAkunBodyID,
|
||||
"outerHTML",
|
||||
"#tableID, #paginationID, #dialogAkunID, #contentlayout, #dialogAkunBodyID, #dialogGenPassID, #dialogGenPassBodyID, #dialogReportID, #dialogReportBodyID, #currpage"+paginationID,
|
||||
dialogAkunID,
|
||||
"Ubah Password Akun Peserta",
|
||||
dialogAkunBody,
|
||||
dialogAkunClose,
|
||||
dialogAkunAction,
|
||||
)
|
||||
|
||||
content := corporate_mcudetail.TabDaftarPesertaScreen(
|
||||
tableID,
|
||||
paginationID,
|
||||
dialogReportID,
|
||||
dialogReportBodyID,
|
||||
dialogGeneratePassID,
|
||||
dialogGeneratePassBodyID,
|
||||
dialogAkunID,
|
||||
dialogAkunBodyID,
|
||||
clayout,
|
||||
modaldialog,
|
||||
modalGenPass,
|
||||
dialogAkunView,
|
||||
)
|
||||
// css := corporate_mcudetail.CSSTabDaftarPeserta()
|
||||
// js := corporate_mcudetail.JsTabDaftarPeserta()
|
||||
|
||||
// view := corporate_mcudetail.ShowTabDafterPeserta(
|
||||
// title,
|
||||
// content,
|
||||
// css,
|
||||
// js,
|
||||
// )
|
||||
|
||||
return utils.View(c, content)
|
||||
}
|
||||
@@ -123,8 +227,9 @@ func (tdp *TabDaftarPesertaHandlers) HandlePagination(c echo.Context) error {
|
||||
pageparam := c.QueryParam("page")
|
||||
tableID := c.QueryParam("tableID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
// dialogReportID := c.QueryParam("dialogReportID")
|
||||
|
||||
dialogReportBodyID := c.QueryParam("dialogReportBodyID")
|
||||
dialogAkunBodyID := c.QueryParam("dialogAkunBodyID")
|
||||
|
||||
id := c.Param("id")
|
||||
|
||||
@@ -143,7 +248,11 @@ func (tdp *TabDaftarPesertaHandlers) HandlePagination(c echo.Context) error {
|
||||
tableID,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openreport",
|
||||
"#"+dialogReportBodyID,
|
||||
"#tableID, #paginationID, #dialogReportID, #dialogReportBodyID",
|
||||
"#tableID, #paginationID, #dialogReportID, #dialogReportBodyID, #dialogGenPassID, #dialogGenPassBodyID, #dialogAkunID, #dialogAkunBodyID",
|
||||
"outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openviewakun",
|
||||
"#"+dialogAkunBodyID,
|
||||
"#tableID, #paginationID, #dialogReportID, #dialogReportBodyID, #dialogGenPassID, #dialogGenPassBodyID, #dialogAkunID, #dialogAkunBodyID",
|
||||
"outerHTML",
|
||||
)
|
||||
|
||||
@@ -152,19 +261,13 @@ func (tdp *TabDaftarPesertaHandlers) HandlePagination(c echo.Context) error {
|
||||
page,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/changepage",
|
||||
paginationID,
|
||||
"#tableID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogReportID, #dialogReportBodyID, #currPage"+paginationID,
|
||||
"#tableID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogGenPassID, #dialogGenPassBodyID, #dialogAkunID, #dialogAkunBodyID, #dialogReportID, #dialogReportBodyID, #currPage"+paginationID,
|
||||
"#contentlayout",
|
||||
"outerHTML", "", "",
|
||||
corporate_mcudetail.BeforeRequestContent(),
|
||||
corporate_mcudetail.AfterRequestContent(),
|
||||
)
|
||||
|
||||
// content := corporate_mcudetail.TabDaftarPesertaScreen(tableID, paginationID, table, pagination)
|
||||
// retval = append(retval, table)
|
||||
// retval = append(retval, pagination)
|
||||
// return utils.ViewMulti(c, retval)
|
||||
|
||||
// return utils.View(c, content)
|
||||
clayout := corporate_mcudetail.ContentLayout(table, pagination)
|
||||
return utils.View(c, clayout)
|
||||
}
|
||||
@@ -178,21 +281,10 @@ func (tdp *TabDaftarPesertaHandlers) HandleOpenReportDialog(c echo.Context) erro
|
||||
dialogReportBodyID := c.QueryParam("dialogReportBodyID")
|
||||
logger.Info("params", zap.Any("idx", idx))
|
||||
|
||||
// tabData, err := tdp.TabDaftarPesertaServices.GetReportMcu(idx)
|
||||
// if err != nil {
|
||||
// tab := corporate_mcudetail.TabReportView([]models.TabViewReportMcu{})
|
||||
// mod := corporate_mcudetail.ModalBody(
|
||||
// dialogReportBodyID,
|
||||
// tab,
|
||||
// corporate_mcudetail.JsShowModal(""),
|
||||
// )
|
||||
// return utils.View(c, mod)
|
||||
// }
|
||||
|
||||
newtabdata, err := tdp.TabDaftarPesertaServices.GetListReportPeserta(idx, host)
|
||||
if err != nil {
|
||||
tab := corporate_mcudetail.TabReportView([]models.TabViewReportMcu{})
|
||||
mod := corporate_mcudetail.ModalBody(
|
||||
mod := corporate_mcudetail.ModalRptBody(
|
||||
dialogReportBodyID,
|
||||
tab,
|
||||
corporate_mcudetail.JsShowModal(""),
|
||||
@@ -204,7 +296,7 @@ func (tdp *TabDaftarPesertaHandlers) HandleOpenReportDialog(c echo.Context) erro
|
||||
|
||||
tabcomponent := corporate_mcudetail.TabReportView(newtabdata)
|
||||
|
||||
modalbody := corporate_mcudetail.ModalBody(
|
||||
modalbody := corporate_mcudetail.ModalRptBody(
|
||||
dialogReportBodyID,
|
||||
tabcomponent,
|
||||
corporate_mcudetail.JsShowModal("#"+dialogReportID),
|
||||
@@ -212,3 +304,239 @@ func (tdp *TabDaftarPesertaHandlers) HandleOpenReportDialog(c echo.Context) erro
|
||||
|
||||
return utils.View(c, modalbody)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleCloseDialogGenPass(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
id := c.Param("id")
|
||||
dialogGenPassID := c.FormValue("dialogGenPassID")
|
||||
dialogGenPassBodyID := c.FormValue("dialogGenPassBodyID")
|
||||
logger.Info("param", zap.Any("id", id))
|
||||
|
||||
modalDialogGenPass := corporate_mcudetail.ModalGenPassBody(
|
||||
dialogGenPassBodyID,
|
||||
"Apakah anda yakin untuk men-generate password untuk seluruh karyawan",
|
||||
corporate_mcudetail.JsHideModal("#"+dialogGenPassID),
|
||||
)
|
||||
|
||||
return utils.View(c, modalDialogGenPass)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleDialogGenPass(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
host := c.Request().Host
|
||||
id := c.Param("id")
|
||||
|
||||
// tableID := c.FormValue("tableID")
|
||||
// paginationID := c.FormValue("paginationID")
|
||||
// pageparam := c.FormValue("currpage" + paginationID)
|
||||
|
||||
dialogGenPassID := c.FormValue("dialogGenPassID")
|
||||
dialogGenPassBodyID := c.FormValue("dialogGenPassBodyID")
|
||||
|
||||
// dialogReportBodyID := c.FormValue("dialogReportBodyID")
|
||||
// dialogAkunBodyID := c.FormValue("dialogAkunBodyID")
|
||||
|
||||
// logger.Info("param", zap.Any("id", id), zap.Any("page", pageparam))
|
||||
|
||||
// generate pasword
|
||||
resp, err := tdp.TabDaftarPesertaServices.GenerataPasswordMCU(id, host)
|
||||
if err != nil {
|
||||
logger.Info("error", zap.Any("err", err))
|
||||
|
||||
modalDialogGenPass := corporate_mcudetail.ModalGenPassBody(
|
||||
dialogGenPassBodyID,
|
||||
"Apakah anda yakin untuk men-generate password untuk seluruh karyawan",
|
||||
corporate_mcudetail.JsShowModal(""),
|
||||
)
|
||||
toastwarning := customtoastv2.CustomToastV2Show("Warning", "Gagal generate password", "warning")
|
||||
retVal := []templ.Component{toastwarning, modalDialogGenPass}
|
||||
return utils.ViewMulti(c, retVal)
|
||||
}
|
||||
defer logger.Sync()
|
||||
|
||||
if resp.Status != "OK" {
|
||||
modalDialogGenPass := corporate_mcudetail.ModalGenPassBody(
|
||||
dialogGenPassBodyID,
|
||||
"Apakah anda yakin untuk men-generate password untuk seluruh karyawan",
|
||||
corporate_mcudetail.JsShowModal(""),
|
||||
)
|
||||
toastwarning := customtoastv2.CustomToastV2Show("Warning", "Gagal generate password MCU", "warning")
|
||||
retVal := []templ.Component{toastwarning, modalDialogGenPass}
|
||||
return utils.ViewMulti(c, retVal)
|
||||
}
|
||||
|
||||
modalDialogGenPass := corporate_mcudetail.ModalGenPassBody(
|
||||
dialogGenPassBodyID,
|
||||
"Apakah anda yakin untuk men-generate password untuk seluruh karyawan",
|
||||
corporate_mcudetail.JsHideModal("#"+dialogGenPassID),
|
||||
)
|
||||
|
||||
message := "Success generate password.\n" + resp.Message + " password, telah dikirim melalui email peserta"
|
||||
toastSuccess := customtoastv2.CustomToastV2Show("Success", message, "success")
|
||||
retVal := []templ.Component{toastSuccess, modalDialogGenPass}
|
||||
return utils.ViewMulti(c, retVal)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleOpenViewAkun(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
patientID := c.QueryParam("patid")
|
||||
dialogAkunID := c.QueryParam("dialogAkunID")
|
||||
dialogAkunBodyID := c.QueryParam("dialogAkunBodyID")
|
||||
logger.Info("params", zap.Any("patid", patientID))
|
||||
|
||||
akun, err := tdp.TabDaftarPesertaServices.GetAkunPeserta(patientID)
|
||||
if err != nil {
|
||||
dialogAkunBody := corporate_mcudetail.ModalViewAkunBody(
|
||||
dialogAkunBodyID,
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "ID Akun Peserta",
|
||||
Name: "akunpesertaid",
|
||||
Placeholder: "ID Akun Peserta",
|
||||
Type: "hidden",
|
||||
ID: "akunpesertaidid",
|
||||
Value: patientID,
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Email Akun",
|
||||
Name: "akunpesertaemail",
|
||||
Type: "text",
|
||||
ID: "akunpesertaemailid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Password Akun",
|
||||
Name: "akunpesertapass",
|
||||
Type: "password",
|
||||
ID: "akunpesertapassid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Ketik ulang password",
|
||||
Name: "akunpesertapasscek",
|
||||
Type: "password",
|
||||
ID: "akunpesertapasscekid",
|
||||
},
|
||||
corporate_mcudetail.JsShowModal("#"+dialogAkunID),
|
||||
)
|
||||
toastwarning := customtoastv2.CustomToastV2Show("Warning", "Gagal generate password MCU", "warning")
|
||||
retval := []templ.Component{toastwarning, dialogAkunBody}
|
||||
return utils.ViewMulti(c, retval)
|
||||
}
|
||||
|
||||
dialogAkunBody := corporate_mcudetail.ModalViewAkunBody(
|
||||
dialogAkunBodyID,
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "ID Akun Peserta",
|
||||
Name: "akunpesertaid",
|
||||
Placeholder: "ID Akun Peserta",
|
||||
Type: "hidden",
|
||||
ID: "akunpesertaidid",
|
||||
Value: strconv.Itoa(akun.AuthPatientID),
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Email Akun",
|
||||
Name: "akunpesertaemail",
|
||||
Type: "text",
|
||||
ID: "akunpesertaemailid",
|
||||
Value: akun.AuthPatientEmail,
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Password Akun",
|
||||
Name: "akunpesertapass",
|
||||
Type: "password",
|
||||
ID: "akunpesertapassid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Ketik ulang password",
|
||||
Name: "akunpesertapasscek",
|
||||
Type: "password",
|
||||
ID: "akunpesertapasscekid",
|
||||
},
|
||||
corporate_mcudetail.JsShowModal("#"+dialogAkunID),
|
||||
)
|
||||
return utils.View(c, dialogAkunBody)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleCloseViewAkun(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
patientID := c.FormValue("akunpesertaid")
|
||||
dialogAkunID := c.FormValue("dialogAkunID")
|
||||
dialogAkunBodyID := c.FormValue("dialogAkunBodyID")
|
||||
logger.Info("params", zap.Any("patid", patientID))
|
||||
|
||||
dialogAkunBody := corporate_mcudetail.ModalViewAkunBody(
|
||||
dialogAkunBodyID,
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "ID Akun Peserta",
|
||||
Name: "akunpesertaid",
|
||||
Placeholder: "ID Akun Peserta",
|
||||
Type: "hidden",
|
||||
ID: "akunpesertaidid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Email Akun",
|
||||
Name: "akunpesertaemail",
|
||||
Type: "text",
|
||||
ID: "akunpesertaemailid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Password Akun",
|
||||
Name: "akunpesertapass",
|
||||
Type: "password",
|
||||
ID: "akunpesertapassid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Ketik ulang password",
|
||||
Name: "akunpesertapasscek",
|
||||
Type: "password",
|
||||
ID: "akunpesertapasscekid",
|
||||
},
|
||||
corporate_mcudetail.JsHideModal("#"+dialogAkunID),
|
||||
)
|
||||
return utils.View(c, dialogAkunBody)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleAkun(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
patientID := c.FormValue("akunpesertaid")
|
||||
dialogAkunID := c.FormValue("dialogAkunID")
|
||||
dialogAkunBodyID := c.FormValue("dialogAkunBodyID")
|
||||
logger.Info("params", zap.Any("patid", patientID))
|
||||
|
||||
// akunEmail := c.FormValue("akunpesertaemail")
|
||||
// akunPass := c.FormValue("akunpesertapass")
|
||||
// akunPasscel := c.FormValue("akunpesertapasscek")
|
||||
|
||||
dialogAkunBody := corporate_mcudetail.ModalViewAkunBody(
|
||||
dialogAkunBodyID,
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "ID Akun Peserta",
|
||||
Name: "akunpesertaid",
|
||||
Placeholder: "ID Akun Peserta",
|
||||
Type: "hidden",
|
||||
ID: "akunpesertaidid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Email Akun",
|
||||
Name: "akunpesertaemail",
|
||||
Type: "text",
|
||||
ID: "akunpesertaemailid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Password Akun",
|
||||
Name: "akunpesertapass",
|
||||
Type: "password",
|
||||
ID: "akunpesertapassid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Ketik ulang password",
|
||||
Name: "akunpesertapasscek",
|
||||
Type: "password",
|
||||
ID: "akunpesertapasscekid",
|
||||
},
|
||||
corporate_mcudetail.JsHideModal("#"+dialogAkunID),
|
||||
)
|
||||
return utils.View(c, dialogAkunBody)
|
||||
}
|
||||
|
||||
@@ -8,13 +8,14 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type LoginService interface {
|
||||
Login(username string, password string) (models.ResponseApi, error)
|
||||
MultiSignIn(username string, password string) (models.Response, error)
|
||||
MultiSignIn(username string, password string, host string) (models.Response, error)
|
||||
}
|
||||
|
||||
func NewLoginHandler(us LoginService) *LoginHandler {
|
||||
@@ -36,13 +37,13 @@ func (lh *LoginHandler) HandlerShowLogin(c echo.Context) error {
|
||||
|
||||
func (lh *LoginHandler) HandleSignIn(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
host := c.Request().Host
|
||||
username := c.FormValue("username")
|
||||
password := c.FormValue("password")
|
||||
defer logger.Sync()
|
||||
logger.Info("Params", zap.Any("username", username), zap.Any("pass", password))
|
||||
|
||||
resp, err := lh.LoginService.MultiSignIn(username, password)
|
||||
resp, err := lh.LoginService.MultiSignIn(username, password, host)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error", zap.Any("error multi signin", err))
|
||||
@@ -108,7 +109,7 @@ func (lh *LoginHandler) HandleSignIn(c echo.Context) error {
|
||||
localStorage.setItem("user", user);
|
||||
|
||||
htmx.on("htmx:configRequest", (e)=> {
|
||||
e.detail.headers["Authentication"] = "Bearer ` + resp.Data.Token + `"
|
||||
e.detail.headers["Authorization"] = "Bearer ` + resp.Data.Token + `"
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
@@ -123,7 +124,7 @@ func (lh *LoginHandler) HandleSignIn(c echo.Context) error {
|
||||
func (lh *LoginHandler) HandleRedirect(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
url := c.QueryParam("url")
|
||||
token := c.Request().Header.Get("Authentication")
|
||||
token := c.Request().Header.Get("Authorization")
|
||||
logger.Info("params", zap.Any("url", url), zap.Any("token", token))
|
||||
|
||||
c.Response().Header().Set("HX-Redirect", url)
|
||||
@@ -157,3 +158,43 @@ func (lh *LoginHandler) HandleSignOut(c echo.Context) error {
|
||||
c.Response().Header().Set("HX-Trigger", "script")
|
||||
return c.String(http.StatusOK, ret)
|
||||
}
|
||||
|
||||
func (lh *LoginHandler) HandleAutoLoginPage(c echo.Context) error {
|
||||
userToken := c.Get("user").(*jwt.Token)
|
||||
token := userToken.Raw
|
||||
claims := userToken.Claims.(jwt.MapClaims)
|
||||
userGroup := claims["M_UserGroupDashboard"].(string)
|
||||
|
||||
cookie := new(http.Cookie)
|
||||
cookie.Name = "token"
|
||||
cookie.Value = token
|
||||
cookie.Path = "/"
|
||||
cookie.HttpOnly = true
|
||||
c.SetCookie(cookie)
|
||||
|
||||
var url string
|
||||
switch userGroup {
|
||||
case "cpone":
|
||||
url = "/one-ui"
|
||||
case "pic":
|
||||
url = "/corp/dashboard_pic"
|
||||
case "patient":
|
||||
url = "/corp/dashboard_pat"
|
||||
default:
|
||||
url = "/one-ui"
|
||||
}
|
||||
|
||||
redirect := `
|
||||
<script>
|
||||
setTimeout(() => {
|
||||
htmx.ajax('GET', '/login/redirect?url=` + url + `', {
|
||||
headers: {
|
||||
Authorization: 'Bearer ` + token + `'
|
||||
}
|
||||
})
|
||||
}, 200)
|
||||
</script>
|
||||
`
|
||||
c.Response().Header().Set("HX-Trigger", "script")
|
||||
return c.String(http.StatusOK, redirect)
|
||||
}
|
||||
|
||||
@@ -80,6 +80,7 @@ func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) {
|
||||
public.POST("login/signin", loginHadlr.HandleSignIn)
|
||||
public.GET("login/redirect", loginHadlr.HandleRedirect)
|
||||
public.GET("login/signout", loginHadlr.HandleSignOut)
|
||||
public.POST("login/autologin", loginHadlr.HandleAutoLoginPage, auth.IsAlreadyLogin)
|
||||
|
||||
// kartu kontrol
|
||||
publicKartuKontrolServices := public_services.NewServicesKartuKontrol(appStore)
|
||||
@@ -157,6 +158,11 @@ func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) {
|
||||
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta", daftarpesertaHandl.HandleShowTabDaftarPeserta)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/changepage", daftarpesertaHandl.HandlePagination)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/openreport", daftarpesertaHandl.HandleOpenReportDialog)
|
||||
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/dialoggenpass", daftarpesertaHandl.HandleDialogGenPass)
|
||||
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/closegenpass", daftarpesertaHandl.HandleCloseDialogGenPass)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/openviewakun", daftarpesertaHandl.HandleOpenViewAkun)
|
||||
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/closeviewakun", daftarpesertaHandl.HandleCloseViewAkun)
|
||||
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/viewakun", daftarpesertaHandl.HandleAkun)
|
||||
|
||||
// tab keuangan
|
||||
keuanganService := mcu_corporate_services.NewTabKeuanganServices(appStore)
|
||||
|
||||
@@ -151,6 +151,29 @@ templ DashboardLayout(
|
||||
@navbaruser
|
||||
</div>
|
||||
<div class="mt-16">
|
||||
// toast
|
||||
<div class="toast-top-right" id="container-system-notification" style="position: absolute; top: 1vh; right: 0vw; z-index: 999;">
|
||||
<!-- toast success -->
|
||||
<div
|
||||
id="notification-001"
|
||||
class="toast fade hide"
|
||||
role="alert"
|
||||
aria-live="assertive"
|
||||
aria-atomic="true"
|
||||
>
|
||||
<div class="toast-header bg-success text-white">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--ep mr-2 icon-xl" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 1024 1024" data-icon="ep:success-filled"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"></path></svg>
|
||||
<strong class="mr-auto">Success</strong>
|
||||
<small class="text-muted text-white">just now</small>
|
||||
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body bg-success-transparent">
|
||||
This is a success toast.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{ children... }
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -58,7 +58,7 @@ func DashboardLayout(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"mt-16\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"mt-16\"><div class=\"toast-top-right\" id=\"container-system-notification\" style=\"position: absolute; top: 1vh; right: 0vw; z-index: 999;\"><!-- toast success --><div id=\"notification-001\" class=\"toast fade hide\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"><div class=\"toast-header bg-success text-white\"><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" role=\"img\" class=\"iconify iconify--ep mr-2 icon-xl\" width=\"1em\" height=\"1em\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 1024 1024\" data-icon=\"ep:success-filled\"><path fill=\"currentColor\" d=\"M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z\"></path></svg> <strong class=\"mr-auto\">Success</strong> <small class=\"text-muted text-white\">just now</small> <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div><div class=\"toast-body bg-success-transparent\">This is a success toast.\r</div></div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ type ModelMcuDaftarPeserta struct {
|
||||
JenisKelamin string `db:"jenisKelamin"`
|
||||
M_PatientDOB string `db:"M_PatientDOB"`
|
||||
Age string `db:"age"`
|
||||
AuthPatientEmail string `db:"authPatientEmail"`
|
||||
AuthPatientIsActive string `db:"authPatientIsActive"`
|
||||
}
|
||||
|
||||
type ModelMcuPesertaReport struct {
|
||||
@@ -37,3 +39,16 @@ type OrderReport struct {
|
||||
M_OrderReportIsActive string `db:"M_OrderReportIsActive"`
|
||||
Datetime string `db:"Datetime"`
|
||||
}
|
||||
|
||||
type GeneratePasswordResponse struct {
|
||||
Status string `json:"status"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type AuthPatient struct {
|
||||
AuthPatientID int `db:"authPatientID"`
|
||||
AuthPatientM_PatientID int `db:"authPatientM_PatientID"`
|
||||
AuthPatientEmail string `db:"authPatientEmail"`
|
||||
AuthPatientPassword string `db:"authPatientPassword"`
|
||||
AuthPatientIsActive string `db:"authPatientIsActive"`
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package mcu_corporate_services
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"go.uber.org/zap"
|
||||
@@ -51,10 +55,13 @@ func (tdps *TabDaftarPesertaServices) GetListMcuDaftarPeserta(id string, current
|
||||
ELSE ' '
|
||||
END AS jenisKelamin,
|
||||
M_PatientDOB,
|
||||
FLOOR(DATEDIFF(CURDATE(), M_PatientDOB)/ 365.25) AS age
|
||||
FLOOR(DATEDIFF(CURDATE(), M_PatientDOB)/ 365.25) AS age,
|
||||
IFNULL(authPatientEmail, "none") AS authPatientEmail,
|
||||
IFNULL(authPatientIsActive, "N") AS authPatientIsActive
|
||||
FROM t_orderheader
|
||||
JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID
|
||||
AND M_PatientIsActive = 'Y'
|
||||
LEFT JOIN auth_patient ON M_PatientID = authPatientM_PatientID AND authPatientIsActive = 'Y'
|
||||
WHERE T_OrderHeaderIsActive = 'Y' AND T_OrderHeaderMgm_McuID = ?
|
||||
ORDER BY T_OrderHeaderLabNumber ASC
|
||||
LIMIT ? OFFSET ?`
|
||||
@@ -239,3 +246,61 @@ func (tdps *TabDaftarPesertaServices) GetListReportPeserta(orderheaderID string,
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func (tdps *TabDaftarPesertaServices) GenerataPasswordMCU(mgmMCUID string, host string) (models.GeneratePasswordResponse, error) {
|
||||
|
||||
// Generate email dan password utk seluruh peserta mgm mcu
|
||||
// https://devcpone.aplikasi.web.id/one-api/tools/auth_patient/generate/<XID>
|
||||
// <XID> : mgmMcuID
|
||||
|
||||
if host == "localhost:5000" {
|
||||
host = "https://devcpone.aplikasi.web.id"
|
||||
}
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret models.GeneratePasswordResponse
|
||||
uri := host + "/one-api/tools/auth_patient/generate/" + mgmMCUID
|
||||
|
||||
payload := []byte{}
|
||||
resp, err := http.Post(uri, "application/json", bytes.NewBuffer(payload))
|
||||
if err != nil {
|
||||
return ret, fmt.Errorf("error request generate password: %v", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return ret, fmt.Errorf("error read body respoonse")
|
||||
}
|
||||
|
||||
if err := json.Unmarshal(body, &ret); err != nil {
|
||||
return ret, fmt.Errorf("error unmarshal json respoonse")
|
||||
}
|
||||
defer logger.Sync()
|
||||
logger.Info("response", zap.Any("data", ret))
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func (tdps *TabDaftarPesertaServices) GetAkunPeserta(patientID string) (models.AuthPatient, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret models.AuthPatient
|
||||
|
||||
q := `
|
||||
SELECT
|
||||
authPatientID,
|
||||
authPatientM_PatientID,
|
||||
authPatientEmail,
|
||||
authPatientPassword,
|
||||
authPatientIsActive
|
||||
FROM auth_patient
|
||||
WHERE authPatientM_PatientID = ?
|
||||
AND authPatientIsActive = 'Y'
|
||||
`
|
||||
if err := dbx.Handlex.Get(&ret, q, patientID); err != nil {
|
||||
return ret, fmt.Errorf("error get akun peserta")
|
||||
}
|
||||
logger.Info("response", zap.Any("data", ret))
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
@@ -67,10 +67,15 @@ func (ls *ServicesLogin) Login(username string, password string) (models.Respons
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (ls *ServicesLogin) MultiSignIn(username string, password string) (models.Response, error) {
|
||||
func (ls *ServicesLogin) MultiSignIn(username string, password string, host string) (models.Response, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret models.Response
|
||||
uri := "https://devcpone.aplikasi.web.id/one-api/v1/system/auth/multi_login"
|
||||
|
||||
if host == "localhost:5000" {
|
||||
host = "https://devcpone.aplikasi.web.id"
|
||||
}
|
||||
|
||||
uri := host + "/one-api/v1/system/auth/multi_login"
|
||||
|
||||
params := url.Values{}
|
||||
params.Add("username", username)
|
||||
|
||||
@@ -29,7 +29,7 @@ templ DialogReport(
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ModalBody(
|
||||
templ ModalRptBody(
|
||||
IDComponent string,
|
||||
tabComponent templ.Component,
|
||||
hxOnLoad templ.ComponentScript,
|
||||
@@ -90,35 +90,4 @@ templ TabReportView(
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
// <div>
|
||||
// <ul class="nav nav-tabs nav-tabs-line">
|
||||
// <li class="nav-item">
|
||||
// <a class="nav-link active" data-toggle="tab" href="#kt_tab_pat_1">Hasil Lab</a>
|
||||
// </li>
|
||||
// <li class="nav-item">
|
||||
// <a class="nav-link" data-toggle="tab" href="#kt_tab_pat_2">Hasil Non Lab</a>
|
||||
// </li>
|
||||
// <li class="nav-item">
|
||||
// <a class="nav-link" data-toggle="tab" href="#kt_tab_pat_3">Hasil Fisik</a>
|
||||
// </li>
|
||||
// <li class="nav-item">
|
||||
// <a class="nav-link" data-toggle="tab" href="#kt_tab_pat_4">Resume Individu</a>
|
||||
// </li>
|
||||
// </ul>
|
||||
// </div>
|
||||
// <div class="tab-content mt-5" id="patTabContent">
|
||||
// <div class="tab-pane fade show active" id="kt_tab_pat_1" role="tabpanel" aria-labelledby="kt_tab_pat_1" style="height: 700px;">
|
||||
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_history.rptdesign&__format=pdf&PID=5&PPatientID=112&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
// </div>
|
||||
// <div class="tab-pane fade" id="kt_tab_pat_2" role="tabpanel" aria-labelledby="kt_tab_pat_2" style="height: 700px;">
|
||||
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_pajanan.rptdesign&__format=pdf&PID=5&PType=fisik&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
// </div>
|
||||
// <div class="tab-pane fade" id="kt_tab_pat_3" role="tabpanel" aria-labelledby="kt_tab_pat_3" style="height: 700px;">
|
||||
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_fisik.rptdesign&__format=pdf&PID=5&PType=fisik&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
// </div>
|
||||
// <div class="tab-pane fade" id="kt_tab_pat_4" role="tabpanel" aria-labelledby="kt_tab_pat_4" style="height: 700px;">
|
||||
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_resume.rptdesign&__format=pdf&PID=1&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
// </div>
|
||||
// </div>
|
||||
}
|
||||
@@ -86,7 +86,7 @@ func DialogReport(
|
||||
})
|
||||
}
|
||||
|
||||
func ModalBody(
|
||||
func ModalRptBody(
|
||||
IDComponent string,
|
||||
tabComponent templ.Component,
|
||||
hxOnLoad templ.ComponentScript,
|
||||
@@ -386,34 +386,3 @@ func TabReportView(
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
// <div>
|
||||
// <ul class="nav nav-tabs nav-tabs-line">
|
||||
// <li class="nav-item">
|
||||
// <a class="nav-link active" data-toggle="tab" href="#kt_tab_pat_1">Hasil Lab</a>
|
||||
// </li>
|
||||
// <li class="nav-item">
|
||||
// <a class="nav-link" data-toggle="tab" href="#kt_tab_pat_2">Hasil Non Lab</a>
|
||||
// </li>
|
||||
// <li class="nav-item">
|
||||
// <a class="nav-link" data-toggle="tab" href="#kt_tab_pat_3">Hasil Fisik</a>
|
||||
// </li>
|
||||
// <li class="nav-item">
|
||||
// <a class="nav-link" data-toggle="tab" href="#kt_tab_pat_4">Resume Individu</a>
|
||||
// </li>
|
||||
// </ul>
|
||||
// </div>
|
||||
// <div class="tab-content mt-5" id="patTabContent">
|
||||
// <div class="tab-pane fade show active" id="kt_tab_pat_1" role="tabpanel" aria-labelledby="kt_tab_pat_1" style="height: 700px;">
|
||||
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_history.rptdesign&__format=pdf&PID=5&PPatientID=112&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
// </div>
|
||||
// <div class="tab-pane fade" id="kt_tab_pat_2" role="tabpanel" aria-labelledby="kt_tab_pat_2" style="height: 700px;">
|
||||
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_pajanan.rptdesign&__format=pdf&PID=5&PType=fisik&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
// </div>
|
||||
// <div class="tab-pane fade" id="kt_tab_pat_3" role="tabpanel" aria-labelledby="kt_tab_pat_3" style="height: 700px;">
|
||||
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_fisik.rptdesign&__format=pdf&PID=5&PType=fisik&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
// </div>
|
||||
// <div class="tab-pane fade" id="kt_tab_pat_4" role="tabpanel" aria-labelledby="kt_tab_pat_4" style="height: 700px;">
|
||||
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_resume.rptdesign&__format=pdf&PID=1&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
// </div>
|
||||
// </div>
|
||||
|
||||
112
views/corporate/mcu/mcutab/modalgeneratepass.templ
Normal file
112
views/corporate/mcu/mcutab/modalgeneratepass.templ
Normal file
@@ -0,0 +1,112 @@
|
||||
package corporate_mcudetail
|
||||
|
||||
import "cpone/component/modal"
|
||||
import "cpone/models"
|
||||
import "cpone/component/customtextfield"
|
||||
|
||||
templ DialogGeneratePass(
|
||||
IDComponent string,
|
||||
postLink string,
|
||||
hxTarget string,
|
||||
hxSwap string,
|
||||
hxInclude string,
|
||||
modalID string,
|
||||
modalTitle string,
|
||||
modalBody templ.Component,
|
||||
modalClose templ.Component,
|
||||
modalAction templ.Component,
|
||||
) {
|
||||
<div>
|
||||
<form
|
||||
id={ IDComponent }
|
||||
class="form"
|
||||
hx-post={ postLink }
|
||||
hx-target={ hxTarget }
|
||||
hx-swap={ hxSwap }
|
||||
hx-include={ hxInclude }
|
||||
hx-indicator=".formloading"
|
||||
>
|
||||
@modalcomponent.Modal(modalID,
|
||||
modalTitle,
|
||||
modalBody,
|
||||
modalAction,
|
||||
modalClose,
|
||||
)
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
|
||||
script HandleFormBeforeRequest() {
|
||||
const btnCancel = document.querySelectorAll('.btncancel');
|
||||
const btnSimpan = document.querySelectorAll('.btnsimpan');
|
||||
|
||||
for (let i = 0; i < btnCancel.length; i++) {
|
||||
btnCancel[i].setAttribute('disabled', 'true');
|
||||
}
|
||||
for (let i = 0; i < btnSimpan.length; i++) {
|
||||
btnSimpan[i].setAttribute('disabled', 'true');
|
||||
}
|
||||
}
|
||||
|
||||
script HandleFormAfterRequest() {
|
||||
const btnCancel = document.querySelectorAll('.btncancel');
|
||||
const btnSimpan = document.querySelectorAll('.btnsimpan');
|
||||
|
||||
for (let i = 0; i < btnCancel.length; i++) {
|
||||
btnCancel[i].removeAttribute('disabled');
|
||||
}
|
||||
for (let i = 0; i < btnSimpan.length; i++) {
|
||||
btnSimpan[i].removeAttribute('disabled');
|
||||
}
|
||||
}
|
||||
|
||||
templ ModalGenPassBody(
|
||||
IDComponent string,
|
||||
message string,
|
||||
hxOnLoad templ.ComponentScript,
|
||||
) {
|
||||
<div id={ IDComponent } hx-on::load={ hxOnLoad }>
|
||||
<p>{ message }</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ModalGenPassAction(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
|
||||
<div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btncancel"
|
||||
data-dismiss="modal"
|
||||
hx-on::after-request={ JsHideModal(modalID) }
|
||||
hx-post={ LinkClose }
|
||||
hx-target={ targetClose }
|
||||
hx-swap={ hxSwapClose }
|
||||
hx-indicator=".cancelloading"
|
||||
>
|
||||
<span class="htmx-indicator spinner-border spinner-border-sm cancelloading" role="status" aria-hidden="true"></span>
|
||||
Batal
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnsimpan"
|
||||
>
|
||||
<span class="htmx-indicator spinner-border spinner-border-sm formloading" role="status" aria-hidden="true"></span>
|
||||
Yakin
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ModalViewAkunBody(
|
||||
IDComponent string,
|
||||
akunID models.CustomTextFieldv2Prm,
|
||||
akunEmail models.CustomTextFieldv2Prm,
|
||||
akunPass models.CustomTextFieldv2Prm,
|
||||
akunPassCek models.CustomTextFieldv2Prm,
|
||||
hxOnLoad templ.ComponentScript,
|
||||
) {
|
||||
<div id={ IDComponent } hx-on::load={ hxOnLoad }>
|
||||
@customtextfield.CustomTextFieldv2(akunID)
|
||||
@customtextfield.CustomTextFieldv2(akunEmail)
|
||||
@customtextfield.CustomTextFieldv2(akunPass)
|
||||
@customtextfield.CustomTextFieldv2(akunPassCek)
|
||||
</div>
|
||||
}
|
||||
388
views/corporate/mcu/mcutab/modalgeneratepass_templ.go
Normal file
388
views/corporate/mcu/mcutab/modalgeneratepass_templ.go
Normal file
@@ -0,0 +1,388 @@
|
||||
// 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/modal"
|
||||
import "cpone/models"
|
||||
import "cpone/component/customtextfield"
|
||||
|
||||
func DialogGeneratePass(
|
||||
IDComponent string,
|
||||
postLink string,
|
||||
hxTarget string,
|
||||
hxSwap string,
|
||||
hxInclude string,
|
||||
modalID string,
|
||||
modalTitle string,
|
||||
modalBody templ.Component,
|
||||
modalClose templ.Component,
|
||||
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("<div><form id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(IDComponent)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modalgeneratepass.templ`, Line: 21, Col: 28}
|
||||
}
|
||||
_, 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("\" class=\"form\" hx-post=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(postLink)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modalgeneratepass.templ`, Line: 23, Col: 30}
|
||||
}
|
||||
_, 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("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modalgeneratepass.templ`, Line: 24, Col: 32}
|
||||
}
|
||||
_, 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("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modalgeneratepass.templ`, Line: 25, Col: 28}
|
||||
}
|
||||
_, 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("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modalgeneratepass.templ`, Line: 26, Col: 34}
|
||||
}
|
||||
_, 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("\" hx-indicator=\".formloading\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = modalcomponent.Modal(modalID,
|
||||
modalTitle,
|
||||
modalBody,
|
||||
modalAction,
|
||||
modalClose,
|
||||
).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</form></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 HandleFormBeforeRequest() templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_HandleFormBeforeRequest_21b5`,
|
||||
Function: `function __templ_HandleFormBeforeRequest_21b5(){const btnCancel = document.querySelectorAll('.btncancel');
|
||||
const btnSimpan = document.querySelectorAll('.btnsimpan');
|
||||
|
||||
for (let i = 0; i < btnCancel.length; i++) {
|
||||
btnCancel[i].setAttribute('disabled', 'true');
|
||||
}
|
||||
for (let i = 0; i < btnSimpan.length; i++) {
|
||||
btnSimpan[i].setAttribute('disabled', 'true');
|
||||
}
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_21b5`),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_21b5`),
|
||||
}
|
||||
}
|
||||
|
||||
func HandleFormAfterRequest() templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_HandleFormAfterRequest_568b`,
|
||||
Function: `function __templ_HandleFormAfterRequest_568b(){const btnCancel = document.querySelectorAll('.btncancel');
|
||||
const btnSimpan = document.querySelectorAll('.btnsimpan');
|
||||
|
||||
for (let i = 0; i < btnCancel.length; i++) {
|
||||
btnCancel[i].removeAttribute('disabled');
|
||||
}
|
||||
for (let i = 0; i < btnSimpan.length; i++) {
|
||||
btnSimpan[i].removeAttribute('disabled');
|
||||
}
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_HandleFormAfterRequest_568b`),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_568b`),
|
||||
}
|
||||
}
|
||||
|
||||
func ModalGenPassBody(
|
||||
IDComponent string,
|
||||
message 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_Var7 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var7 == nil {
|
||||
templ_7745c5c3_Var7 = 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_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(IDComponent)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modalgeneratepass.templ`, Line: 68, Col: 25}
|
||||
}
|
||||
_, 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("\" hx-on::load=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var9 templ.ComponentScript = hxOnLoad
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9.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_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(message)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modalgeneratepass.templ`, Line: 69, Col: 20}
|
||||
}
|
||||
_, 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("</p></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 ModalGenPassAction(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_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("<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 type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btncancel\" data-dismiss=\"modal\" hx-on::after-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var12 templ.ComponentScript = JsHideModal(modalID)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12.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_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modalgeneratepass.templ`, Line: 80, Col: 31}
|
||||
}
|
||||
_, 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-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var14 string
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modalgeneratepass.templ`, Line: 81, Col: 35}
|
||||
}
|
||||
_, 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("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var15 string
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modalgeneratepass.templ`, Line: 82, Col: 33}
|
||||
}
|
||||
_, 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("\" hx-indicator=\".cancelloading\"><span class=\"htmx-indicator spinner-border spinner-border-sm cancelloading\" role=\"status\" aria-hidden=\"true\"></span> Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnsimpan\"><span class=\"htmx-indicator spinner-border spinner-border-sm formloading\" role=\"status\" aria-hidden=\"true\"></span> 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
|
||||
})
|
||||
}
|
||||
|
||||
func ModalViewAkunBody(
|
||||
IDComponent string,
|
||||
akunID models.CustomTextFieldv2Prm,
|
||||
akunEmail models.CustomTextFieldv2Prm,
|
||||
akunPass models.CustomTextFieldv2Prm,
|
||||
akunPassCek models.CustomTextFieldv2Prm,
|
||||
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_Var16 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var16 == nil {
|
||||
templ_7745c5c3_Var16 = 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_Var17 string
|
||||
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(IDComponent)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modalgeneratepass.templ`, Line: 106, Col: 25}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
|
||||
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_Var18 templ.ComponentScript = hxOnLoad
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18.Call)
|
||||
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(akunID).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(akunEmail).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(akunPass).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(akunPassCek).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
|
||||
})
|
||||
}
|
||||
@@ -9,8 +9,14 @@ templ TabDaftarPesertaScreen(
|
||||
paginationID string,
|
||||
dialogReportID string,
|
||||
dialogReportBodyID string,
|
||||
dialogGenPassID string,
|
||||
dialogGenPassBodyID string,
|
||||
dialogAkunID string,
|
||||
dialogAkunBodyID string,
|
||||
content templ.Component,
|
||||
dialogReport templ.Component,
|
||||
dialogGenPass templ.Component,
|
||||
dialogViewAkun templ.Component,
|
||||
) {
|
||||
<div class="container-fluid">
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
|
||||
@@ -29,12 +35,46 @@ templ TabDaftarPesertaScreen(
|
||||
Name: "dialogReportBodyID",
|
||||
Type: "hidden",
|
||||
Value: dialogReportBodyID})
|
||||
<div class="d-flex justify-content-center pt-10 pb-10">
|
||||
<h2 class="title text-black" style="margin-bottom: 0">Daftar Peserta</h2>
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogGenPassID",
|
||||
Name: "dialogGenPassID",
|
||||
Type: "hidden",
|
||||
Value: dialogGenPassID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogGenPassBodyID",
|
||||
Name: "dialogGenPassBodyID",
|
||||
Type: "hidden",
|
||||
Value: dialogGenPassBodyID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAkunID",
|
||||
Name: "dialogAkunID",
|
||||
Type: "hidden",
|
||||
Value: dialogAkunID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAkunBodyID",
|
||||
Name: "dialogAkunBodyID",
|
||||
Type: "hidden",
|
||||
Value: dialogAkunBodyID})
|
||||
<div class="row align-items-center justify-content-center py-10">
|
||||
<div class="col-md-2 col-sm-12 p-0">
|
||||
</div>
|
||||
<div class="col-md-8 col-sm-12 p-0">
|
||||
<h2 class="title text-black" style="margin-bottom: 0; text-align: center;">Daftar Peserta</h2>
|
||||
</div>
|
||||
<div class="col-md-2 d-none d-lg-block d-xl-block d-md-block d-sm-none">
|
||||
<div class="d-flex justify-content-end">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
data-toggle="modal"
|
||||
data-target={"#" + dialogGenPassID}
|
||||
>
|
||||
Generate Password
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="loading-parent" class="rounded">
|
||||
@content
|
||||
@dialogReport
|
||||
@dialogGenPass
|
||||
@dialogViewAkun
|
||||
<div id="loading-child" class="rounded bg-transparent">
|
||||
<div id="loading-spinner" class="spinner-border text-primary d-none" style="width: 3rem; height: 3rem;" role="status">
|
||||
<span class="sr-only">Loading...</span>
|
||||
|
||||
@@ -19,8 +19,14 @@ func TabDaftarPesertaScreen(
|
||||
paginationID string,
|
||||
dialogReportID string,
|
||||
dialogReportBodyID string,
|
||||
dialogGenPassID string,
|
||||
dialogGenPassBodyID string,
|
||||
dialogAkunID string,
|
||||
dialogAkunBodyID string,
|
||||
content templ.Component,
|
||||
dialogReport templ.Component,
|
||||
dialogGenPass templ.Component,
|
||||
dialogViewAkun 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)
|
||||
@@ -66,7 +72,48 @@ func TabDaftarPesertaScreen(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex justify-content-center pt-10 pb-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0\">Daftar Peserta</h2></div><div id=\"loading-parent\" class=\"rounded\">")
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogGenPassID",
|
||||
Name: "dialogGenPassID",
|
||||
Type: "hidden",
|
||||
Value: dialogGenPassID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogGenPassBodyID",
|
||||
Name: "dialogGenPassBodyID",
|
||||
Type: "hidden",
|
||||
Value: dialogGenPassBodyID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAkunID",
|
||||
Name: "dialogAkunID",
|
||||
Type: "hidden",
|
||||
Value: dialogAkunID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAkunBodyID",
|
||||
Name: "dialogAkunBodyID",
|
||||
Type: "hidden",
|
||||
Value: dialogAkunBodyID}).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 justify-content-center py-10\"><div class=\"col-md-2 col-sm-12 p-0\"></div><div class=\"col-md-8 col-sm-12 p-0\"><h2 class=\"title text-black\" style=\"margin-bottom: 0; text-align: center;\">Daftar Peserta</h2></div><div class=\"col-md-2 d-none d-lg-block d-xl-block d-md-block d-sm-none\"><div class=\"d-flex justify-content-end\"><button type=\"button\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs("#" + dialogGenPassID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabdaftarpeserta.templ`, Line: 66, Col: 58}
|
||||
}
|
||||
_, 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("\">Generate Password\r</button></div></div></div><div id=\"loading-parent\" class=\"rounded\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -78,6 +125,14 @@ func TabDaftarPesertaScreen(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = dialogGenPass.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = dialogViewAkun.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-child\" class=\"rounded bg-transparent\"><div id=\"loading-spinner\" class=\"spinner-border text-primary d-none\" style=\"width: 3rem; height: 3rem;\" role=\"status\"><span class=\"sr-only\">Loading...</span></div></div></div><div id=\"loadingcontent\"></div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
@@ -97,9 +152,9 @@ func CSSTabDaftarPeserta() templ.Component {
|
||||
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
|
||||
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("<style>\r\n .container-rpt {\r\n width: 100%;\r\n overflow-x: auto;\r\n white-space: nowrap;\r\n }\r\n </style>")
|
||||
@@ -121,9 +176,9 @@ func JsTabDaftarPeserta() templ.Component {
|
||||
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
|
||||
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var4 == nil {
|
||||
templ_7745c5c3_Var4 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
@@ -180,12 +235,12 @@ func ShowTabDafterPeserta(
|
||||
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_Var5 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var5 == nil {
|
||||
templ_7745c5c3_Var5 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Var6 := 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()
|
||||
@@ -200,7 +255,7 @@ func ShowTabDafterPeserta(
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
templ_7745c5c3_Err = layout.PlaygroundLayout(title, css, js).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = layout.PlaygroundLayout(title, css, js).Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ templ MainKesimpulan(
|
||||
Name: "tableID",
|
||||
Type: "hidden",
|
||||
Value: tableID})
|
||||
<div class="d-flex justify-content-center pt-10 pb-10">
|
||||
<h2 class="title text-black" style="margin-bottom: 0">Kesimpulan</h2>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center py-10">
|
||||
<h2 class="title text-black" style="margin-bottom: 0;">Kesimpulan</h2>
|
||||
</div>
|
||||
@tablecontent
|
||||
@tablecontentnonlab
|
||||
@tablecontentfisik
|
||||
|
||||
@@ -44,7 +44,7 @@ func MainKesimpulan(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex justify-content-center pt-10 pb-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0\">Kesimpulan</h2></div>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex justify-content-center py-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0;\">Kesimpulan</h2></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -17,29 +17,41 @@ templ ContentLayout(
|
||||
templ TableDaftarPeserta(
|
||||
data []models.ModelMcuDaftarPeserta,
|
||||
tableID string,
|
||||
hxGet string,
|
||||
hxTarget string,
|
||||
hxInclude string,
|
||||
hxSwap string,
|
||||
hxGetRpt string,
|
||||
hxTargetRpt string,
|
||||
hxIncludeRpt string,
|
||||
hxSwapRpt string,
|
||||
hxGetAcc string,
|
||||
hxTargetAcc string,
|
||||
hxIncludeAcc string,
|
||||
hxSwapAcc string,
|
||||
) {
|
||||
<div id={ tableID }>
|
||||
@tablecomponent.TableV3([]string{"NOLAB", "NAMA", "JENIS KELAMIN", "UMUR", "KESIMPULAN", "AKSI"},
|
||||
[]string{"15%","20%","10%","10%","30%","15%"},
|
||||
ItemRow(data,
|
||||
hxGet,
|
||||
hxTarget,
|
||||
hxInclude,
|
||||
hxSwap,
|
||||
hxGetRpt,
|
||||
hxTargetRpt,
|
||||
hxIncludeRpt,
|
||||
hxSwapRpt,
|
||||
hxGetAcc,
|
||||
hxTargetAcc,
|
||||
hxIncludeAcc,
|
||||
hxSwapAcc,
|
||||
))
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ItemRow(
|
||||
data []models.ModelMcuDaftarPeserta,
|
||||
hxGet string,
|
||||
hxTarget string,
|
||||
hxInclude string,
|
||||
hxSwap string,
|
||||
hxGetRpt string,
|
||||
hxTargetRpt string,
|
||||
hxIncludeRpt string,
|
||||
hxSwapRpt string,
|
||||
hxGetAcc string,
|
||||
hxTargetAcc string,
|
||||
hxIncludeAcc string,
|
||||
hxSwapAcc string,
|
||||
) {
|
||||
if len(data) == 0 {
|
||||
<tr>
|
||||
@@ -68,11 +80,15 @@ templ ItemRow(
|
||||
-
|
||||
</td>
|
||||
<td>
|
||||
@ItemAction(v.T_OrderHeaderID,
|
||||
hxGet,
|
||||
hxTarget,
|
||||
hxInclude,
|
||||
hxSwap,
|
||||
@ItemAction(v,
|
||||
hxGetRpt,
|
||||
hxTargetRpt,
|
||||
hxIncludeRpt,
|
||||
hxSwapRpt,
|
||||
hxGetAcc,
|
||||
hxTargetAcc,
|
||||
hxIncludeAcc,
|
||||
hxSwapAcc,
|
||||
)
|
||||
</td>
|
||||
</tr>
|
||||
@@ -80,28 +96,50 @@ templ ItemRow(
|
||||
}
|
||||
|
||||
templ ItemAction(
|
||||
id string,
|
||||
hxGet string,
|
||||
hxTarget string,
|
||||
hxInclude string,
|
||||
hxSwap string,
|
||||
data models.ModelMcuDaftarPeserta,
|
||||
hxGetRpt string,
|
||||
hxTargetRpt string,
|
||||
hxIncludeRpt string,
|
||||
hxSwapRpt string,
|
||||
hxGetAcc string,
|
||||
hxTargetAcc string,
|
||||
hxIncludeAcc string,
|
||||
hxSwapAcc string,
|
||||
) {
|
||||
<div class="row px-5 d-flex justify-content-around">
|
||||
<a
|
||||
type="button"
|
||||
class="btn btn-icon"
|
||||
hx-get={ hxGet +"?idx=" + id }
|
||||
hx-target={ hxTarget }
|
||||
hx-swap={ hxSwap }
|
||||
hx-include={ hxInclude }
|
||||
hx-get={ hxGetRpt +"?idx=" + data.T_OrderHeaderID }
|
||||
hx-target={ hxTargetRpt }
|
||||
hx-swap={ hxSwapRpt }
|
||||
hx-include={ hxIncludeRpt }
|
||||
>
|
||||
<i class="flaticon-doc"></i>
|
||||
</a>
|
||||
// <a
|
||||
// class="btn btn-icon"
|
||||
// >
|
||||
// <i class="flaticon2-edit"></i>
|
||||
// </a>
|
||||
if data.AuthPatientEmail != "none" {
|
||||
<a
|
||||
type="button"
|
||||
class="btn btn-icon"
|
||||
hx-get={ hxGetAcc + "?patid=" + data.M_PatientID }
|
||||
hx-target={ hxTargetAcc }
|
||||
hx-swap={ hxSwapAcc }
|
||||
hx-include={ hxIncludeAcc }
|
||||
>
|
||||
<i class="flaticon2-edit"></i>
|
||||
</a>
|
||||
} else {
|
||||
<a
|
||||
type="button"
|
||||
class="btn btn-icon d-none"
|
||||
hx-get={ hxGetAcc + "?patid=" + data.M_PatientID }
|
||||
hx-target={ hxTargetAcc }
|
||||
hx-swap={ hxSwapAcc }
|
||||
hx-include={ hxIncludeAcc }
|
||||
>
|
||||
<i class="flaticon2-edit"></i>
|
||||
</a>
|
||||
}
|
||||
// <a
|
||||
// class="btn btn-icon"
|
||||
// >
|
||||
|
||||
@@ -68,10 +68,14 @@ func ContentLayout(
|
||||
func TableDaftarPeserta(
|
||||
data []models.ModelMcuDaftarPeserta,
|
||||
tableID string,
|
||||
hxGet string,
|
||||
hxTarget string,
|
||||
hxInclude string,
|
||||
hxSwap string,
|
||||
hxGetRpt string,
|
||||
hxTargetRpt string,
|
||||
hxIncludeRpt string,
|
||||
hxSwapRpt string,
|
||||
hxGetAcc string,
|
||||
hxTargetAcc string,
|
||||
hxIncludeAcc string,
|
||||
hxSwapAcc 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)
|
||||
@@ -92,7 +96,7 @@ func TableDaftarPeserta(
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(tableID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 25, Col: 21}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 29, Col: 21}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -105,10 +109,14 @@ func TableDaftarPeserta(
|
||||
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"NOLAB", "NAMA", "JENIS KELAMIN", "UMUR", "KESIMPULAN", "AKSI"},
|
||||
[]string{"15%", "20%", "10%", "10%", "30%", "15%"},
|
||||
ItemRow(data,
|
||||
hxGet,
|
||||
hxTarget,
|
||||
hxInclude,
|
||||
hxSwap,
|
||||
hxGetRpt,
|
||||
hxTargetRpt,
|
||||
hxIncludeRpt,
|
||||
hxSwapRpt,
|
||||
hxGetAcc,
|
||||
hxTargetAcc,
|
||||
hxIncludeAcc,
|
||||
hxSwapAcc,
|
||||
)).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
@@ -126,10 +134,14 @@ func TableDaftarPeserta(
|
||||
|
||||
func ItemRow(
|
||||
data []models.ModelMcuDaftarPeserta,
|
||||
hxGet string,
|
||||
hxTarget string,
|
||||
hxInclude string,
|
||||
hxSwap string,
|
||||
hxGetRpt string,
|
||||
hxTargetRpt string,
|
||||
hxIncludeRpt string,
|
||||
hxSwapRpt string,
|
||||
hxGetAcc string,
|
||||
hxTargetAcc string,
|
||||
hxIncludeAcc string,
|
||||
hxSwapAcc 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)
|
||||
@@ -157,7 +169,7 @@ func ItemRow(
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.T_OrderHeaderLabNumber)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 51, Col: 42}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 63, Col: 42}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -170,7 +182,7 @@ func ItemRow(
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_PatientName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 52, Col: 33}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 64, Col: 33}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -183,7 +195,7 @@ func ItemRow(
|
||||
var templ_7745c5c3_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(v.JenisKelamin)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 53, Col: 32}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 65, Col: 32}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -196,7 +208,7 @@ func ItemRow(
|
||||
var templ_7745c5c3_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(v.Age)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 54, Col: 23}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 66, Col: 23}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -206,11 +218,15 @@ func ItemRow(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ItemAction(v.T_OrderHeaderID,
|
||||
hxGet,
|
||||
hxTarget,
|
||||
hxInclude,
|
||||
hxSwap,
|
||||
templ_7745c5c3_Err = ItemAction(v,
|
||||
hxGetRpt,
|
||||
hxTargetRpt,
|
||||
hxIncludeRpt,
|
||||
hxSwapRpt,
|
||||
hxGetAcc,
|
||||
hxTargetAcc,
|
||||
hxIncludeAcc,
|
||||
hxSwapAcc,
|
||||
).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
@@ -228,11 +244,15 @@ func ItemRow(
|
||||
}
|
||||
|
||||
func ItemAction(
|
||||
id string,
|
||||
hxGet string,
|
||||
hxTarget string,
|
||||
hxInclude string,
|
||||
hxSwap string,
|
||||
data models.ModelMcuDaftarPeserta,
|
||||
hxGetRpt string,
|
||||
hxTargetRpt string,
|
||||
hxIncludeRpt string,
|
||||
hxSwapRpt string,
|
||||
hxGetAcc string,
|
||||
hxTargetAcc string,
|
||||
hxIncludeAcc string,
|
||||
hxSwapAcc 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)
|
||||
@@ -251,9 +271,9 @@ func ItemAction(
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet + "?idx=" + id)
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetRpt + "?idx=" + data.T_OrderHeaderID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 93, Col: 40}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 113, Col: 61}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -264,9 +284,9 @@ func ItemAction(
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var12 string
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetRpt)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 94, Col: 32}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 114, Col: 35}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -277,9 +297,9 @@ func ItemAction(
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapRpt)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 95, Col: 28}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 115, Col: 31}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -290,15 +310,134 @@ func ItemAction(
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var14 string
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeRpt)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 96, Col: 34}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 116, Col: 37}
|
||||
}
|
||||
_, 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("\"><i class=\"flaticon-doc\"></i></a></div>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><i class=\"flaticon-doc\"></i></a> ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if data.AuthPatientEmail != "none" {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\"btn btn-icon\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var15 string
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetAcc + "?patid=" + data.M_PatientID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 124, Col: 64}
|
||||
}
|
||||
_, 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("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var16 string
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetAcc)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 125, Col: 39}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
|
||||
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_Var17 string
|
||||
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapAcc)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 126, Col: 35}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
|
||||
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_Var18 string
|
||||
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeAcc)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 127, Col: 41}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><i class=\"flaticon2-edit\"></i></a>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\"btn btn-icon d-none\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var19 string
|
||||
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetAcc + "?patid=" + data.M_PatientID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 135, Col: 64}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
|
||||
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_Var20 string
|
||||
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetAcc)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 136, Col: 39}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
|
||||
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_Var21 string
|
||||
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapAcc)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 137, Col: 35}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
|
||||
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_Var22 string
|
||||
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeAcc)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 138, Col: 41}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><i class=\"flaticon2-edit\"></i></a>")
|
||||
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
|
||||
}
|
||||
|
||||
@@ -97,10 +97,24 @@ templ CssLogin() {
|
||||
|
||||
templ JsLogin() {
|
||||
<script src="/asset-corporate-portal/js/login-general.js"></script>
|
||||
<script>
|
||||
const param = {
|
||||
token: localStorage.getItem('token')
|
||||
}
|
||||
|
||||
if (param.token) {
|
||||
console.log(param);
|
||||
htmx.ajax('POST', '/login/autologin', {
|
||||
headers: {
|
||||
Authorization: `Bearer ${param.token}`
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
}
|
||||
|
||||
templ ShowLogin(title string, cmp templ.Component, css templ.Component, js templ.Component) {
|
||||
@layout.PlaygroundLayout(title, css, js) {
|
||||
@cmp
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@ func JsLogin() templ.Component {
|
||||
templ_7745c5c3_Var3 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script src=\"/asset-corporate-portal/js/login-general.js\"></script>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script src=\"/asset-corporate-portal/js/login-general.js\"></script><script>\r\n\t\tconst param = {\r\n\t\t\ttoken: localStorage.getItem('token')\r\n\t\t}\r\n\r\n\t\tif (param.token) {\r\n\t\t\tconsole.log(param);\r\n\t\t\thtmx.ajax('POST', '/login/autologin', {\r\n\t\t\t\theaders: {\r\n\t\t\t\t\tAuthorization: `Bearer ${param.token}`\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}\t\t\r\n\t</script>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user