add dialog report

This commit is contained in:
2024-06-18 06:46:35 +07:00
parent e1200fae61
commit fd4f792d8a
8 changed files with 306 additions and 539 deletions

View File

@@ -67,10 +67,10 @@ func (ph *PatientHandler) HandleShowPatient(c echo.Context) error {
}
listingcomponent := corporate_patient.ListingData(listingdata,
listID,
"/corp/dashboard_pat/opencetak",
"/corp/dashboard_pat/open",
"#"+dialogBodyID,
"#listID, #paginationID, #dialogID, #dialogBodyID",
"outerHTML",
"#dialogID, #dialogBodyID",
)
paginationcomponent := pagination.PaginationV3(
@@ -85,28 +85,28 @@ func (ph *PatientHandler) HandleShowPatient(c echo.Context) error {
corporate_patient.AfterRequestContent(),
)
dialogBody := corporate_patient.BodyDialogPat(
bodyModal := corporate_patient.ModalBody(
dialogBodyID,
corporate_patient.JSHideModal(""),
corporate_patient.JsShowModal(""),
)
dialogClose := corporate_patient.BtnClosePat(
"/corp/dashboard_pat/closecetak",
bodyClose := corporate_patient.ModalClose(
"/corp/dashboard_pat/closemodal",
"#"+dialogBodyID,
"outerHTML",
"#"+dialogID,
)
dialogCetak := corporate_patient.PatientDialogForm(
"cetakdialog",
"/corp/dashboard_pat/cetak",
modalDialog := corporate_patient.DialogReport(
"",
"/corp/dashboard_pat/dialog",
"#"+dialogBodyID,
"outerHTML",
"#listID, #paginationID, #dialogID, #dialogBodyID",
"#listID, #paginationID, #dialogID, #dialogBodyID"+paginationID,
dialogID,
"Cetak",
dialogBody,
dialogClose,
title,
bodyModal,
bodyClose,
)
content := corporate_patient.DashboardPat(
@@ -117,7 +117,7 @@ func (ph *PatientHandler) HandleShowPatient(c echo.Context) error {
breadcrumb,
listingcomponent,
paginationcomponent,
dialogCetak,
modalDialog,
)
css := corporate_patient.CSSDashboardPat()
js := corporate_patient.JSDashboardPat()
@@ -150,10 +150,10 @@ func (ph *PatientHandler) HandleChangePage(c echo.Context) error {
}
listcomponent := corporate_patient.ListingData(listData,
listID,
"/corp/dashboard_pat/opencetak",
"/corp/dashboard_pat/open",
"#"+dialogBodyID,
"#listID, #paginationID, #dialogID",
"outerHTML",
"#dialogID, #dialogBodyID",
)
paginationcomponent := pagination.PaginationV3(
@@ -161,7 +161,7 @@ func (ph *PatientHandler) HandleChangePage(c echo.Context) error {
page,
"/corp/dashboard_pat/changepage",
paginationID,
"#listID, #paginationID",
"#listID, #paginationID, #dialogID, #dialogBodyID, #currPage"+paginationID,
"#"+paginationID,
"outerHTML", "", "",
corporate_patient.BeforeRequestContent(),
@@ -173,32 +173,18 @@ func (ph *PatientHandler) HandleChangePage(c echo.Context) error {
return utils.ViewMulti(c, retval)
}
func (ph *PatientHandler) HandleOpenDialog(c echo.Context) error {
func (ph *PatientHandler) HandleOpenReport(c echo.Context) error {
logger, _ := zap.NewProduction()
defer logger.Sync()
id := c.QueryParam("id")
logger.Info("params", zap.Any("id", id))
dialogID := c.QueryParam("dialogID")
dialogBodyID := c.QueryParam("dialogBodyID")
logger.Info("params", zap.Any("id", id))
dialogBody := corporate_patient.BodyDialogPat(
modalBody := corporate_patient.ModalBody(
dialogBodyID,
corporate_patient.JSShowModal("#"+dialogID),
corporate_patient.JsShowModal("#"+dialogID),
)
return utils.View(c, dialogBody)
}
func (ph *PatientHandler) HandleCloseDialog(c echo.Context) error {
// logger, _ := zap.NewProduction()
dialogBodyID := c.QueryParam("dialogBodyID")
dialogBody := corporate_patient.BodyDialogPat(
dialogBodyID,
corporate_patient.JSHideModal(""),
)
return utils.View(c, dialogBody)
return utils.View(c, modalBody)
}

View File

@@ -130,12 +130,7 @@ func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) {
patientHandler := corporate_handlers.NewPatientHandler(patienServices)
corp.GET("/dashboard_pat", patientHandler.HandleShowPatient)
corp.GET("/dashboard_pat/changepage", patientHandler.HandleChangePage)
corp.GET("/dashboard_pat/opencetak", patientHandler.HandleOpenDialog)
corp.POST("/dashboard_pat/closecetak", patientHandler.HandleCloseDialog)
// dev.GET("/md/samplestation/openedit", devMDSampleStationHandlers.HandleOpenEditForm)
// dev.POST("/md/samplestation/edit", devMDSampleStationHandlers.HandleEditMDSS)
// dev.POST("/md/samplestation/closeeditform", devMDSampleStationHandlers.HandleCloseEditForm)
corp.GET("/dashboard_pat/open", patientHandler.HandleOpenReport)
}
func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) {

View File

@@ -6,10 +6,10 @@ import "strconv"
templ ListingData(
data []models.DashboardPatient,
listID string,
hxGetCetak string,
hxTargetCetak string,
hxSwapCetak string,
hxIncludeCetak string,
hxGet string,
hxTarget string,
hxInclude string,
hxSwap string,
) {
<div id={listID} class="align-items-center pt-8 flex-column" hx-swap-oob="true">
<div class="bg-field rounded">
@@ -18,19 +18,19 @@ templ ListingData(
if i == (len(data) - 1) {
<div id={ strconv.Itoa(d.T_OrderHeaderID) } class="card shadow p-8">
@ItemCard(d,
hxGetCetak,
hxTargetCetak,
hxSwapCetak,
hxIncludeCetak,
hxGet,
hxTarget,
hxInclude,
hxSwap,
)
</div>
} else {
<div id={ strconv.Itoa(d.T_OrderHeaderID) } class="card shadow p-8 mb-8">
@ItemCard(d,
hxGetCetak,
hxTargetCetak,
hxSwapCetak,
hxIncludeCetak,
hxGet,
hxTarget,
hxInclude,
hxSwap,
)
</div>
}
@@ -42,10 +42,10 @@ templ ListingData(
templ ItemCard(
data models.DashboardPatient,
hxGetCetak string,
hxTargetCetak string,
hxSwapCetak string,
hxIncludeCetak string,
hxGet string,
hxTarget string,
hxInclude string,
hxSwap string,
) {
<div class="row d-flex align-items-center">
<div class="col-8">
@@ -58,12 +58,10 @@ templ ItemCard(
<a
type="button"
class="btncetak"
hx-get={ hxGetCetak +"?id="+strconv.Itoa(data.T_OrderHeaderID) }
hx-target={ hxTargetCetak }
hx-swap={ hxSwapCetak }
hx-include={ hxIncludeCetak }
hx-on::before-request={ HandleBeforeRequestRow(strconv.Itoa(data.T_OrderHeaderID)) }
hx-on::after-request={ HandleAfterRequestRow(strconv.Itoa(data.T_OrderHeaderID)) }
hx-get={ hxGet +"?id=" + strconv.Itoa(data.T_OrderHeaderID) }
hx-target={ hxTarget }
hx-swap={ hxSwap }
hx-include={ hxInclude }
>
<i class="flaticon-doc"></i>
</a>

View File

@@ -16,10 +16,10 @@ import "strconv"
func ListingData(
data []models.DashboardPatient,
listID string,
hxGetCetak string,
hxTargetCetak string,
hxSwapCetak string,
hxIncludeCetak string,
hxGet string,
hxTarget string,
hxInclude string,
hxSwap 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)
@@ -70,10 +70,10 @@ func ListingData(
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ItemCard(d,
hxGetCetak,
hxTargetCetak,
hxSwapCetak,
hxIncludeCetak,
hxGet,
hxTarget,
hxInclude,
hxSwap,
).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
@@ -101,10 +101,10 @@ func ListingData(
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ItemCard(d,
hxGetCetak,
hxTargetCetak,
hxSwapCetak,
hxIncludeCetak,
hxGet,
hxTarget,
hxInclude,
hxSwap,
).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
@@ -128,10 +128,10 @@ func ListingData(
func ItemCard(
data models.DashboardPatient,
hxGetCetak string,
hxTargetCetak string,
hxSwapCetak string,
hxIncludeCetak string,
hxGet string,
hxTarget string,
hxInclude string,
hxSwap 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)
@@ -171,22 +171,14 @@ func ItemCard(
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h4></div><div class=\"col-1\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleBeforeRequestRow(strconv.Itoa(data.T_OrderHeaderID)), HandleAfterRequestRow(strconv.Itoa(data.T_OrderHeaderID)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\"btncetak\" hx-get=\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h4></div><div class=\"col-1\"><a type=\"button\" class=\"btncetak\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetCetak + "?id=" + strconv.Itoa(data.T_OrderHeaderID))
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet + "?id=" + strconv.Itoa(data.T_OrderHeaderID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\listingpatient.templ`, Line: 61, Col: 78}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\listingpatient.templ`, Line: 61, Col: 75}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
@@ -197,9 +189,9 @@ func ItemCard(
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetCetak)
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\listingpatient.templ`, Line: 62, Col: 41}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\listingpatient.templ`, Line: 62, Col: 36}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
@@ -210,9 +202,9 @@ func ItemCard(
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapCetak)
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\listingpatient.templ`, Line: 63, Col: 37}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\listingpatient.templ`, Line: 63, Col: 32}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
@@ -223,32 +215,14 @@ func ItemCard(
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeCetak)
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\listingpatient.templ`, Line: 64, Col: 43}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\listingpatient.templ`, Line: 64, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(data.T_OrderHeaderID))
_, 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-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(data.T_OrderHeaderID))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><i class=\"flaticon-doc\"></i></a></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err

View File

@@ -106,6 +106,78 @@ script AfterRequestContent() {
}
templ JSDashboardPat() {
<script>
document.addEventListener('htmx:afterSwap', function(event) {
// Reinitialize selectpicker after HTMX content swap
$('.selectpicker').selectpicker('refresh');
});
document.addEventListener('htmx:beforeRequest', function(event) {
console.log("Before Request")
console.log(event.detail.xhr)
console.log(event.detail.target)
});
document.addEventListener('htmx:afterRequest', function(event) {
console.log("After Request")
console.log(event.detail.xhr)
console.log(event.detail.target)
});
document.addEventListener('htmx:historyCacheError', function(event) {
console.log("Error History Cache Error")
console.log(event.detail.cause)
});
document.addEventListener('htmx:historyCacheMissError', function(event) {
console.log("Error History Cache Miss Error")
console.log(event.detail.xhr)
console.log(event.detail.path)
});
document.addEventListener('htmx:oobErrorNoTarget', function(event) {
console.log("Error OOB No Target")
console.log(event.detail.content)
});
document.addEventListener('htmx:onLoadError', function(event) {
console.log("Error On Load")
console.log(event.detail.xhr)
console.log(event.detail.elt)
console.log(event.detail.target)
console.log(event.detail.exception)
console.log(event.detail.requestConfig)
});
document.addEventListener('htmx:responseError', function(event) {
console.log("Error Response")
console.log(event.detail.xhr)
console.log(event.detail.elt)
console.log(event.detail.requestConfig)
});
document.addEventListener('htmx:sendError', function(event) {
console.log("Error Send Error")
console.log(event.detail.xhr)
console.log(event.detail.elt)
console.log(event.detail.requestConfig)
});
document.addEventListener('htmx:sseError', function(event) {
console.log("Error Sse ")
console.log(event.detail.xhr)
console.log(event.detail.error)
console.log(event.detail.source)
});
document.addEventListener('htmx:swapError', function(event) {
console.log("Error Swap Error")
console.log(event.detail.xhr)
console.log(event.detail.elt)
console.log("Target Swap: "+event.detail.target)
console.log(event.detail.requestConfig)
});
document.addEventListener('htmx:targetError', function(event) {
console.log("Error target")
console.log(event.detail.elt)
console.log("Target ID: "+event.detail.target)
});
</script>
}
templ ShowDashboardPat(

View File

@@ -176,6 +176,10 @@ func JSDashboardPat() templ.Component {
templ_7745c5c3_Var3 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script>\r\n\t\tdocument.addEventListener('htmx:afterSwap', function(event) {\r\n\t\t\t// Reinitialize selectpicker after HTMX content swap\r\n\t\t\t$('.selectpicker').selectpicker('refresh');\r\n\t\t});\r\n \r\n document.addEventListener('htmx:beforeRequest', function(event) {\r\n console.log(\"Before Request\")\r\n\t\t\tconsole.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.target)\r\n \r\n });\r\n\r\n document.addEventListener('htmx:afterRequest', function(event) {\r\n console.log(\"After Request\")\r\n console.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.target)\r\n });\r\n document.addEventListener('htmx:historyCacheError', function(event) {\r\n console.log(\"Error History Cache Error\")\r\n console.log(event.detail.cause)\r\n\t\t\t\r\n });\r\n document.addEventListener('htmx:historyCacheMissError', function(event) {\r\n console.log(\"Error History Cache Miss Error\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.path)\r\n\t\t\t\r\n });\r\n document.addEventListener('htmx:oobErrorNoTarget', function(event) {\r\n console.log(\"Error OOB No Target\")\r\n console.log(event.detail.content)\r\n });\r\n document.addEventListener('htmx:onLoadError', function(event) {\r\n console.log(\"Error On Load\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.elt)\r\n console.log(event.detail.target)\r\n console.log(event.detail.exception)\r\n console.log(event.detail.requestConfig)\r\n });\r\n document.addEventListener('htmx:responseError', function(event) {\r\n console.log(\"Error Response\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.elt)\r\n console.log(event.detail.requestConfig)\r\n });\r\n document.addEventListener('htmx:sendError', function(event) {\r\n console.log(\"Error Send Error\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.elt)\r\n console.log(event.detail.requestConfig)\r\n });\r\n document.addEventListener('htmx:sseError', function(event) {\r\n console.log(\"Error Sse \")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.error)\r\n console.log(event.detail.source)\r\n });\r\n\t\tdocument.addEventListener('htmx:swapError', function(event) {\r\n console.log(\"Error Swap Error\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.elt)\r\n console.log(\"Target Swap: \"+event.detail.target)\r\n console.log(event.detail.requestConfig)\r\n });\r\n\t\tdocument.addEventListener('htmx:targetError', function(event) {\r\n console.log(\"Error target\")\r\n console.log(event.detail.elt)\r\n console.log(\"Target ID: \"+event.detail.target)\r\n });\r\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}

View File

@@ -2,31 +2,36 @@ package corporate_patient
import "cpone/component/modal"
templ PatientModal(
id string,
title string,
body templ.Component,
closebtn templ.Component,
templ DialogReport(
IDComponent string,
postLink string,
hxTarget string,
hxSwap string,
hxInclude string,
modalID string,
modalTitle string,
modalBody templ.Component,
modalClose templ.Component,
) {
<div
id="patientmodal"
hx-include="#listID, #paginationID, #modalID, #bodymodal"
>
@modalcomponent.ModalViewXL(id,
title,
body,
closebtn,
)
<div class="">
<div
id={ IDComponent }
hx-include={ hxInclude }
>
@modalcomponent.ModalViewXL(modalID,
modalTitle,
modalBody,
modalClose,
)
</div>
</div>
}
templ BodyModal(
templ ModalBody(
IDComponent string,
hxOnLoad templ.ComponentScript,
) {
<div
id="bodymodal"
hx-on::load={hxOnLoad}
>
<div id={ IDComponent } hx-on::load={ hxOnLoad }>
<div>
<ul class="nav nav-tabs nav-tabs-line">
<li class="nav-item">
@@ -44,104 +49,38 @@ templ BodyModal(
</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: 800px;">
<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_graph_001.rptdesign&__format=pdf&PID=2&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: 800px;">
<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/rpt_mcu_graph_002.rptdesign&__format=pdf&PID=2&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: 800px;">
<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/rpt_mcu_graph_003.rptdesign&__format=pdf&PID=2&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: 800px;">
<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_graph_004.rptdesign&__format=pdf&PID=2&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
</div>
</div>
</div>
</div>
}
templ PatientDialogForm(
componentID string,
linkPost string,
hxTarget string,
hxSwap string,
hxInclude string,
modalID string,
modalTitle string,
dialogBody templ.Component,
dialogClose templ.Component,
) {
<div
id={ componentID }
hx-post={ linkPost }
hx-target={ hxTarget }
hx-swap={ hxSwap }
hx-include={ hxInclude }
hx-on::before-request={ HandleFormBeforeRequest() }
hx-on::after-request={ HandleFormAfterRequest() }
>
@modalcomponent.ModalViewXL(modalID,
modalTitle,
dialogBody,
dialogClose,
)
</div>
script JsHideModal(modalID string) {
$(modalID).modal('hide');
}
script HandleFormBeforeRequest() {
const btnActCancel = document.querySelectorAll('.btnactcancel');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].setAttribute('disabled', 'true');
}
script JsShowModal(modalID string) {
$(modalID).modal('show');
}
script HandleFormAfterRequest() {
const btnActCancel = document.querySelectorAll('.btnactcancel');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].removeAttribute('disabled');
}
}
templ BodyDialogPat(
compoenentID string,
hxOnLoad templ.ComponentScript,
) {
<div id={ compoenentID } hx-on::load={ hxOnLoad }>
TESTING
</div>
<script>
document.addEventListener('htmx:afterSwap', function(event) {
$('.selectpicker').selectpicker('refresh');
})
</script>
}
templ BtnClosePat(linkClose string, targetClose string, hxSwapClose string, modalID string) {
<button
hx-post={ linkClose }
hx-swap={ hxSwapClose }
type="button"
hx-on::after-request={ JSHideModal(modalID) }
class="close btnactcancel"
templ ModalClose(LinkClose string, hxTarget string, hxSwap string, modalID string) {
<button
type="button"
hx-on::after-request={ JsHideModal(modalID) }
class="close"
data-dismiss="modal"
aria-label="Close"
>
<i aria-hidden="true" class="ki ki-close"></i>
</button>
}
script JSHideModal(modalID string) {
$(modalID).modal('hide')
}
script JSShowModal(modalID string) {
$(modalID).modal('show')
const btnActCancel = document.querySelectorAll('.btnactcancel');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].removeAttribute('disabled');
}
}

View File

@@ -12,11 +12,16 @@ import "bytes"
import "cpone/component/modal"
func PatientModal(
id string,
title string,
body templ.Component,
closebtn templ.Component,
func DialogReport(
IDComponent string,
postLink string,
hxTarget string,
hxSwap string,
hxInclude string,
modalID string,
modalTitle string,
modalBody templ.Component,
modalClose 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)
@@ -30,19 +35,45 @@ func PatientModal(
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"patientmodal\" hx-include=\"#listID, #paginationID, #modalID, #bodymodal\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"\"><div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalcomponent.ModalViewXL(id,
title,
body,
closebtn,
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\patient\patientmodal.templ`, Line: 18, 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("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 19, Col: 34}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalcomponent.ModalViewXL(modalID,
modalTitle,
modalBody,
modalClose,
).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -53,7 +84,8 @@ func PatientModal(
})
}
func BodyModal(
func ModalBody(
IDComponent string,
hxOnLoad templ.ComponentScript,
) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
@@ -63,76 +95,89 @@ func BodyModal(
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_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = 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=\"bodymodal\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 templ.ComponentScript = hxOnLoad
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><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: 800px;\"><object data=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs("https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_graph_001.rptdesign&__format=pdf&PID=2&username=adhi&tm=1717726294764")
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 48, Col: 175}
}
_, 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("\" 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: 800px;\"><object data=\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs("https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_graph_002.rptdesign&__format=pdf&PID=2&username=adhi&tm=1717726294764")
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(IDComponent)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 51, Col: 175}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 34, Col: 25}
}
_, 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("\" 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: 800px;\"><object data=\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_graph_003.rptdesign&__format=pdf&PID=2&username=adhi&tm=1717726294764")
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 54, Col: 175}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
var templ_7745c5c3_Var6 templ.ComponentScript = hxOnLoad
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" 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: 800px;\"><object data=\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs("https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_graph_004.rptdesign&__format=pdf&PID=2&username=adhi&tm=1717726294764")
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs("https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_graph_001.rptdesign&__format=pdf&PID=2&username=adhi&tm=1717726294764")
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 57, Col: 175}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 53, Col: 175}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" 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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs("https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_graph_002.rptdesign&__format=pdf&PID=2&username=adhi&tm=1717726294764")
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 56, Col: 175}
}
_, 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("\" 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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs("https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_graph_003.rptdesign&__format=pdf&PID=2&username=adhi&tm=1717726294764")
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 59, Col: 175}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" 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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs("https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_graph_004.rptdesign&__format=pdf&PID=2&username=adhi&tm=1717726294764")
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 62, Col: 175}
}
_, 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("\" type=\"application/pdf\" width=\"100%\" height=\"100%\"></object></div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
@@ -144,17 +189,27 @@ func BodyModal(
})
}
func PatientDialogForm(
componentID string,
linkPost string,
hxTarget string,
hxSwap string,
hxInclude string,
modalID string,
modalTitle string,
dialogBody templ.Component,
dialogClose templ.Component,
) templ.Component {
func JsHideModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JsHideModal_5a6b`,
Function: `function __templ_JsHideModal_5a6b(modalID){$(modalID).modal('hide');
}`,
Call: templ.SafeScript(`__templ_JsHideModal_5a6b`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsHideModal_5a6b`, modalID),
}
}
func JsShowModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JsShowModal_3767`,
Function: `function __templ_JsShowModal_3767(modalID){$(modalID).modal('show');
}`,
Call: templ.SafeScript(`__templ_JsShowModal_3767`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsShowModal_3767`, modalID),
}
}
func ModalClose(LinkClose string, hxTarget string, hxSwap 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 {
@@ -162,111 +217,25 @@ func PatientDialogForm(
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var8 := templ.GetChildren(ctx)
if templ_7745c5c3_Var8 == nil {
templ_7745c5c3_Var8 = templ.NopComponent
templ_7745c5c3_Var11 := templ.GetChildren(ctx)
if templ_7745c5c3_Var11 == nil {
templ_7745c5c3_Var11 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleFormBeforeRequest(), HandleFormAfterRequest())
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("<div id=\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button type=\"button\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 75, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
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_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(linkPost)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 76, Col: 26}
}
_, 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("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 77, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 78, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 79, Col: 30}
}
_, 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-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 templ.ComponentScript = HandleFormBeforeRequest()
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 templ.ComponentScript = HandleFormAfterRequest()
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15.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 = modalcomponent.ModalViewXL(modalID,
modalTitle,
dialogBody,
dialogClose,
).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><i aria-hidden=\"true\" class=\"ki ki-close\"></i></button>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -276,173 +245,3 @@ func PatientDialogForm(
return templ_7745c5c3_Err
})
}
func HandleFormBeforeRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormBeforeRequest_7fcd`,
Function: `function __templ_HandleFormBeforeRequest_7fcd(){const btnActCancel = document.querySelectorAll('.btnactcancel');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].setAttribute('disabled', 'true');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_7fcd`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_7fcd`),
}
}
func HandleFormAfterRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormAfterRequest_b055`,
Function: `function __templ_HandleFormAfterRequest_b055(){const btnActCancel = document.querySelectorAll('.btnactcancel');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].removeAttribute('disabled');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormAfterRequest_b055`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_b055`),
}
}
func BodyDialogPat(
compoenentID 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_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(compoenentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 111, Col: 26}
}
_, 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("\">TESTING\r</div><script>\r\n document.addEventListener('htmx:afterSwap', function(event) {\r\n $('.selectpicker').selectpicker('refresh');\r\n })\r\n </script>")
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 BtnClosePat(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_Var19 := templ.GetChildren(ctx)
if templ_7745c5c3_Var19 == nil {
templ_7745c5c3_Var19 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JSHideModal(modalID))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(linkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 123, Col: 27}
}
_, 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(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\patient\patientmodal.templ`, Line: 124, Col: 29}
}
_, 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("\" type=\"button\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var22 templ.ComponentScript = JSHideModal(modalID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"close btnactcancel\" data-dismiss=\"modal\" aria-label=\"Close\"><i aria-hidden=\"true\" class=\"ki ki-close\"></i></button>")
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 JSHideModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JSHideModal_4530`,
Function: `function __templ_JSHideModal_4530(modalID){$(modalID).modal('hide')
}`,
Call: templ.SafeScript(`__templ_JSHideModal_4530`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JSHideModal_4530`, modalID),
}
}
func JSShowModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JSShowModal_c20c`,
Function: `function __templ_JSShowModal_c20c(modalID){$(modalID).modal('show')
const btnActCancel = document.querySelectorAll('.btnactcancel');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].removeAttribute('disabled');
}
}`,
Call: templ.SafeScript(`__templ_JSShowModal_c20c`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JSShowModal_c20c`, modalID),
}
}