Compare commits
7 Commits
adib/md-no
...
stephen_de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3b988de8f | ||
| 2058220370 | |||
| 6045c459da | |||
| 86264a05e2 | |||
| ae807c1615 | |||
| 88596ac6d9 | |||
|
|
c7a66aae8d |
1315
assets/stephen/isi-hasil-fisik-k3.html
Normal file
1315
assets/stephen/isi-hasil-fisik-k3.html
Normal file
File diff suppressed because it is too large
Load Diff
@@ -40,6 +40,50 @@ templ Navbar(dataUser models.User) {
|
||||
</div>
|
||||
}
|
||||
|
||||
templ NavbarWithLogo(dataUser models.User) {
|
||||
<div id="kt_header" class="header">
|
||||
<!--begin::Container-->
|
||||
<div class="container-fluid d-flex align-items-stretch justify-content-between">
|
||||
<!--begin::Header Menu Wrapper-->
|
||||
<div class="header-menu-wrapper header-menu-wrapper-left" id="kt_header_menu_wrapper">
|
||||
<a class="navbar-brand" href="#">
|
||||
<img
|
||||
src="/asset-corporate-portal/media/landingpage/logo.png"
|
||||
width="126"
|
||||
height="40"
|
||||
class="d-inline-block align-top"
|
||||
alt="Your Brand"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Header Menu Wrapper-->
|
||||
<!--begin::Topbar-->
|
||||
<div class="topbar">
|
||||
<!--begin::User-->
|
||||
<div class="topbar-item">
|
||||
<div
|
||||
class="btn btn-icon btn-icon-mobile w-auto btn-clean d-flex align-items-center btn-lg px-2"
|
||||
id="kt_quick_user_toggle"
|
||||
>
|
||||
<span
|
||||
class="text-muted font-weight-bold font-size-base d-none d-md-inline mr-1"
|
||||
>Hi,</span>
|
||||
<span
|
||||
class="text-dark-50 font-weight-bolder font-size-base d-none d-md-inline mr-3"
|
||||
>{ dataUser.Username }</span>
|
||||
<span class="bg-primary-transparent p-3" style="border-radius: 50%; width: 40px; height: 40px;">
|
||||
<span class="iconify text-primary" data-icon="gravity-ui:person"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::User-->
|
||||
</div>
|
||||
<!--end::Topbar-->
|
||||
</div>
|
||||
<!--end::Container-->
|
||||
</div>
|
||||
}
|
||||
|
||||
templ NavbarMenu(datamenu []models.Menu) {
|
||||
<div class="aside-menu-wrapper flex-column-fluid" id="kt_aside_menu_wrapper">
|
||||
<!--begin::Menu Container-->
|
||||
|
||||
@@ -53,7 +53,7 @@ func Navbar(dataUser models.User) templ.Component {
|
||||
})
|
||||
}
|
||||
|
||||
func NavbarMenu(datamenu []models.Menu) templ.Component {
|
||||
func NavbarWithLogo(dataUser models.User) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
@@ -66,6 +66,43 @@ func NavbarMenu(datamenu []models.Menu) templ.Component {
|
||||
templ_7745c5c3_Var3 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"kt_header\" class=\"header\"><!--begin::Container--><div class=\"container-fluid d-flex align-items-stretch justify-content-between\"><!--begin::Header Menu Wrapper--><div class=\"header-menu-wrapper header-menu-wrapper-left\" id=\"kt_header_menu_wrapper\"><a class=\"navbar-brand\" href=\"#\"><img src=\"/asset-corporate-portal/media/landingpage/logo.png\" width=\"126\" height=\"40\" class=\"d-inline-block align-top\" alt=\"Your Brand\"></a></div><!--end::Header Menu Wrapper--><!--begin::Topbar--><div class=\"topbar\"><!--begin::User--><div class=\"topbar-item\"><div class=\"btn btn-icon btn-icon-mobile w-auto btn-clean d-flex align-items-center btn-lg px-2\" id=\"kt_quick_user_toggle\"><span class=\"text-muted font-weight-bold font-size-base d-none d-md-inline mr-1\">Hi,</span> <span class=\"text-dark-50 font-weight-bolder font-size-base d-none d-md-inline mr-3\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(dataUser.Username)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\navbar\navbar.templ`, Line: 73, Col: 26}
|
||||
}
|
||||
_, 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("</span> <span class=\"bg-primary-transparent p-3\" style=\"border-radius: 50%; width: 40px; height: 40px;\"><span class=\"iconify text-primary\" data-icon=\"gravity-ui:person\"></span></span></div></div><!--end::User--></div><!--end::Topbar--></div><!--end::Container--></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 NavbarMenu(datamenu []models.Menu) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var5 == nil {
|
||||
templ_7745c5c3_Var5 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"aside-menu-wrapper flex-column-fluid\" id=\"kt_aside_menu_wrapper\"><!--begin::Menu Container--><div id=\"kt_aside_menu\" class=\"aside-menu my-4 \" data-menu-vertical=\"1\" data-menu-scroll=\"1\" data-menu-dropdown-timeout=\"500\"><!--begin::Menu Nav--><ul class=\"menu-nav \">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
|
||||
180
handlers/dev/employeeanalytic.handlers.go
Normal file
180
handlers/dev/employeeanalytic.handlers.go
Normal file
@@ -0,0 +1,180 @@
|
||||
package dev_handlers
|
||||
|
||||
import (
|
||||
breadcrumadmin "cpone/component/breadcrumbadmin"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
"cpone/component/pagination"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
"cpone/models"
|
||||
"cpone/services"
|
||||
"cpone/utils"
|
||||
dev_employeeanalytic "cpone/views/dev/employeeanalytic"
|
||||
"strconv"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type EmployeeAnalyticServices interface {
|
||||
GetEmployeeAnalyticBreadcrumb(title string) (models.BreadCrumbV1, error)
|
||||
DummyDataTest() ([]models.EmployeeAnalytic, error)
|
||||
ListingEmployeeAnalytic(search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.EmployeeAnalytic, int, error)
|
||||
}
|
||||
|
||||
type EmployeeAnalyticHandler struct {
|
||||
EmployeeAnalyticServices EmployeeAnalyticServices
|
||||
}
|
||||
|
||||
func NewEmployeeAnalyticHandler(ea EmployeeAnalyticServices) *EmployeeAnalyticHandler {
|
||||
return &EmployeeAnalyticHandler{
|
||||
EmployeeAnalyticServices: ea,
|
||||
}
|
||||
}
|
||||
|
||||
func (ea *EmployeeAnalyticHandler) HandleShowEmployeeAnalyticScreen(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
title := "PT. Sadhana Abiyasa Sampoerna"
|
||||
|
||||
listID := utils.GenerateRandomID("listid")
|
||||
paginationID := utils.GenerateRandomID("paginationid")
|
||||
|
||||
user, err := services.GetUserLogin()
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error get user dev", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
dataBreadcrumb, err := ea.EmployeeAnalyticServices.GetEmployeeAnalyticBreadcrumb(title)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error breadcrumb dev", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
defer logger.Sync()
|
||||
|
||||
navbaruser := navbarmenu.NavbarWithLogo(user)
|
||||
sidbaruser := sidebaruserprofile.Navbaruserprofile(user)
|
||||
breadcrumb := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadcrumb)
|
||||
|
||||
listingData, totalPage, err := ea.EmployeeAnalyticServices.ListingEmployeeAnalytic("", "", "", 1, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error get listing data", zap.Any("error", err), zap.Any("total", totalPage))
|
||||
return err
|
||||
}
|
||||
listingcomponent := dev_employeeanalytic.ListingData(listingData, listID)
|
||||
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
1,
|
||||
"/dev/employeeanalytic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID,
|
||||
"outerHTML", "", "",
|
||||
dev_employeeanalytic.BeforeRequestContent(),
|
||||
dev_employeeanalytic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
filtercomponent := dev_employeeanalytic.FilterListing(
|
||||
"/dev/employeeanalytic/filter",
|
||||
"input changed delay:500ms",
|
||||
"#searchID, #startdateID, #enddateID, #listID, #paginationID",
|
||||
"outerHTML",
|
||||
"#"+paginationID,
|
||||
dev_employeeanalytic.BeforeRequestContent(),
|
||||
dev_employeeanalytic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
content := dev_employeeanalytic.EmployeeAnalyticScreen(
|
||||
listID,
|
||||
paginationID,
|
||||
breadcrumb,
|
||||
filtercomponent,
|
||||
listingcomponent,
|
||||
paginationcomponent,
|
||||
)
|
||||
css := dev_employeeanalytic.CSSEmployeeAnalytic()
|
||||
js := dev_employeeanalytic.JSEmployeeAnalytic()
|
||||
|
||||
view := dev_employeeanalytic.ShowEmployeeAnalytic(title, content, css, js, navbaruser, sidbaruser)
|
||||
return utils.View(c, view)
|
||||
}
|
||||
|
||||
func (ea *EmployeeAnalyticHandler) HandlePagination(c echo.Context) error {
|
||||
|
||||
pageparam := c.QueryParam("page")
|
||||
listID := c.QueryParam("listID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
search := c.QueryParam("search")
|
||||
startdate := c.QueryParam("startdate")
|
||||
enddate := c.QueryParam("enddate")
|
||||
|
||||
var retVal []templ.Component
|
||||
logger, _ := zap.NewProduction()
|
||||
page, err := strconv.Atoi(pageparam)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error convert page param")
|
||||
return err
|
||||
}
|
||||
|
||||
listdata, totalPage, err := ea.EmployeeAnalyticServices.ListingEmployeeAnalytic(search, startdate, enddate, page, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error convert page param")
|
||||
return err
|
||||
}
|
||||
listcomponent := dev_employeeanalytic.ListingData(listdata, listID)
|
||||
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
page,
|
||||
"/dev/employeeanalytic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID,
|
||||
"outerHTML", "", "",
|
||||
dev_employeeanalytic.BeforeRequestContent(),
|
||||
dev_employeeanalytic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
retVal = append(retVal, listcomponent)
|
||||
retVal = append(retVal, paginationcomponent)
|
||||
return utils.ViewMulti(c, retVal)
|
||||
}
|
||||
|
||||
func (ea *EmployeeAnalyticHandler) HandleFilter(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
search := c.QueryParam("search")
|
||||
startdate := c.QueryParam("startdate")
|
||||
enddate := c.QueryParam("enddate")
|
||||
listID := c.QueryParam("listID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
|
||||
dataList, totalPage, err := ea.EmployeeAnalyticServices.ListingEmployeeAnalytic(search, startdate, enddate, 1, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error Get Listing Data", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
listcomponent := dev_employeeanalytic.ListingData(dataList, listID)
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage, 1,
|
||||
"/dev/employeeanalytic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID, "outerHTML", "", "",
|
||||
dev_employeeanalytic.BeforeRequestContent(),
|
||||
dev_employeeanalytic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
var retval []templ.Component
|
||||
retval = append(retval, listcomponent)
|
||||
retval = append(retval, paginationcomponent)
|
||||
return utils.ViewMulti(c, retval)
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -66,6 +66,7 @@ func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) {
|
||||
l := public_services.NewServicesLandingPage(public_services.LandingPage{}, appStore)
|
||||
lh := public_handlers.NewLandingPageHandler(l)
|
||||
public.GET("landingpage", lh.ShowLandingPage)
|
||||
public.GET("home", lh.ShowLandingPage)
|
||||
loginHdr := public_handlers.NewLoginHandler(l)
|
||||
public.GET("login", loginHdr.HandlerShowLogin)
|
||||
|
||||
@@ -232,6 +233,13 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
|
||||
// clientgroup.GET("/usergroup/edit", mastermenuusergroupHandler.ChangeFormEdit)
|
||||
// clientgroup.GET("/usergroup/pagination", mastermenuusergroupHandler.HandleChangePage)
|
||||
|
||||
// employee analytic
|
||||
devEmplAnaServices := dev_services.NewEmployeeAnalyticServices(appStore)
|
||||
devEmplAnaHandler := dev_handlers.NewEmployeeAnalyticHandler(devEmplAnaServices)
|
||||
dev.GET("/employeeanalytic", devEmplAnaHandler.HandleShowEmployeeAnalyticScreen)
|
||||
dev.GET("/employeeanalytic/changepage", devEmplAnaHandler.HandlePagination)
|
||||
dev.GET("/employeeanalytic/filter", devEmplAnaHandler.HandleFilter)
|
||||
|
||||
// group result
|
||||
devGRServices := dev_services.NewServicesGroupResult(appStore)
|
||||
devGRhandlers := dev_handlers.NewGroupResultHandler(devGRServices)
|
||||
@@ -278,20 +286,6 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
|
||||
dev.POST("/md/samplestation/edit", devMDSampleStationHandlers.HandleEditMDSS)
|
||||
dev.POST("/md/samplestation/closeeditform", devMDSampleStationHandlers.HandleCloseEditForm)
|
||||
|
||||
// md nonlab template
|
||||
devMDNonlabTemplateServices := dev_services.NewMDNonlabTemplateServices(appStore)
|
||||
devMDNonlabTemplateHandlers := dev_handlers.NewMDNonLabTemplateHandler(devMDNonlabTemplateServices)
|
||||
dev.GET("/md/nonlabtemplate", devMDNonlabTemplateHandlers.HandleShowNonlabTemplateScreen)
|
||||
dev.GET("/md/nonlabtemplate/filter", devMDNonlabTemplateHandlers.HandleFilterNonlabTemplate)
|
||||
dev.GET("/md/nonlabtemplate/changepage", devMDNonlabTemplateHandlers.HandleNonlabTempltPagination)
|
||||
dev.GET("/md/nonlabtemplate/opendelete", devMDNonlabTemplateHandlers.HandleOpenFormDelete)
|
||||
dev.POST("/md/nonlabtemplate/closedeleteform", devMDNonlabTemplateHandlers.HandleCloseFormDelete)
|
||||
dev.POST("/md/nonlabtemplate/delete", devMDNonlabTemplateHandlers.HandleDelete)
|
||||
dev.POST("/md/nonlabtemplate/simpanama", devMDNonlabTemplateHandlers.HandleSimpanNama)
|
||||
dev.POST("/md/nonlabtemplate/closeaddform", devMDNonlabTemplateHandlers.HandleCloseFormAdd)
|
||||
dev.POST("/md/nonlabtemplate/adddetail", devMDNonlabTemplateHandlers.HandleAddDetail)
|
||||
dev.POST("/md/nonlabtemplate/deletedetail", devMDNonlabTemplateHandlers.HandleDeleteDetail)
|
||||
|
||||
// masterdata nat unit
|
||||
devMdNatUnitServices := dev_services.NewMdNatUnitServices(appStore)
|
||||
devMdNatUnitHandlers := dev_handlers.NeWMdNatUnitHandler(devMdNatUnitServices)
|
||||
|
||||
174
layout/layout_employee_analytic.templ
Normal file
174
layout/layout_employee_analytic.templ
Normal file
@@ -0,0 +1,174 @@
|
||||
package layout
|
||||
|
||||
templ EmployeeAnalyticLayout(
|
||||
title string,
|
||||
css templ.Component,
|
||||
js templ.Component,
|
||||
navbaruser templ.Component,
|
||||
sidebaruser templ.Component,
|
||||
) {
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--begin::Head-->
|
||||
<head>
|
||||
<base href="/"/>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Company Portal | { title }</title>
|
||||
<meta name="description" content="Company Portal"/>
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||||
/>
|
||||
<!--begin::Fonts-->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/poppins.css"
|
||||
/>
|
||||
<!--end::Fonts-->
|
||||
<!--begin::Page Custom Styles(used by this page)-->
|
||||
<link
|
||||
href="assets/css/pages/login/login-1.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!--end::Page Custom Styles-->
|
||||
<!--begin::Global Theme Styles(used by all pages)-->
|
||||
<link
|
||||
href="assets/plugins/global/plugins.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/plugins/custom/prismjs/prismjs.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css"/>
|
||||
<!--end::Global Theme Styles-->
|
||||
<!--begin::Layout Themes(used by all pages)-->
|
||||
<link
|
||||
href="assets/css/themes/layout/header/base/light.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/header/menu/light.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/brand/dark.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/aside/dark.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!--end::Layout Themes-->
|
||||
<link
|
||||
rel="shortcut icon"
|
||||
href="asset-corporate-portal/media/logo/logo-small.jpg"
|
||||
/>
|
||||
<!--end::Layout Themes SAS-->
|
||||
<link
|
||||
href="asset-corporate-portal/css/sas.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/publicsans.css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/roboto.css"
|
||||
/>
|
||||
<!-- slick -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
href="assets/css/slick/slick.css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
href="assets/css/slick/slick-theme.css"
|
||||
/>
|
||||
@css
|
||||
</head>
|
||||
<!--end::Head-->
|
||||
<!--begin::Body-->
|
||||
<body id="kt_body" class="header-fixed header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading bg-white">
|
||||
<script src="assets/js/htmx/htmx.min.js"></script>
|
||||
<!--start::Navbar Mobile-->
|
||||
<div id="kt_header_mobile" class="header-mobile align-items-center header-mobile-fixed ">
|
||||
<!--begin::Logo-->
|
||||
<a href="index.html">
|
||||
<img alt="Logo" src="asset-corporate-portal/media/logo/logo.png" style="object-fit: contain;height: 4vh;"/>
|
||||
</a>
|
||||
<!--end::Logo-->
|
||||
<!--begin::Toolbar-->
|
||||
<div class="d-flex align-items-center">
|
||||
<!--begin::Topbar Mobile Toggle-->
|
||||
<button class="btn btn-hover-text-primary p-0 ml-2" id="kt_header_mobile_topbar_toggle">
|
||||
<span class="svg-icon svg-icon-xl">
|
||||
<!--begin::Svg Icon | path:/assets/media/svg/icons/General/User.svg-->
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="24px"
|
||||
height="24px"
|
||||
viewBox="0 0 24 24"
|
||||
version="1.1"
|
||||
>
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon points="0 0 24 0 24 24 0 24"></polygon>
|
||||
<path
|
||||
d="M12,11 C9.790861,11 8,9.209139 8,7 C8,4.790861 9.790861,3 12,3 C14.209139,3 16,4.790861 16,7 C16,9.209139 14.209139,11 12,11 Z"
|
||||
fill="#000000"
|
||||
fill-rule="nonzero"
|
||||
opacity="0.3"
|
||||
></path>
|
||||
<path
|
||||
d="M3.00065168,20.1992055 C3.38825852,15.4265159 7.26191235,13 11.9833413,13 C16.7712164,13 20.7048837,15.2931929 20.9979143,20.2 C21.0095879,20.3954741 20.9979143,21 20.2466999,21 C16.541124,21 11.0347247,21 3.72750223,21 C3.47671215,21 2.97953825,20.45918 3.00065168,20.1992055 Z"
|
||||
fill="#000000"
|
||||
fill-rule="nonzero"
|
||||
></path>
|
||||
</g>
|
||||
</svg><!--end::Svg Icon-->
|
||||
</span>
|
||||
</button>
|
||||
<!--end::Topbar Mobile Toggle-->
|
||||
</div>
|
||||
<!--end::Toolbar-->
|
||||
</div>
|
||||
<!--start::Navbar Mobile-->
|
||||
<!--start::Navbar Laptop With Sidebar-->
|
||||
<div class="mb-24 mt-8" style="padding-left: 10vw; padding-right: 10vw;">
|
||||
<div class="align-item-center">
|
||||
@navbaruser
|
||||
</div>
|
||||
<div class="mt-16">
|
||||
{ children... }
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Navbar Laptop With Sidebar-->
|
||||
@sidebaruser
|
||||
<!--begin::Global Config(global config for global JS scripts)-->
|
||||
<script src="asset-corporate-portal/js/ktappsetting.js"></script>
|
||||
<!--end::Global Config-->
|
||||
<!--begin::Global Theme Bundle(used by all pages)-->
|
||||
<script src="assets/plugins/global/plugins.bundle.js"></script>
|
||||
<script src="assets/plugins/custom/prismjs/prismjs.bundle.js"></script>
|
||||
<script src="assets/js/scripts.bundle.js"></script>
|
||||
<!--end::Global Theme Bundle-->
|
||||
<script src="assets/js/iconify/iconify.min.js"></script>
|
||||
// bootstrap datepicker
|
||||
<script src="assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js"></script>
|
||||
@js
|
||||
<!--end::Page Scripts-->
|
||||
</body>
|
||||
</html>
|
||||
}
|
||||
94
layout/layout_employee_analytic_templ.go
Normal file
94
layout/layout_employee_analytic_templ.go
Normal file
@@ -0,0 +1,94 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package layout
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
func EmployeeAnalyticLayout(
|
||||
title string,
|
||||
css templ.Component,
|
||||
js templ.Component,
|
||||
navbaruser templ.Component,
|
||||
sidebaruser 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("<!doctype html><html lang=\"en\"><!--begin::Head--><head><base href=\"/\"><meta charset=\"utf-8\"><title>Company Portal | ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `layout\layout_employee_analytic.templ`, Line: 16, Col: 34}
|
||||
}
|
||||
_, 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("</title><meta name=\"description\" content=\"Company Portal\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"><!--begin::Fonts--><link rel=\"stylesheet\" href=\"assets/css/googlefont/poppins.css\"><!--end::Fonts--><!--begin::Page Custom Styles(used by this page)--><link href=\"assets/css/pages/login/login-1.css\" rel=\"stylesheet\" type=\"text/css\"><!--end::Page Custom Styles--><!--begin::Global Theme Styles(used by all pages)--><link href=\"assets/plugins/global/plugins.bundle.css\" rel=\"stylesheet\" type=\"text/css\"><link href=\"assets/plugins/custom/prismjs/prismjs.bundle.css\" rel=\"stylesheet\" type=\"text/css\"><link href=\"assets/css/style.bundle.css\" rel=\"stylesheet\" type=\"text/css\"><!--end::Global Theme Styles--><!--begin::Layout Themes(used by all pages)--><link href=\"assets/css/themes/layout/header/base/light.css\" rel=\"stylesheet\" type=\"text/css\"><link href=\"assets/css/themes/layout/header/menu/light.css\" rel=\"stylesheet\" type=\"text/css\"><link href=\"assets/css/themes/layout/brand/dark.css\" rel=\"stylesheet\" type=\"text/css\"><link href=\"assets/css/themes/layout/aside/dark.css\" rel=\"stylesheet\" type=\"text/css\"><!--end::Layout Themes--><link rel=\"shortcut icon\" href=\"asset-corporate-portal/media/logo/logo-small.jpg\"><!--end::Layout Themes SAS--><link href=\"asset-corporate-portal/css/sas.bundle.css\" rel=\"stylesheet\" type=\"text/css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/publicsans.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/roboto.css\"><!-- slick --><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/slick/slick.css\"><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/slick/slick-theme.css\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = css.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</head><!--end::Head--><!--begin::Body--><body id=\"kt_body\" class=\"header-fixed header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading bg-white\"><script src=\"assets/js/htmx/htmx.min.js\"></script><!--start::Navbar Mobile--><div id=\"kt_header_mobile\" class=\"header-mobile align-items-center header-mobile-fixed \"><!--begin::Logo--><a href=\"index.html\"><img alt=\"Logo\" src=\"asset-corporate-portal/media/logo/logo.png\" style=\"object-fit: contain;height: 4vh;\"></a><!--end::Logo--><!--begin::Toolbar--><div class=\"d-flex align-items-center\"><!--begin::Topbar Mobile Toggle--><button class=\"btn btn-hover-text-primary p-0 ml-2\" id=\"kt_header_mobile_topbar_toggle\"><span class=\"svg-icon svg-icon-xl\"><!--begin::Svg Icon | path:/assets/media/svg/icons/General/User.svg--><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" version=\"1.1\"><g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"><polygon points=\"0 0 24 0 24 24 0 24\"></polygon> <path d=\"M12,11 C9.790861,11 8,9.209139 8,7 C8,4.790861 9.790861,3 12,3 C14.209139,3 16,4.790861 16,7 C16,9.209139 14.209139,11 12,11 Z\" fill=\"#000000\" fill-rule=\"nonzero\" opacity=\"0.3\"></path> <path d=\"M3.00065168,20.1992055 C3.38825852,15.4265159 7.26191235,13 11.9833413,13 C16.7712164,13 20.7048837,15.2931929 20.9979143,20.2 C21.0095879,20.3954741 20.9979143,21 20.2466999,21 C16.541124,21 11.0347247,21 3.72750223,21 C3.47671215,21 2.97953825,20.45918 3.00065168,20.1992055 Z\" fill=\"#000000\" fill-rule=\"nonzero\"></path></g></svg><!--end::Svg Icon--></span></button><!--end::Topbar Mobile Toggle--></div><!--end::Toolbar--></div><!--start::Navbar Mobile--><!--start::Navbar Laptop With Sidebar--><div class=\"mb-24 mt-8\" style=\"padding-left: 10vw; padding-right: 10vw;\"><div class=\"align-item-center\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = navbaruser.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"mt-16\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><!--end::Navbar Laptop With Sidebar-->")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = sidebaruser.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--begin::Global Config(global config for global JS scripts)--><script src=\"asset-corporate-portal/js/ktappsetting.js\"></script><!--end::Global Config--><!--begin::Global Theme Bundle(used by all pages)--><script src=\"assets/plugins/global/plugins.bundle.js\"></script><script src=\"assets/plugins/custom/prismjs/prismjs.bundle.js\"></script><script src=\"assets/js/scripts.bundle.js\"></script><!--end::Global Theme Bundle--><script src=\"assets/js/iconify/iconify.min.js\"></script><script src=\"assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js\"></script>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = js.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--end::Page Scripts--></body></html>")
|
||||
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
|
||||
})
|
||||
}
|
||||
@@ -3,18 +3,6 @@ package layout
|
||||
// LAYOUT PLAYGROUND
|
||||
templ PlaygroundLayout(title string, css templ.Component, js templ.Component) {
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Template Name: Metronic - Bootstrap 4 HTML, React, Angular 9 & VueJS Admin Dashboard Theme
|
||||
Author: KeenThemes
|
||||
Website: http://www.keenthemes.com/
|
||||
Contact: support@keenthemes.com
|
||||
Follow: www.twitter.com/keenthemes
|
||||
Dribbble: www.dribbble.com/keenthemes
|
||||
Like: www.facebook.com/keenthemes
|
||||
Purchase: https://1.envato.market/EA4JP
|
||||
Renew Support: https://1.envato.market/EA4JP
|
||||
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
|
||||
-->
|
||||
<html lang="en">
|
||||
<!--begin::Head-->
|
||||
<head>
|
||||
|
||||
@@ -24,14 +24,14 @@ func PlaygroundLayout(title string, css templ.Component, js templ.Component) tem
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><!--\r\n\t\tTemplate Name: Metronic - Bootstrap 4 HTML, React, Angular 9 & VueJS Admin Dashboard Theme\r\n\t\tAuthor: KeenThemes\r\n\t\tWebsite: http://www.keenthemes.com/\r\n\t\tContact: support@keenthemes.com\r\n\t\tFollow: www.twitter.com/keenthemes\r\n\t\tDribbble: www.dribbble.com/keenthemes\r\n\t\tLike: www.facebook.com/keenthemes\r\n\t\tPurchase: https://1.envato.market/EA4JP\r\n\t\tRenew Support: https://1.envato.market/EA4JP\r\n\t\tLicense: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.\r\n\t\t--><html lang=\"en\"><!--begin::Head--><head><base href=\"/\"><meta charset=\"utf-8\"><title>Company Portal | ")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><html lang=\"en\"><!--begin::Head--><head><base href=\"/\"><meta charset=\"utf-8\"><title>Company Portal | ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `layout\playground_layout.templ`, Line: 23, Col: 34}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `layout\playground_layout.templ`, Line: 11, Col: 34}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
||||
15
models/employeeanalytic.models.go
Normal file
15
models/employeeanalytic.models.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package models
|
||||
|
||||
type EmployeeAnalytic struct {
|
||||
Mgm_McuID int `db:"Mgm_McuID"`
|
||||
Mgm_McuLabel string `db:"Mgm_McuLabel"`
|
||||
Mgm_McuFlagRelasiBayarSendiri string `db:"Mgm_McuFlagRelasiBayarSendiri"`
|
||||
Mgm_McuBisaTambahPemeriksaan string `db:"Mgm_McuBisaTambahPemeriksaan"`
|
||||
Mgm_McuCorporateID int `db:"Mgm_McuCorporateID"`
|
||||
Mgm_McuNumber string `db:"Mgm_McuNumber"`
|
||||
Mgm_McuNumberNational string `db:"Mgm_McuNumberNational"`
|
||||
Mgm_McuNote string `db:"Mgm_McuNote"`
|
||||
Mgm_McuStartDate string `db:"Mgm_McuStartDate"`
|
||||
Mgm_McuEndDate string `db:"Mgm_McuEndDate"`
|
||||
Mgm_McuIsActive string `db:"Mgm_McuIsActive"`
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package models
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
|
||||
type MDNonlabTemplate struct {
|
||||
NonlabTemplateID int `db:"NonlabTemplateID"`
|
||||
NonlabTemplateName string `db:"NonlabTemplateName"`
|
||||
NonlabTemplateFlagFisik string `db:"NonlabTemplateFlagFisik"`
|
||||
NonlabTemplateIsActive string `db:"NonlabTemplateIsActive"`
|
||||
NonlabTemplateCreated string `db:"NonlabTemplateCreated"`
|
||||
NonlabTemplateCreatedUserID string `db:"NonlabTemplateUserID"`
|
||||
NonlabTemplateLastUpdated string `db:"NonlabTemplateLastUpdated"`
|
||||
NonlabTemplateLastUpdatedUserID string `db:"NonlabTemplateLastUpdatedUserID"`
|
||||
NonlabTemplateDelete string `db:"NonlabTemplateDelete"`
|
||||
NonlabTemplateDeleteUserID string `db:"NonlabTemplateDeleteUserID"`
|
||||
}
|
||||
|
||||
type NonlabTemplateDetail struct {
|
||||
NonlabTemplateDetailID int `db:"NonlabTemplateDetailID"`
|
||||
NonlabTemplateDetailNonlabTemplateID int `db:"NonlabTemplateDetailNonlabTemplateID"`
|
||||
NonlabTemplateDetailCode string `db:"NonlabTemplateDetailCode"`
|
||||
NonlabTemplateDetailName string `db:"NonlabTemplateDetailName"`
|
||||
NonlabTemplateDetaiNat_UnitID string `db:"NonlabTemplateDetaiNat_UnitID"`
|
||||
NonlabTemplateDetailFlagActive string `db:"NonlabTemplateDetailFlagActive"`
|
||||
NonlabTemplateDetaiM_LangID string `db:"NonlabTemplateDetaiM_LangID"`
|
||||
NonlabTemplateDetailIsActive string `db:"NonlabTemplateDetailIsActive"`
|
||||
}
|
||||
|
||||
type MDNonlabTemplateForm struct {
|
||||
IDComponent string
|
||||
Link string
|
||||
HxTarget string
|
||||
HxSwap string
|
||||
HxInclude string
|
||||
ModalID string
|
||||
ModalTitle string
|
||||
InputID CustomTextFieldv2Prm
|
||||
InputName CustomTextFieldv2Prm
|
||||
InputFlag CustomCheckboxv1Prm
|
||||
DialogBody templ.Component
|
||||
DialogAction templ.Component
|
||||
ButtonClose templ.Component
|
||||
}
|
||||
@@ -16,6 +16,10 @@ import (
|
||||
var Handle *sql.DB
|
||||
var Handlex *sqlx.DB
|
||||
|
||||
// log
|
||||
var HandleLog *sql.DB
|
||||
var HandlexLog *sqlx.DB
|
||||
|
||||
func InitDB() {
|
||||
println(config.Data.Get("DBhost"))
|
||||
if config.Data.Get("DBhost") == "" {
|
||||
@@ -28,6 +32,15 @@ func InitDB() {
|
||||
}
|
||||
Handle = handle
|
||||
|
||||
// log handle
|
||||
handlelog, err := sql.Open("sqlite", config.Data.Get("DBnamelog"))
|
||||
if err != nil {
|
||||
// log.Fatalf("🔥 failed to connect to the database: %s", err.Error())
|
||||
log.Panic(err)
|
||||
}
|
||||
HandleLog = handlelog
|
||||
// log handle
|
||||
|
||||
db, err := sqlx.Open("sqlite", config.Data.Get("DBname"))
|
||||
|
||||
if err != nil {
|
||||
@@ -35,6 +48,16 @@ func InitDB() {
|
||||
}
|
||||
|
||||
Handlex = db
|
||||
|
||||
// log
|
||||
dblog, err := sqlx.Open("sqlite", config.Data.Get("DBnamelog"))
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
HandlexLog = dblog
|
||||
// log
|
||||
} else {
|
||||
println("mysql")
|
||||
dsn := config.Data.Get("DBuser") + ":" + config.Data.Get("DBpass") + "@tcp(" + config.Data.Get("DBhost") + ":" + config.Data.Get("DBport") + ")/" + config.Data.Get("DBname")
|
||||
@@ -50,6 +73,21 @@ func InitDB() {
|
||||
}
|
||||
Handle = handle
|
||||
|
||||
// log
|
||||
dsnlog := config.Data.Get("DBuser") + ":" + config.Data.Get("DBpass") + "@tcp(" + config.Data.Get("DBhost") + ":" + config.Data.Get("DBport") + ")/" + config.Data.Get("DBnamelog")
|
||||
println(dsnlog)
|
||||
handlelog, err := sql.Open("mysql", dsnlog)
|
||||
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
if err = handlelog.Ping(); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
HandleLog = handlelog
|
||||
// log
|
||||
|
||||
// sqlx
|
||||
db, err := sqlx.Open("mysql", dsn)
|
||||
|
||||
@@ -59,6 +97,16 @@ func InitDB() {
|
||||
|
||||
Handlex = db
|
||||
|
||||
// log
|
||||
dblog, err := sqlx.Open("mysql", dsnlog)
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
HandlexLog = dblog
|
||||
// log
|
||||
|
||||
}
|
||||
log.Println("🚀 Connected Successfully to the Database")
|
||||
|
||||
|
||||
128
services/dev/employeeanalytic.services.go
Normal file
128
services/dev/employeeanalytic.services.go
Normal file
@@ -0,0 +1,128 @@
|
||||
package dev_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type EmployeeAnalyticServices struct {
|
||||
EmployeeAnalyticStore db.AppStore
|
||||
}
|
||||
|
||||
func NewEmployeeAnalyticServices(uStore db.AppStore) *EmployeeAnalyticServices {
|
||||
return &EmployeeAnalyticServices{
|
||||
EmployeeAnalyticStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
func (ea *EmployeeAnalyticServices) GetEmployeeAnalyticBreadcrumb(title string) (models.BreadCrumbV1, error) {
|
||||
breadcrumb := models.BreadCrumbV1{
|
||||
Title: title,
|
||||
Item: []models.ItemBreadCrumbV1{
|
||||
{
|
||||
Item: "Dashboard",
|
||||
Url: "/dev/dashboard",
|
||||
},
|
||||
{
|
||||
Item: "Employee Health Medical Analytic",
|
||||
Url: "",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return breadcrumb, nil
|
||||
}
|
||||
|
||||
func (ea *EmployeeAnalyticServices) DummyDataTest() ([]models.EmployeeAnalytic, error) {
|
||||
employees := []models.EmployeeAnalytic{
|
||||
{
|
||||
Mgm_McuID: 1,
|
||||
Mgm_McuLabel: "Employee 1",
|
||||
Mgm_McuFlagRelasiBayarSendiri: "Yes",
|
||||
Mgm_McuBisaTambahPemeriksaan: "No",
|
||||
Mgm_McuCorporateID: 101,
|
||||
Mgm_McuNumber: "EMP001",
|
||||
Mgm_McuNumberNational: "NAT001",
|
||||
Mgm_McuNote: "Lorem ipsum dolor sit amet.",
|
||||
Mgm_McuStartDate: "2024-01-01",
|
||||
Mgm_McuEndDate: "2024-12-31",
|
||||
Mgm_McuIsActive: "Y",
|
||||
},
|
||||
{
|
||||
Mgm_McuID: 2,
|
||||
Mgm_McuLabel: "Employee 2",
|
||||
Mgm_McuFlagRelasiBayarSendiri: "No",
|
||||
Mgm_McuBisaTambahPemeriksaan: "Yes",
|
||||
Mgm_McuCorporateID: 102,
|
||||
Mgm_McuNumber: "EMP002",
|
||||
Mgm_McuNumberNational: "NAT002",
|
||||
Mgm_McuNote: "Lorem ipsum dolor sit amet consectetur.",
|
||||
Mgm_McuStartDate: "2024-02-15",
|
||||
Mgm_McuEndDate: "2024-11-30",
|
||||
Mgm_McuIsActive: "Y",
|
||||
},
|
||||
}
|
||||
|
||||
return employees, nil
|
||||
}
|
||||
|
||||
func (ea *EmployeeAnalyticServices) ListingEmployeeAnalytic(search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.EmployeeAnalytic, int, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret []models.EmployeeAnalytic
|
||||
var totalData int
|
||||
|
||||
if len(startdate) == 0 {
|
||||
startdate = "1900-01-01"
|
||||
}
|
||||
if len(enddate) == 0 {
|
||||
enddate = "9999-12-12"
|
||||
}
|
||||
|
||||
prmLabel := "%" + search + "%"
|
||||
offset := (currentpage - 1) * rowperpage
|
||||
q := `
|
||||
SELECT COUNT(*)
|
||||
FROM mgm_mcu
|
||||
WHERE Mgm_McuIsActive = 'Y'
|
||||
AND Mgm_McuLabel LIKE ?
|
||||
AND Mgm_McuStartDate >= ?
|
||||
AND Mgm_McuEndDate <= ?
|
||||
`
|
||||
if err := dbx.Handlex.Get(&totalData, q, prmLabel, startdate, enddate); err != nil {
|
||||
return nil, 0, fmt.Errorf("error query get total data: %v", err)
|
||||
}
|
||||
|
||||
q = `
|
||||
SELECT
|
||||
Mgm_McuID,
|
||||
Mgm_McuLabel,
|
||||
Mgm_McuFlagRelasiBayarSendiri,
|
||||
Mgm_McuBisaTambahPemeriksaan,
|
||||
Mgm_McuCorporateID,
|
||||
Mgm_McuNumber,
|
||||
Mgm_McuNumberNational,
|
||||
Mgm_McuNote,
|
||||
DATE_FORMAT(Mgm_McuStartDate, '%d-%m-%Y') AS Mgm_McuStartDate,
|
||||
DATE_FORMAT(Mgm_McuEndDate, '%d-%m-%Y') AS Mgm_McuEndDate,
|
||||
Mgm_McuIsActive
|
||||
FROM mgm_mcu
|
||||
WHERE Mgm_McuIsActive = 'Y'
|
||||
AND Mgm_McuLabel LIKE ?
|
||||
AND Mgm_McuStartDate >= ?
|
||||
AND Mgm_McuEndDate <= ?
|
||||
ORDER BY Mgm_McuID ASC
|
||||
LIMIT ? OFFSET ?
|
||||
`
|
||||
if err := dbx.Handlex.Select(&ret, q, prmLabel, startdate, enddate, rowperpage, offset); err != nil {
|
||||
return nil, 0, fmt.Errorf("error query get data: %v", err)
|
||||
}
|
||||
logger.Info("Resp", zap.Any("Respsone", ret))
|
||||
|
||||
totalPage := int(math.Ceil(float64(totalData) / float64(rowperpage)))
|
||||
return ret, totalPage, nil
|
||||
}
|
||||
@@ -1,430 +0,0 @@
|
||||
package dev_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type MDNonlabTemplateServices struct {
|
||||
MDNonlabTemplateStore db.AppStore
|
||||
}
|
||||
|
||||
func NewMDNonlabTemplateServices(uStore db.AppStore) *MDNonlabTemplateServices {
|
||||
return &MDNonlabTemplateServices{
|
||||
MDNonlabTemplateStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
func (nlt *MDNonlabTemplateServices) GetMDNonLabTemplateBreadcrumb() (models.BreadCrumbV1, error) {
|
||||
var ret models.BreadCrumbV1
|
||||
|
||||
breadcrumb := models.BreadCrumbV1{
|
||||
Title: "Master Non-lab Template",
|
||||
Item: []models.ItemBreadCrumbV1{
|
||||
{
|
||||
Item: "Dashboard",
|
||||
Url: "/dev/dashboard",
|
||||
},
|
||||
{
|
||||
Item: "Master",
|
||||
Url: "/dev/master",
|
||||
},
|
||||
{
|
||||
Item: "Non-lab Template",
|
||||
Url: "",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
ret = breadcrumb
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func (nlt *MDNonlabTemplateServices) GetListNonlabTemplate(search string, currPage int, rowPerPage int) ([]models.MDNonlabTemplate, int, error) {
|
||||
var ret []models.MDNonlabTemplate
|
||||
var totalData int
|
||||
|
||||
offset := (currPage - 1) * rowPerPage
|
||||
prm := "%" + strings.TrimSpace(search) + "%"
|
||||
query := `
|
||||
SELECT COUNT(*)
|
||||
FROM nonlab_template
|
||||
WHERE NonlabTemplateIsActive = 'Y'
|
||||
AND (NonlabTemplateName LIKE ?)
|
||||
`
|
||||
if err := dbx.Handlex.Get(&totalData, query, prm); err != nil {
|
||||
return nil, 0, fmt.Errorf("error querying databases: %v", err)
|
||||
}
|
||||
|
||||
query = `
|
||||
SELECT
|
||||
NonlabTemplateID,
|
||||
NonlabTemplateName,
|
||||
NonlabTemplateFlagFisik,
|
||||
NonlabTemplateIsActive,
|
||||
NonlabTemplateCreated,
|
||||
NonlabTemplateLastUpdated
|
||||
FROM nonlab_template
|
||||
WHERE NonlabTemplateIsActive = 'Y'
|
||||
AND (NonlabTemplateName LIKE ?)
|
||||
ORDER BY NonlabTemplateID ASC
|
||||
LIMIT ? OFFSET ?
|
||||
`
|
||||
if err := dbx.Handlex.Select(&ret, query, prm, rowPerPage, offset); err != nil {
|
||||
return nil, 0, fmt.Errorf("error querying database: %v", err)
|
||||
}
|
||||
|
||||
totalPage := int(math.Ceil(float64(totalData) / float64(rowPerPage)))
|
||||
|
||||
return ret, totalPage, nil
|
||||
}
|
||||
|
||||
func (nlt *MDNonlabTemplateServices) GetMDNonlabTemplateByID(id string) (models.MDNonlabTemplate, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret models.MDNonlabTemplate
|
||||
|
||||
q := `
|
||||
SELECT
|
||||
NonlabTemplateID,
|
||||
NonlabTemplateName,
|
||||
NonlabTemplateFlagFisik,
|
||||
NonlabTemplateIsActive,
|
||||
NonlabTemplateCreated,
|
||||
NonlabTemplateLastUpdated
|
||||
FROM nonlab_template
|
||||
WHERE NonlabTemplateID = ?
|
||||
`
|
||||
err := dbx.Handlex.Get(&ret, q, id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get data non lab template by id vs",
|
||||
zap.String("ID", id),
|
||||
zap.Error(err),
|
||||
)
|
||||
return ret, fmt.Errorf("QUERY FAILED GET DATA BY ID")
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func (nlt *MDNonlabTemplateServices) DeleteDataNonlabTemplate(id string) (models.MDNonlabTemplate, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret models.MDNonlabTemplate
|
||||
|
||||
q := `
|
||||
UPDATE nonlab_template
|
||||
SET
|
||||
NonlabTemplateIsActive = 'N',
|
||||
NonlabTemplateLastUpdated = NOW()
|
||||
WHERE NonlabTemplateID = ?
|
||||
`
|
||||
dlt := dbx.Handlex.MustExec(q, id)
|
||||
_, err := dlt.RowsAffected()
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error delete nonlab template", zap.String("id", id))
|
||||
return ret, fmt.Errorf("query failed delete non lab template")
|
||||
}
|
||||
|
||||
return nlt.GetMDNonlabTemplateByID(id)
|
||||
}
|
||||
|
||||
func (nlt *MDNonlabTemplateServices) AddNonlabTemplate(nama string, fisik string) (models.MDNonlabTemplate, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret models.MDNonlabTemplate
|
||||
|
||||
var count int
|
||||
var prmName = "%" + nama + "%"
|
||||
q := `
|
||||
SELECT COUNT(*)
|
||||
FROM nonlab_template
|
||||
WHERE NonlabTemplateName LIKE ?
|
||||
AND NonlabTemplateIsActive = 'Y'
|
||||
`
|
||||
err := dbx.Handlex.Get(&count, q, prmName)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("cek duplicate", zap.Any("nama", prmName))
|
||||
return ret, fmt.Errorf("query failed to cek duplicate: %v", err)
|
||||
}
|
||||
if count > 0 {
|
||||
defer logger.Sync()
|
||||
logger.Error("duplicate data", zap.Any("nama", nama))
|
||||
return ret, fmt.Errorf("duplicate nama")
|
||||
}
|
||||
|
||||
q = `
|
||||
INSERT INTO nonlab_template (
|
||||
NonlabTemplateName,
|
||||
NonlabTemplateFlagFisik,
|
||||
NonlabTemplateCreated,
|
||||
NonlabTemplateCreatedUserID
|
||||
) VALUES (?,?,NOW(),1);
|
||||
`
|
||||
rsp := dbx.Handlex.MustExec(q, nama, fisik)
|
||||
insertedID, err := rsp.LastInsertId()
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("error insert data", zap.Any("nama", nama))
|
||||
return ret, fmt.Errorf("failed insert data: %v", err)
|
||||
}
|
||||
|
||||
s := strconv.Itoa(int(insertedID))
|
||||
return nlt.GetMDNonlabTemplateByID(s)
|
||||
}
|
||||
|
||||
func (nlt *MDNonlabTemplateServices) UpdateNonlabTemplate(id string, nama string, fisik string) (models.MDNonlabTemplate, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret models.MDNonlabTemplate
|
||||
|
||||
var count int
|
||||
var prmNama = "%" + nama + "%"
|
||||
q := `
|
||||
SELECT COUNT(*)
|
||||
FROM nonlab_template
|
||||
WHERE NonlabTemplateName LIKE ?
|
||||
AND NonlabTemplateIsActive = 'Y'
|
||||
AND NonlabTemplateID <> ?
|
||||
`
|
||||
err := dbx.Handlex.Get(&count, q, prmNama, id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("cek duplicate", zap.Any("nama", prmNama))
|
||||
return ret, fmt.Errorf("query failed to cek duplicate: %v", err)
|
||||
}
|
||||
if count > 0 {
|
||||
defer logger.Sync()
|
||||
logger.Error("duplicate data", zap.Any("nama", nama))
|
||||
return ret, fmt.Errorf("duplicate nama")
|
||||
}
|
||||
|
||||
q = `
|
||||
UPDATE nonlab_template SET
|
||||
NonlabTemplateName = ?,
|
||||
NonlabTemplateFlagFisik = ?,
|
||||
NonlabTemplateLastUpdated = NOW(),
|
||||
NonlabTemplateLastUpdatedUserID = 1
|
||||
WHERE NonlabTemplateID = ?;
|
||||
`
|
||||
respUpdt := dbx.Handlex.MustExec(q, nama, fisik, id)
|
||||
_, err = respUpdt.RowsAffected()
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("error update data", zap.Any("name", nama))
|
||||
return ret, fmt.Errorf("query failed to update data")
|
||||
}
|
||||
|
||||
return nlt.GetMDNonlabTemplateByID(id)
|
||||
}
|
||||
|
||||
func (nlt *MDNonlabTemplateServices) GetIDNonlabTemplate(name string) (int, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret int
|
||||
|
||||
prmName := "%" + name + "%"
|
||||
q := `
|
||||
SELECT
|
||||
NonlabTemplateID
|
||||
FROM nonlab_template
|
||||
WHERE NonlabTemplateName LIKE ?
|
||||
AND NonlabTemplateIsActive = 'Y'
|
||||
`
|
||||
err := dbx.Handlex.Get(&ret, q, prmName)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get data non lab template by id vs",
|
||||
zap.String("name", prmName),
|
||||
zap.Error(err),
|
||||
)
|
||||
return ret, fmt.Errorf("QUERY FAILED GET DATA BY NAME")
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func (nlt *MDNonlabTemplateServices) GetDetailByID(id string) (models.NonlabTemplateDetail, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret models.NonlabTemplateDetail
|
||||
|
||||
q := `
|
||||
SELECT
|
||||
NonlabTemplateDetailID,
|
||||
NonlabTemplateDetailNonlabTemplateID,
|
||||
NonlabTemplateDetailCode,
|
||||
NonlabTemplateDetailName,
|
||||
NonlabTemplateDetaiNat_UnitID,
|
||||
NonlabTemplateDetailFlagActive,
|
||||
NonlabTemplateDetaiM_LangID,
|
||||
NonlabTemplateDetailIsActive
|
||||
FROM nonlab_template_detail
|
||||
WHERE NonlabTemplateDetailID = ?
|
||||
AND NonlabTemplateDetailIsActive = 'Y'
|
||||
`
|
||||
err := dbx.Handlex.Get(&ret, q, id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get data detail nonlab template", zap.Any("ID", id))
|
||||
return ret, fmt.Errorf("query failed, error get data by id : %v", err)
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func (nlt *MDNonlabTemplateServices) ListDetailByIDNonlabTemplate(id string) ([]models.NonlabTemplateDetail, error) {
|
||||
var ret []models.NonlabTemplateDetail
|
||||
var totalData int
|
||||
|
||||
query := `
|
||||
SELECT COUNT(*)
|
||||
FROM nonlab_template_detail
|
||||
WHERE NonlabTemplateDetailNonlabTemplateID = ?
|
||||
AND NonlabTemplateDetailIsActive = 'Y'
|
||||
`
|
||||
if err := dbx.Handlex.Get(&totalData, query, id); err != nil {
|
||||
return ret, fmt.Errorf("error querying databases: %v", err)
|
||||
}
|
||||
|
||||
query = `
|
||||
SELECT
|
||||
NonlabTemplateDetailID,
|
||||
NonlabTemplateDetailNonlabTemplateID,
|
||||
NonlabTemplateDetailCode,
|
||||
NonlabTemplateDetailName,
|
||||
NonlabTemplateDetaiNat_UnitID,
|
||||
NonlabTemplateDetailFlagActive,
|
||||
NonlabTemplateDetaiM_LangID,
|
||||
NonlabTemplateDetailIsActive
|
||||
FROM nonlab_template_detail
|
||||
WHERE NonlabTemplateDetailNonlabTemplateID = ?
|
||||
AND NonlabTemplateDetailIsActive = 'Y'
|
||||
`
|
||||
if err := dbx.Handlex.Select(&ret, query, id); err != nil {
|
||||
return ret, fmt.Errorf("error querying database: %v", err)
|
||||
}
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func (nlt *MDNonlabTemplateServices) AddDetailNonlabTemplate(idnonlab string, kode string, name string, flagActive string) ([]models.NonlabTemplateDetail, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret []models.NonlabTemplateDetail
|
||||
|
||||
var count int
|
||||
prmKode := "%" + kode + "%"
|
||||
prmName := "%" + name + "%"
|
||||
q := `
|
||||
SELECT COUNT(*)
|
||||
FROM nonlab_template_detail
|
||||
WHERE (NonlabTemplateDetailCode LIKE ? OR NonlabTemplateDetailName LIKE ?)
|
||||
AND NonlabTemplateDetailNonlabTemplateID = ?
|
||||
AND NonlabTemplateDetailIsActive = 'Y'
|
||||
`
|
||||
err := dbx.Handlex.Get(&count, q, prmKode, prmName, idnonlab)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("cek duplicate", zap.Any("kode", prmKode), zap.Any("nama", prmName))
|
||||
return ret, fmt.Errorf("query failed to cek duplicate: %v", err)
|
||||
}
|
||||
if count > 0 {
|
||||
defer logger.Sync()
|
||||
logger.Error("data duplicate", zap.Any("kode", prmKode), zap.Any("nama", prmName))
|
||||
return ret, fmt.Errorf("terdapat data duplikat")
|
||||
}
|
||||
|
||||
q = `
|
||||
INSERT INTO nonlab_template_detail (
|
||||
NonlabTemplateDetailNonlabTemplateID,
|
||||
NonlabTemplateDetailCode,
|
||||
NonlabTemplateDetailName,
|
||||
NonlabTemplateDetailFlagActive,
|
||||
NonlabTemplateDetailCreated
|
||||
) VALUES(?,?,?,?,NOW())
|
||||
`
|
||||
rsp := dbx.Handlex.MustExec(q, idnonlab, kode, name, flagActive)
|
||||
insertedID, err := rsp.LastInsertId()
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("error insert data", zap.Any("kode", prmKode), zap.Any("nama", prmName))
|
||||
return ret, fmt.Errorf("query failed to insert data: %v", err)
|
||||
}
|
||||
logger.Info("Success Insert data", zap.Any("id", insertedID))
|
||||
|
||||
return nlt.ListDetailByIDNonlabTemplate(idnonlab)
|
||||
}
|
||||
|
||||
func (nlt *MDNonlabTemplateServices) DeleteDetailNonlabTemplate(id string) ([]models.NonlabTemplateDetail, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var temp models.NonlabTemplateDetail
|
||||
var ret []models.NonlabTemplateDetail
|
||||
|
||||
temp, err := nlt.GetDetailByID(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get current detail nonlab template", zap.Any("id", id))
|
||||
return ret, fmt.Errorf("query failed get current detail nonlab template")
|
||||
}
|
||||
|
||||
q := `
|
||||
UPDATE nonlab_template_detail
|
||||
SET
|
||||
NonlabTemplateDetailIsActive = 'N',
|
||||
NonlabTemplateDetailLastUpdated = NOW()
|
||||
WHERE NonlabTemplateDetailID = ?
|
||||
AND NonlabTemplateDetailNonlabTemplateID = ?
|
||||
`
|
||||
dlt := dbx.Handlex.MustExec(q, id, temp.NonlabTemplateDetailNonlabTemplateID)
|
||||
_, err = dlt.RowsAffected()
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error delete detail nonlab template", zap.Any("id", id))
|
||||
return ret, fmt.Errorf("query failed delete detail nonlab template")
|
||||
}
|
||||
|
||||
s := strconv.Itoa(int(temp.NonlabTemplateDetailNonlabTemplateID))
|
||||
|
||||
return nlt.ListDetailByIDNonlabTemplate(s)
|
||||
}
|
||||
|
||||
func (nlt *MDNonlabTemplateServices) PilihDetailNonlabTemplate(id string) ([]models.NonlabTemplateDetail, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var cek models.NonlabTemplateDetail
|
||||
var ret []models.NonlabTemplateDetail
|
||||
var flag string
|
||||
|
||||
cek, err := nlt.GetDetailByID(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error cek current detail nonlab template", zap.Any("ID", id))
|
||||
return ret, fmt.Errorf("query failed cek current detail nonlab template")
|
||||
}
|
||||
|
||||
if cek.NonlabTemplateDetailFlagActive == "Y" {
|
||||
flag = "N"
|
||||
} else {
|
||||
flag = "Y"
|
||||
}
|
||||
|
||||
q := `
|
||||
UPDATE nonlab_template_detail
|
||||
SET
|
||||
NonlabTemplateDetailFlagActive = ?,
|
||||
NonlabTemplateDetailLastUpdated = NOW()
|
||||
WHERE NonlabTemplateDetailID = ?
|
||||
AND NonlabTemplateDetailNonlabTemplateID = ?
|
||||
`
|
||||
updt := dbx.Handlex.MustExec(q, flag, id, cek.NonlabTemplateDetailNonlabTemplateID)
|
||||
_, err = updt.RowsAffected()
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error update detail nonlab template", zap.Any("id", id), zap.Any("flag", flag))
|
||||
return ret, fmt.Errorf("query failed update detail nonlab template")
|
||||
}
|
||||
|
||||
s := strconv.Itoa(int(cek.NonlabTemplateDetailNonlabTemplateID))
|
||||
|
||||
return nlt.ListDetailByIDNonlabTemplate(s)
|
||||
}
|
||||
@@ -1,157 +1,76 @@
|
||||
package dev_mdnonlabtemplateview
|
||||
package dev_employeeanalytic
|
||||
|
||||
import "cpone/layout"
|
||||
import "cpone/models"
|
||||
import "cpone/component/customtextfield"
|
||||
import "cpone/models"
|
||||
|
||||
templ MdNonlabTemplateScreen(
|
||||
tableID string,
|
||||
templ EmployeeAnalyticScreen(
|
||||
listID string,
|
||||
paginationID string,
|
||||
searchID string,
|
||||
dialogAddID string,
|
||||
dialogAddBodyID string,
|
||||
dialogEditID string,
|
||||
dialogEditBodyID string,
|
||||
dialogDeleteID string,
|
||||
dialogDeleteBodyID string,
|
||||
tableDetailID string,
|
||||
detailEditID string,
|
||||
detailDeleteID string,
|
||||
breadcrumb templ.Component,
|
||||
filtercomponent templ.Component,
|
||||
tablecontent templ.Component,
|
||||
paginationtable templ.Component,
|
||||
modalAddForm templ.Component,
|
||||
// modalEditForm templ.Component,
|
||||
modalDeleteForm templ.Component,
|
||||
listingcomponent templ.Component,
|
||||
paginationcomponent templ.Component,
|
||||
) {
|
||||
<div class="container-fluid">
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
|
||||
Name: "tableID",
|
||||
Type: "hidden",
|
||||
Value: tableID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID",
|
||||
Name: "paginationID",
|
||||
Type: "hidden",
|
||||
Value: paginationID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "searchID",
|
||||
Name: "searchID",
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "listID",
|
||||
Name: "listID",
|
||||
Type: "hidden",
|
||||
Value: searchID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddID",
|
||||
Name: "dialogAddID",
|
||||
Type: "hidden",
|
||||
Value: dialogAddID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddBodyID",
|
||||
Name: "dialogAddBodyID",
|
||||
Type: "hidden",
|
||||
Value: dialogAddBodyID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditID",
|
||||
Name: "dialogEditID",
|
||||
Type: "hidden",
|
||||
Value: dialogEditID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditBodyID",
|
||||
Name: "dialogEditBodyID",
|
||||
Type: "hidden",
|
||||
Value: dialogEditBodyID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteID",
|
||||
Name: "dialogDeleteID",
|
||||
Type: "hidden",
|
||||
Value: dialogDeleteID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteBodyID",
|
||||
Name: "dialogDeleteBodyID",
|
||||
Type: "hidden",
|
||||
Value: dialogDeleteBodyID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableDetailID",
|
||||
Name: "tableDetailID",
|
||||
Type: "hidden",
|
||||
Value: tableDetailID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "detailEditID",
|
||||
Name: "detailEditID",
|
||||
Type: "hidden",
|
||||
Value: detailEditID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "detailDeleteID",
|
||||
Name: "detailDeleteID",
|
||||
Type: "hidden",
|
||||
Value: detailDeleteID})
|
||||
<div class="row align-items-center mb-10">
|
||||
Value: listID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID",
|
||||
Name: "paginationID",
|
||||
Type: "hidden",
|
||||
Value: paginationID})
|
||||
<div class="row align-item-center mb-10">
|
||||
<div class="col-md-10 col-sm-12 p-0">
|
||||
@breadcrumb
|
||||
</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={ "#" + dialogAddID }
|
||||
>
|
||||
Add New
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 d-block d-lg-none d-xl-none d-md-none d-sm-block justify-content-center px-5">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-block"
|
||||
data-toggle="modal"
|
||||
data-target={ "#" + dialogAddID }
|
||||
>
|
||||
Add New
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="loading-parent" class=" rounded">
|
||||
@filtercomponent
|
||||
@tablecontent
|
||||
@paginationtable
|
||||
<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">
|
||||
@filtercomponent
|
||||
<div id="loading-parent" class="rounded">
|
||||
@listingcomponent
|
||||
@paginationcomponent
|
||||
<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>
|
||||
<div id="loadingcontent"></div>
|
||||
@modalAddForm
|
||||
// @modalEditForm
|
||||
@modalDeleteForm
|
||||
</div>
|
||||
}
|
||||
|
||||
templ CSSmdnontemplate() {
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/poppins.css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/publicsans.css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/roboto.css"
|
||||
/>
|
||||
<style>
|
||||
templ CSSEmployeeAnalytic() {
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/poppins.css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/publicsans.css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/roboto.css"
|
||||
/>
|
||||
<style>
|
||||
body {
|
||||
background-color: white;
|
||||
/* padding-right: 100px;
|
||||
padding-left: 100px; */
|
||||
background-color: white;
|
||||
}
|
||||
#div-chart {
|
||||
/* overflow-x: scroll; */
|
||||
margin: 40px 10vw 40px 10vw;
|
||||
}
|
||||
.title {
|
||||
font-size:20px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
#title {
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
}
|
||||
|
||||
templ JSmdnontemplate() {
|
||||
templ JSEmployeeAnalytic() {
|
||||
<script>
|
||||
document.addEventListener('htmx:afterSwap', function(event) {
|
||||
// Reinitialize selectpicker after HTMX content swap
|
||||
@@ -223,7 +142,7 @@ templ JSmdnontemplate() {
|
||||
console.log(event.detail.elt)
|
||||
console.log("Target ID: "+event.detail.target)
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
}
|
||||
|
||||
script BeforeRequestContent() {
|
||||
@@ -245,19 +164,18 @@ script AfterRequestContent() {
|
||||
loadingParent.classList.remove("overlay");
|
||||
loadingParent.classList.remove("overlay-block");
|
||||
loadingChild.classList.remove("overlay-layer");
|
||||
loadingSpinner.classList.add("d-none");
|
||||
loadingSpinner.classList.add("d-none");
|
||||
}
|
||||
|
||||
templ ShowMdNonlabTemplateScreen(
|
||||
title string,
|
||||
cmp templ.Component,
|
||||
templ ShowEmployeeAnalytic(
|
||||
title string,
|
||||
cmp templ.Component,
|
||||
css templ.Component,
|
||||
js templ.Component,
|
||||
navbarmenu templ.Component,
|
||||
navbaruser templ.Component,
|
||||
userprofile templ.Component,
|
||||
navbaruser templ.Component,
|
||||
userprofile templ.Component,
|
||||
) {
|
||||
@layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile) {
|
||||
@layout.EmployeeAnalyticLayout(title, css, js, navbaruser, userprofile) {
|
||||
@cmp
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package dev_mdnonlabtemplateview
|
||||
package dev_employeeanalytic
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
@@ -11,29 +11,16 @@ import "io"
|
||||
import "bytes"
|
||||
|
||||
import "cpone/layout"
|
||||
import "cpone/models"
|
||||
import "cpone/component/customtextfield"
|
||||
import "cpone/models"
|
||||
|
||||
func MdNonlabTemplateScreen(
|
||||
tableID string,
|
||||
func EmployeeAnalyticScreen(
|
||||
listID string,
|
||||
paginationID string,
|
||||
searchID string,
|
||||
dialogAddID string,
|
||||
dialogAddBodyID string,
|
||||
dialogEditID string,
|
||||
dialogEditBodyID string,
|
||||
dialogDeleteID string,
|
||||
dialogDeleteBodyID string,
|
||||
tableDetailID string,
|
||||
detailEditID string,
|
||||
detailDeleteID string,
|
||||
breadcrumb templ.Component,
|
||||
filtercomponent templ.Component,
|
||||
tablecontent templ.Component,
|
||||
paginationtable templ.Component,
|
||||
modalAddForm templ.Component,
|
||||
// modalEditForm templ.Component,
|
||||
modalDeleteForm templ.Component,
|
||||
listingcomponent templ.Component,
|
||||
paginationcomponent 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)
|
||||
@@ -51,10 +38,10 @@ func MdNonlabTemplateScreen(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
|
||||
Name: "tableID",
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "listID",
|
||||
Name: "listID",
|
||||
Type: "hidden",
|
||||
Value: tableID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
Value: listID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -65,77 +52,7 @@ func MdNonlabTemplateScreen(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "searchID",
|
||||
Name: "searchID",
|
||||
Type: "hidden",
|
||||
Value: searchID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddID",
|
||||
Name: "dialogAddID",
|
||||
Type: "hidden",
|
||||
Value: dialogAddID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddBodyID",
|
||||
Name: "dialogAddBodyID",
|
||||
Type: "hidden",
|
||||
Value: dialogAddBodyID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditID",
|
||||
Name: "dialogEditID",
|
||||
Type: "hidden",
|
||||
Value: dialogEditID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditBodyID",
|
||||
Name: "dialogEditBodyID",
|
||||
Type: "hidden",
|
||||
Value: dialogEditBodyID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteID",
|
||||
Name: "dialogDeleteID",
|
||||
Type: "hidden",
|
||||
Value: dialogDeleteID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteBodyID",
|
||||
Name: "dialogDeleteBodyID",
|
||||
Type: "hidden",
|
||||
Value: dialogDeleteBodyID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableDetailID",
|
||||
Name: "tableDetailID",
|
||||
Type: "hidden",
|
||||
Value: tableDetailID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "detailEditID",
|
||||
Name: "detailEditID",
|
||||
Type: "hidden",
|
||||
Value: detailEditID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "detailDeleteID",
|
||||
Name: "detailDeleteID",
|
||||
Type: "hidden",
|
||||
Value: detailDeleteID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row align-items-center mb-10\"><div class=\"col-md-10 col-sm-12 p-0\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row align-item-center mb-10\"><div class=\"col-md-10 col-sm-12 p-0\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -143,33 +60,7 @@ func MdNonlabTemplateScreen(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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("#" + dialogAddID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtemplate.templ`, Line: 87, Col: 55}
|
||||
}
|
||||
_, 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("\">Add New\r</button></div></div><div class=\"col-md-2 d-block d-lg-none d-xl-none d-md-none d-sm-block justify-content-center px-5\"><button type=\"button\" class=\"btn btn-primary btn-block\" data-toggle=\"modal\" data-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs("#" + dialogAddID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtemplate.templ`, Line: 98, Col: 51}
|
||||
}
|
||||
_, 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("\">Add New\r</button></div></div><div id=\"loading-parent\" class=\" rounded\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -177,27 +68,19 @@ func MdNonlabTemplateScreen(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = tablecontent.Render(ctx, templ_7745c5c3_Buffer)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-parent\" class=\"rounded\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = paginationtable.Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = listingcomponent.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>")
|
||||
templ_7745c5c3_Err = paginationcomponent.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = modalAddForm.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = modalDeleteForm.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 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
|
||||
}
|
||||
@@ -208,7 +91,7 @@ func MdNonlabTemplateScreen(
|
||||
})
|
||||
}
|
||||
|
||||
func CSSmdnontemplate() templ.Component {
|
||||
func CSSEmployeeAnalytic() 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 {
|
||||
@@ -216,12 +99,12 @@ func CSSmdnontemplate() templ.Component {
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var4 == nil {
|
||||
templ_7745c5c3_Var4 = templ.NopComponent
|
||||
templ_7745c5c3_Var2 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var2 == nil {
|
||||
templ_7745c5c3_Var2 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<link rel=\"stylesheet\" href=\"assets/css/googlefont/poppins.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/publicsans.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/roboto.css\"><style>\r\n body {\r\n background-color: white;\r\n /* padding-right: 100px;\r\n padding-left: 100px; */\r\n }\r\n #div-chart {\r\n /* overflow-x: scroll; */\r\n margin: 40px 10vw 40px 10vw;\r\n }\r\n .title {\r\n font-size:20px;\r\n font-weight: bold;\r\n }\r\n #title {\r\n font-weight: 600;\r\n }\r\n </style>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<link rel=\"stylesheet\" href=\"assets/css/googlefont/poppins.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/publicsans.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/roboto.css\"><style>\r\n body {\r\n background-color: white;\r\n }\r\n #div-chart {\r\n margin: 40px 10vw 40px 10vw;\r\n }\r\n .title {\r\n font-size: 20px;\r\n font-weight: bold;\r\n }\r\n #title {\r\n font-weight: 600;\r\n }\r\n </style>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -232,7 +115,7 @@ func CSSmdnontemplate() templ.Component {
|
||||
})
|
||||
}
|
||||
|
||||
func JSmdnontemplate() templ.Component {
|
||||
func JSEmployeeAnalytic() 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 {
|
||||
@@ -240,9 +123,9 @@ func JSmdnontemplate() templ.Component {
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var5 == nil {
|
||||
templ_7745c5c3_Var5 = templ.NopComponent
|
||||
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("<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>")
|
||||
@@ -275,27 +158,26 @@ func BeforeRequestContent() templ.ComponentScript {
|
||||
|
||||
func AfterRequestContent() templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_AfterRequestContent_077f`,
|
||||
Function: `function __templ_AfterRequestContent_077f(){const loadingParent = document.getElementById("loading-parent");
|
||||
Name: `__templ_AfterRequestContent_848c`,
|
||||
Function: `function __templ_AfterRequestContent_848c(){const loadingParent = document.getElementById("loading-parent");
|
||||
const loadingChild = document.getElementById("loading-child");
|
||||
const loadingSpinner = document.getElementById("loading-spinner");
|
||||
|
||||
loadingParent.classList.remove("overlay");
|
||||
loadingParent.classList.remove("overlay-block");
|
||||
loadingChild.classList.remove("overlay-layer");
|
||||
loadingSpinner.classList.add("d-none");
|
||||
loadingSpinner.classList.add("d-none");
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_AfterRequestContent_077f`),
|
||||
CallInline: templ.SafeScriptInline(`__templ_AfterRequestContent_077f`),
|
||||
Call: templ.SafeScript(`__templ_AfterRequestContent_848c`),
|
||||
CallInline: templ.SafeScriptInline(`__templ_AfterRequestContent_848c`),
|
||||
}
|
||||
}
|
||||
|
||||
func ShowMdNonlabTemplateScreen(
|
||||
func ShowEmployeeAnalytic(
|
||||
title string,
|
||||
cmp templ.Component,
|
||||
css templ.Component,
|
||||
js templ.Component,
|
||||
navbarmenu templ.Component,
|
||||
navbaruser templ.Component,
|
||||
userprofile templ.Component,
|
||||
) templ.Component {
|
||||
@@ -306,12 +188,12 @@ func ShowMdNonlabTemplateScreen(
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var6 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var6 == nil {
|
||||
templ_7745c5c3_Var6 = templ.NopComponent
|
||||
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var4 == nil {
|
||||
templ_7745c5c3_Var4 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Var7 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Var5 := 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()
|
||||
@@ -326,7 +208,7 @@ func ShowMdNonlabTemplateScreen(
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
templ_7745c5c3_Err = layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = layout.EmployeeAnalyticLayout(title, css, js, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
68
views/dev/employeeanalytic/filteremployeeanalytic.templ
Normal file
68
views/dev/employeeanalytic/filteremployeeanalytic.templ
Normal file
@@ -0,0 +1,68 @@
|
||||
package dev_employeeanalytic
|
||||
|
||||
templ FilterListing(
|
||||
hxGet string,
|
||||
hxTrigger string,
|
||||
hxInclude string,
|
||||
hxSwap string,
|
||||
hxTarget string,
|
||||
hxBeforeRequest templ.ComponentScript,
|
||||
hxAfterRequest templ.ComponentScript,
|
||||
) {
|
||||
<div class="row pt-8 align-items-center">
|
||||
<div class="col-12 col-sm-3 col-md-1 col-lg-1 col-xl-1 mb-2">
|
||||
<label class="text-black font-weight-bolder">Stard Date:</label>
|
||||
</div>
|
||||
<div class="col-12 col-sm-9 col-md-2 col-lg-2 col-xl-2 mb-2">
|
||||
<input
|
||||
id="startdateID"
|
||||
name="startdate"
|
||||
class="form-control form-control-lg bg-field border-0 rounded-lg"
|
||||
type="date"
|
||||
autocomplete="off"
|
||||
hx-get={ hxGet }
|
||||
hx-trigger={ hxTrigger }
|
||||
hx-include={ hxInclude }
|
||||
hx-swap={ hxSwap }
|
||||
hx-target={ hxTarget }
|
||||
hx-on::before-request={ hxBeforeRequest }
|
||||
hx-on::after-request={ hxAfterRequest }
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-sm-3 col-md-1 col-lg-1 col-xl-1 mb-2">
|
||||
<label class="text-black font-weight-bolder">End Date:</label>
|
||||
</div>
|
||||
<div class="col-12 col-sm-9 col-md-2 col-lg-2 col-xl-2 mb-2">
|
||||
<input
|
||||
id="enddateID"
|
||||
name="enddate"
|
||||
class="form-control form-control-lg bg-field border-0 rounded-lg"
|
||||
type="date"
|
||||
autocomplete="off"
|
||||
hx-get={ hxGet }
|
||||
hx-trigger={ hxTrigger }
|
||||
hx-include={ hxInclude }
|
||||
hx-swap={ hxSwap }
|
||||
hx-target={ hxTarget }
|
||||
hx-on::before-request={ hxBeforeRequest }
|
||||
hx-on::after-request={ hxAfterRequest }
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 mb-2">
|
||||
<input
|
||||
id="searchID"
|
||||
name="search"
|
||||
class="form-control form-control-lg bg-field border-0 rounded-lg"
|
||||
type="text"
|
||||
placeholder="nama karyawan"
|
||||
hx-get={ hxGet }
|
||||
hx-trigger={ hxTrigger }
|
||||
hx-include={ hxInclude }
|
||||
hx-swap={ hxSwap }
|
||||
hx-target={ hxTarget }
|
||||
hx-on::before-request={ hxBeforeRequest }
|
||||
hx-on::after-request={ hxAfterRequest }
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package dev_mdnonlabtemplateview
|
||||
package dev_employeeanalytic
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
@@ -10,21 +10,14 @@ import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
import "cpone/component/table"
|
||||
import "cpone/models"
|
||||
import "strconv"
|
||||
|
||||
func TableNonlabTmplt(
|
||||
data []models.MDNonlabTemplate,
|
||||
tableID string,
|
||||
hxGetEdit string,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
func FilterListing(
|
||||
hxGet string,
|
||||
hxTrigger string,
|
||||
hxInclude string,
|
||||
hxSwap string,
|
||||
hxTarget string,
|
||||
hxBeforeRequest templ.ComponentScript,
|
||||
hxAfterRequest 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)
|
||||
@@ -38,320 +31,167 @@ func TableNonlabTmplt(
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row pt-8 align-items-center\"><div class=\"col-12 col-sm-3 col-md-1 col-lg-1 col-xl-1 mb-2\"><label class=\"text-black font-weight-bolder\">Stard Date:</label></div><div class=\"col-12 col-sm-9 col-md-2 col-lg-2 col-xl-2 mb-2\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest, hxAfterRequest)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input id=\"startdateID\" name=\"startdate\" class=\"form-control form-control-lg bg-field border-0 rounded-lg\" type=\"date\" autocomplete=\"off\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(tableID)
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 19, Col: 21}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 23, Col: 30}
|
||||
}
|
||||
_, 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-swap-oob=\"true\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-trigger=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"NAMA", "AKSI"},
|
||||
[]string{"80%", "20%"},
|
||||
RowNonlabTmplt(data,
|
||||
tableID,
|
||||
hxGetEdit,
|
||||
hxTargetEdit,
|
||||
hxSwapEdit,
|
||||
hxIncludeEdit,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
hxIncludeDelete,
|
||||
)).Render(ctx, templ_7745c5c3_Buffer)
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 24, Col: 38}
|
||||
}
|
||||
_, 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("</div>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 25, Col: 38}
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func RowNonlabTmplt(
|
||||
data []models.MDNonlabTemplate,
|
||||
tableID string,
|
||||
hxGetEdit string,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var3 == nil {
|
||||
templ_7745c5c3_Var3 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
if len(data) == 0 {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td colspan=\"2\" class=\"text-center\">Data Tidak Ditemukan</td></tr>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
for _, v := range data {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(v.NonlabTemplateName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 55, Col: 38}
|
||||
}
|
||||
_, 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("</td><td>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = RowAction(v.NonlabTemplateID,
|
||||
hxGetEdit,
|
||||
hxTargetEdit,
|
||||
hxSwapEdit,
|
||||
hxIncludeEdit,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
hxIncludeDelete,
|
||||
).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td></tr>")
|
||||
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 RowAction(
|
||||
id int,
|
||||
hxGetEdit string,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var5 == nil {
|
||||
templ_7745c5c3_Var5 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row px-5 d-flex justify-content-around\">")
|
||||
_, 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.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleBeforeRequestRow(strconv.Itoa(id)), HandleAfterRequestRow(strconv.Itoa(id)))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\"btnactnlt col-12 col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2 btn-sm\" hx-get=\"")
|
||||
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\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 26, Col: 32}
|
||||
}
|
||||
_, 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-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetEdit + "?id=" + strconv.Itoa(id))
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 87, Col: 49}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 27, Col: 36}
|
||||
}
|
||||
_, 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-target=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetEdit)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 88, Col: 27}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
||||
var templ_7745c5c3_Var7 templ.ComponentScript = hxBeforeRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapEdit)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 89, Col: 23}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
||||
var templ_7745c5c3_Var8 templ.ComponentScript = hxAfterRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div><div class=\"col-12 col-sm-3 col-md-1 col-lg-1 col-xl-1 mb-2\"><label class=\"text-black font-weight-bolder\">End Date:</label></div><div class=\"col-12 col-sm-9 col-md-2 col-lg-2 col-xl-2 mb-2\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest, hxAfterRequest)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input id=\"enddateID\" name=\"enddate\" class=\"form-control form-control-lg bg-field border-0 rounded-lg\" type=\"date\" autocomplete=\"off\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeEdit)
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 90, Col: 29}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 42, Col: 30}
|
||||
}
|
||||
_, 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("\" hx-indicator=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-trigger=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs("#spnredt" + strconv.Itoa(id))
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 91, Col: 47}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 43, Col: 38}
|
||||
}
|
||||
_, 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-on::before-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var11 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(id))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11.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_Var12 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
|
||||
_, 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("\"><span id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs("spnredt" + strconv.Itoa(id))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 95, Col: 50}
|
||||
}
|
||||
_, 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("\" class=\"htmx-indicator spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span> Edit\r</a> ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleBeforeRequestRow(strconv.Itoa(id)), HandleAfterRequestRow(strconv.Itoa(id)))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\"btnactnlt col-12 col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2 btn-sm\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var14 string
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetDelete + "?id=" + strconv.Itoa(id))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 101, Col: 51}
|
||||
}
|
||||
_, 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-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var15 string
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 102, Col: 29}
|
||||
}
|
||||
_, 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-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var16 string
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 103, Col: 25}
|
||||
}
|
||||
_, 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-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var17 string
|
||||
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeDelete)
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 104, Col: 31}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 44, Col: 38}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
|
||||
_, 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-indicator=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var18 string
|
||||
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs("#spnrdel" + strconv.Itoa(id))
|
||||
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\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 105, Col: 47}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 45, Col: 32}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
|
||||
_, 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-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 46, Col: 36}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -359,8 +199,8 @@ func RowAction(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var19 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(id))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var19.Call)
|
||||
var templ_7745c5c3_Var14 templ.ComponentScript = hxBeforeRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -368,25 +208,103 @@ func RowAction(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var20 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var20.Call)
|
||||
var templ_7745c5c3_Var15 templ.ComponentScript = hxAfterRequest
|
||||
_, 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("\"><span id=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div><div class=\"col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 mb-2\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var21 string
|
||||
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs("spnrdel" + strconv.Itoa(id))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\nonlabtemplatetable.templ`, Line: 109, Col: 50}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest, hxAfterRequest)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"htmx-indicator spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span> Hapus\r</a></div>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input id=\"searchID\" name=\"search\" class=\"form-control form-control-lg bg-field border-0 rounded-lg\" type=\"text\" placeholder=\"nama karyawan\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var16 string
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 58, Col: 30}
|
||||
}
|
||||
_, 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-trigger=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var17 string
|
||||
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 59, Col: 38}
|
||||
}
|
||||
_, 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(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 60, Col: 38}
|
||||
}
|
||||
_, 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("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var19 string
|
||||
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 61, Col: 32}
|
||||
}
|
||||
_, 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(hxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\filteremployeeanalytic.templ`, Line: 62, Col: 36}
|
||||
}
|
||||
_, 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-on::before-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var21 templ.ComponentScript = hxBeforeRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var21.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_Var22 templ.ComponentScript = hxAfterRequest
|
||||
_, 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("\"></div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -396,33 +314,3 @@ func RowAction(
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func HandleBeforeRequestRow(id string) templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_HandleBeforeRequestRow_9ad2`,
|
||||
Function: `function __templ_HandleBeforeRequestRow_9ad2(id){var cusid_ele = document.getElementsByClassName('btnactnlt');
|
||||
for (var i = 0; i < cusid_ele.length; ++i) {
|
||||
var item = cusid_ele[i];
|
||||
item.classList.add('disabled');
|
||||
}
|
||||
console.log(id)
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_HandleBeforeRequestRow_9ad2`, id),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleBeforeRequestRow_9ad2`, id),
|
||||
}
|
||||
}
|
||||
|
||||
func HandleAfterRequestRow(id string) templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_HandleAfterRequestRow_840a`,
|
||||
Function: `function __templ_HandleAfterRequestRow_840a(id){var cusid_ele = document.getElementsByClassName('btnactnlt');
|
||||
for (var i = 0; i < cusid_ele.length; ++i) {
|
||||
var item = cusid_ele[i];
|
||||
item.classList.remove('disabled');
|
||||
}
|
||||
console.log(id)
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_HandleAfterRequestRow_840a`, id),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleAfterRequestRow_840a`, id),
|
||||
}
|
||||
}
|
||||
41
views/dev/employeeanalytic/listingemployeeanalytic.templ
Normal file
41
views/dev/employeeanalytic/listingemployeeanalytic.templ
Normal file
@@ -0,0 +1,41 @@
|
||||
package dev_employeeanalytic
|
||||
|
||||
import "cpone/models"
|
||||
import "strconv"
|
||||
|
||||
templ ListingData(
|
||||
data []models.EmployeeAnalytic,
|
||||
listID string,
|
||||
) {
|
||||
<div id={listID} class="align-items-center pt-8 flex-column" hx-swap-oob="true">
|
||||
<div class="bg-field rounded">
|
||||
<div class="p-8">
|
||||
for i, d := range data {
|
||||
if i == (len(data) - 1) {
|
||||
<div id={ strconv.Itoa(int(d.Mgm_McuID)) } class="card shadow p-8">
|
||||
@ItemCard(d)
|
||||
</div>
|
||||
} else {
|
||||
<div id={ strconv.Itoa(int(d.Mgm_McuID)) } class="card shadow p-8 mb-8">
|
||||
@ItemCard(d)
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ItemCard(data models.EmployeeAnalytic) {
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col-7">
|
||||
<h3 class="text-black">{ data.Mgm_McuLabel }</h3>
|
||||
</div>
|
||||
<div class="col-md col-lg text-right">
|
||||
<span class="text-black font-weight-bolder">{ data.Mgm_McuNote }</span>
|
||||
</div>
|
||||
<div class="col-md col-lg text-right">
|
||||
<span class="text-black font-weight-bolder">{ data.Mgm_McuStartDate } - { data.Mgm_McuEndDate }</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
189
views/dev/employeeanalytic/listingemployeeanalytic_templ.go
Normal file
189
views/dev/employeeanalytic/listingemployeeanalytic_templ.go
Normal file
@@ -0,0 +1,189 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package dev_employeeanalytic
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
import "cpone/models"
|
||||
import "strconv"
|
||||
|
||||
func ListingData(
|
||||
data []models.EmployeeAnalytic,
|
||||
listID string,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var1 == nil {
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(listID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 10, Col: 19}
|
||||
}
|
||||
_, 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=\"align-items-center pt-8 flex-column\" hx-swap-oob=\"true\"><div class=\"bg-field rounded\"><div class=\"p-8\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for i, d := range data {
|
||||
if i == (len(data) - 1) {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(int(d.Mgm_McuID)))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 15, Col: 64}
|
||||
}
|
||||
_, 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("\" class=\"card shadow p-8\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ItemCard(d).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
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(int(d.Mgm_McuID)))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 19, Col: 64}
|
||||
}
|
||||
_, 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("\" class=\"card shadow p-8 mb-8\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ItemCard(d).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
|
||||
}
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></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 ItemCard(data models.EmployeeAnalytic) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var5 == nil {
|
||||
templ_7745c5c3_Var5 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row d-flex align-items-center\"><div class=\"col-7\"><h3 class=\"text-black\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuLabel)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 32, Col: 54}
|
||||
}
|
||||
_, 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("</h3></div><div class=\"col-md col-lg text-right\"><span class=\"text-black font-weight-bolder\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuNote)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 35, Col: 74}
|
||||
}
|
||||
_, 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("</span></div><div class=\"col-md col-lg text-right\"><span class=\"text-black font-weight-bolder\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuStartDate)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 38, Col: 79}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" - ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuEndDate)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 38, Col: 105}
|
||||
}
|
||||
_, 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("</span></div></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
|
||||
})
|
||||
}
|
||||
@@ -1,198 +0,0 @@
|
||||
package dev_mdnonlabtemplateview
|
||||
|
||||
import "cpone/models"
|
||||
import "cpone/component/modal"
|
||||
import "cpone/component/customtextfield"
|
||||
import "cpone/component/customcheckbox"
|
||||
|
||||
templ MDNonlabTmpltForm(data models.MDNonlabTemplateForm) {
|
||||
<div class="">
|
||||
<form
|
||||
id={ data.IDComponent }
|
||||
hx-post={ data.Link }
|
||||
class="form"
|
||||
hx-target={ data.HxTarget }
|
||||
hx-swap={ data.HxSwap }
|
||||
hx-include={ data.HxInclude }
|
||||
hx-indicator=".formloading"
|
||||
hx-on::before-request={ HandleFormBeforeRequest() }
|
||||
hx-on::after-request={ HandleFormAfterRequest() }
|
||||
>
|
||||
if data.ModalTitle == "Delete - Nonlab Template" {
|
||||
@modalcomponent.Modal(data.ModalID,
|
||||
data.ModalTitle,
|
||||
data.DialogBody,
|
||||
data.DialogAction,
|
||||
data.ButtonClose,
|
||||
)
|
||||
}
|
||||
@modalcomponent.ModalXL(data.ModalID,
|
||||
data.ModalTitle,
|
||||
data.DialogBody,
|
||||
data.DialogAction,
|
||||
data.ButtonClose,
|
||||
)
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
|
||||
script HandleFormBeforeRequest() {
|
||||
const btnActCancel = document.querySelectorAll('.btnactcancel');
|
||||
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
|
||||
|
||||
console.log("here test")
|
||||
for (let i = 0; i < btnActCancel.length; i++) {
|
||||
btnActCancel[i].setAttribute('disabled', 'true');
|
||||
}
|
||||
for (let i = 0; i < btnActSaveData.length; i++) {
|
||||
btnActSaveData[i].setAttribute('disabled', 'true');
|
||||
}
|
||||
}
|
||||
|
||||
script HandleFormAfterRequest() {
|
||||
const btnActCancel = document.querySelectorAll('.btnactcancel');
|
||||
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
|
||||
|
||||
console.log("here test#2")
|
||||
for (let i = 0; i < btnActCancel.length; i++) {
|
||||
btnActCancel[i].removeAttribute('disabled');
|
||||
}
|
||||
for (let i = 0; i < btnActSaveData.length; i++) {
|
||||
btnActSaveData[i].removeAttribute('disabled');
|
||||
}
|
||||
}
|
||||
|
||||
templ BodyFormMDNonlabTemplate(
|
||||
componentID string,
|
||||
inputID models.CustomTextFieldv2Prm,
|
||||
inputName models.CustomTextFieldv2Prm,
|
||||
inputFlag models.CustomCheckboxv1Prm,
|
||||
detailKode models.CustomTextFieldv2Prm,
|
||||
detailNama models.CustomTextFieldv2Prm,
|
||||
btnSimpan templ.Component,
|
||||
btnAddDetail templ.Component,
|
||||
tableDetail templ.Component,
|
||||
hxOnLoad templ.ComponentScript,
|
||||
) {
|
||||
<div id={ componentID } hx-on::load={ hxOnLoad }>
|
||||
@customtextfield.CustomTextFieldv2(inputID)
|
||||
<h6 class="font-weight-bold">Nama Template</h6>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
@customtextfield.CustomTextFieldv2(inputName)
|
||||
</div>
|
||||
<div class="col-4">
|
||||
@customcheckbox.MainCustomCheckboxInput(inputFlag)
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 d-flex justify-content-end mt-4">
|
||||
@btnSimpan
|
||||
</div>
|
||||
<h6 class="font-weight-bold">Detail Hasil</h6>
|
||||
<div class="row align-items-center">
|
||||
<div class="col-2">
|
||||
@customtextfield.CustomTextFieldv2(detailKode)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
@customtextfield.CustomTextFieldv2(detailNama)
|
||||
</div>
|
||||
<div class="col-2 d-flex justify-content-center">
|
||||
@btnAddDetail
|
||||
</div>
|
||||
</div>
|
||||
@tableDetail
|
||||
</div>
|
||||
<script>
|
||||
document.addEventListener('htmx:afterSwap', function(event) {
|
||||
$('.selectpicker').selectpicker('refresh');
|
||||
})
|
||||
</script>
|
||||
}
|
||||
|
||||
script JSHideModal(modalID string) {
|
||||
$(modalID).modal('hide')
|
||||
}
|
||||
|
||||
script JSShowModal(modalID string) {
|
||||
$(modalID).modal('show')
|
||||
const btnActCancel = document.querySelectorAll('.btnactcancel');
|
||||
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
|
||||
|
||||
for (let i = 0; i < btnActCancel.length; i++) {
|
||||
btnActCancel[i].removeAttribute('disabled');
|
||||
}
|
||||
for (let i = 0; i < btnActSaveData.length; i++) {
|
||||
btnActSaveData[i].removeAttribute('disabled');
|
||||
}
|
||||
}
|
||||
|
||||
templ ActionFormMDNonlabTmplt(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
|
||||
<div>
|
||||
<button
|
||||
hx-on::after-request={ JSHideModal(modalID) }
|
||||
hx-post={ LinkClose }
|
||||
hx-target={ targetClose }
|
||||
hx-swap={ hxSwapClose }
|
||||
hx-indicator=".cancelloading"
|
||||
type="button"
|
||||
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel"
|
||||
data-dismiss="modal"
|
||||
>
|
||||
<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 btnactsavedata"
|
||||
>
|
||||
<span class="htmx-indicator spinner-border spinner-border-sm formloading" role="status" aria-hidden="true"></span>
|
||||
Simpan
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ BtnCloseFormMDNonlabTmplt(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
|
||||
<button
|
||||
hx-post={ LinkClose }
|
||||
hx-target={ targetClose }
|
||||
hx-swap={ hxSwapClose }
|
||||
type="button"
|
||||
hx-on::after-request={ JSHideModal(modalID) }
|
||||
class="close btnactcancel"
|
||||
data-dismiss="modal"
|
||||
aria-label="Close"
|
||||
>
|
||||
<i aria-hidden="true" class="ki ki-close"></i>
|
||||
</button>
|
||||
}
|
||||
|
||||
templ BtnSimpanNama(Link string, target string, hxSwap string, disable bool, hxInclude string) {
|
||||
<button
|
||||
hx-post={ Link }
|
||||
hx-target={ target }
|
||||
hx-swap={ hxSwap }
|
||||
hx-include={ hxInclude }
|
||||
type="button"
|
||||
class="btn btntmplt btn-outline-secondary font-weight-bolder rounded-lg"
|
||||
aria-label="Simpan Nama"
|
||||
if disable {
|
||||
disabled
|
||||
}
|
||||
>
|
||||
Simpan
|
||||
</button>
|
||||
}
|
||||
|
||||
templ BtnAddDetail(Link string, target string, hxSwap string, modalID string, hxInclude string) {
|
||||
<button
|
||||
hx-post={ Link }
|
||||
hx-target={ target }
|
||||
hx-swap={ hxSwap }
|
||||
hx-include={ hxInclude }
|
||||
type="button"
|
||||
class="btn"
|
||||
aria-label="Add Detail Hasil"
|
||||
>
|
||||
<i aria-hidden="true" class="ki ki-solid-plus icon-2x text-primary"></i>
|
||||
</button>
|
||||
}
|
||||
@@ -1,665 +0,0 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package dev_mdnonlabtemplateview
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
import "cpone/models"
|
||||
import "cpone/component/modal"
|
||||
import "cpone/component/customtextfield"
|
||||
import "cpone/component/customcheckbox"
|
||||
|
||||
func MDNonlabTmpltForm(data models.MDNonlabTemplateForm) 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 class=\"\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleFormBeforeRequest(), HandleFormAfterRequest())
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<form id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(data.IDComponent)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 11, Col: 33}
|
||||
}
|
||||
_, 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-post=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(data.Link)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 12, Col: 31}
|
||||
}
|
||||
_, 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("\" class=\"form\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(data.HxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 14, Col: 37}
|
||||
}
|
||||
_, 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(data.HxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 15, Col: 33}
|
||||
}
|
||||
_, 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(data.HxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 16, Col: 39}
|
||||
}
|
||||
_, 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\" hx-on::before-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 templ.ComponentScript = HandleFormBeforeRequest()
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7.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_Var8 templ.ComponentScript = HandleFormAfterRequest()
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.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
|
||||
}
|
||||
if data.ModalTitle == "Delete - Nonlab Template" {
|
||||
templ_7745c5c3_Err = modalcomponent.Modal(data.ModalID,
|
||||
data.ModalTitle,
|
||||
data.DialogBody,
|
||||
data.DialogAction,
|
||||
data.ButtonClose,
|
||||
).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
templ_7745c5c3_Err = modalcomponent.ModalXL(data.ModalID,
|
||||
data.ModalTitle,
|
||||
data.DialogBody,
|
||||
data.DialogAction,
|
||||
data.ButtonClose,
|
||||
).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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_8f9d`,
|
||||
Function: `function __templ_HandleFormBeforeRequest_8f9d(){const btnActCancel = document.querySelectorAll('.btnactcancel');
|
||||
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
|
||||
|
||||
console.log("here test")
|
||||
for (let i = 0; i < btnActCancel.length; i++) {
|
||||
btnActCancel[i].setAttribute('disabled', 'true');
|
||||
}
|
||||
for (let i = 0; i < btnActSaveData.length; i++) {
|
||||
btnActSaveData[i].setAttribute('disabled', 'true');
|
||||
}
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_8f9d`),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_8f9d`),
|
||||
}
|
||||
}
|
||||
|
||||
func HandleFormAfterRequest() templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_HandleFormAfterRequest_7066`,
|
||||
Function: `function __templ_HandleFormAfterRequest_7066(){const btnActCancel = document.querySelectorAll('.btnactcancel');
|
||||
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
|
||||
|
||||
console.log("here test#2")
|
||||
for (let i = 0; i < btnActCancel.length; i++) {
|
||||
btnActCancel[i].removeAttribute('disabled');
|
||||
}
|
||||
for (let i = 0; i < btnActSaveData.length; i++) {
|
||||
btnActSaveData[i].removeAttribute('disabled');
|
||||
}
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_HandleFormAfterRequest_7066`),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_7066`),
|
||||
}
|
||||
}
|
||||
|
||||
func BodyFormMDNonlabTemplate(
|
||||
componentID string,
|
||||
inputID models.CustomTextFieldv2Prm,
|
||||
inputName models.CustomTextFieldv2Prm,
|
||||
inputFlag models.CustomCheckboxv1Prm,
|
||||
detailKode models.CustomTextFieldv2Prm,
|
||||
detailNama models.CustomTextFieldv2Prm,
|
||||
btnSimpan templ.Component,
|
||||
btnAddDetail templ.Component,
|
||||
tableDetail templ.Component,
|
||||
hxOnLoad templ.ComponentScript,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var9 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var9 == nil {
|
||||
templ_7745c5c3_Var9 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxOnLoad)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 77, Col: 25}
|
||||
}
|
||||
_, 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-on::load=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var11 templ.ComponentScript = hxOnLoad
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11.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(inputID).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<h6 class=\"font-weight-bold\">Nama Template</h6><div class=\"row\"><div class=\"col-8\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputName).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"col-4\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customcheckbox.MainCustomCheckboxInput(inputFlag).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"col-12 d-flex justify-content-end mt-4\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = btnSimpan.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><h6 class=\"font-weight-bold\">Detail Hasil</h6><div class=\"row align-items-center\"><div class=\"col-2\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(detailKode).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"col-8\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(detailNama).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"col-2 d-flex justify-content-center\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = btnAddDetail.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = tableDetail.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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 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_658d`,
|
||||
Function: `function __templ_JSShowModal_658d(modalID){$(modalID).modal('show')
|
||||
const btnActCancel = document.querySelectorAll('.btnactcancel');
|
||||
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
|
||||
|
||||
for (let i = 0; i < btnActCancel.length; i++) {
|
||||
btnActCancel[i].removeAttribute('disabled');
|
||||
}
|
||||
for (let i = 0; i < btnActSaveData.length; i++) {
|
||||
btnActSaveData[i].removeAttribute('disabled');
|
||||
}
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_JSShowModal_658d`, modalID),
|
||||
CallInline: templ.SafeScriptInline(`__templ_JSShowModal_658d`, modalID),
|
||||
}
|
||||
}
|
||||
|
||||
func ActionFormMDNonlabTmplt(LinkClose string, targetClose string, hxSwapClose string, modalID string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var12 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var12 == nil {
|
||||
templ_7745c5c3_Var12 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JSHideModal(modalID))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-on::after-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var13 templ.ComponentScript = JSHideModal(modalID)
|
||||
_, 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("\" hx-post=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var14 string
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 133, Col: 31}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var15 string
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 134, Col: 35}
|
||||
}
|
||||
_, 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-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var16 string
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 135, Col: 33}
|
||||
}
|
||||
_, 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-indicator=\".cancelloading\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel\" data-dismiss=\"modal\"><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 btnactsavedata\"><span class=\"htmx-indicator spinner-border spinner-border-sm formloading\" role=\"status\" aria-hidden=\"true\"></span> Simpan\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 BtnCloseFormMDNonlabTmplt(LinkClose string, targetClose string, hxSwapClose string, modalID string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var17 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var17 == nil {
|
||||
templ_7745c5c3_Var17 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, 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_Var18 string
|
||||
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 156, Col: 27}
|
||||
}
|
||||
_, 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("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var19 string
|
||||
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 157, Col: 31}
|
||||
}
|
||||
_, 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-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var20 string
|
||||
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 158, Col: 29}
|
||||
}
|
||||
_, 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("\" type=\"button\" hx-on::after-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var21 templ.ComponentScript = JSHideModal(modalID)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var21.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 BtnSimpanNama(Link string, target string, hxSwap string, disable bool, hxInclude string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var22 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var22 == nil {
|
||||
templ_7745c5c3_Var22 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-post=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var23 string
|
||||
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(Link)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 171, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var24 string
|
||||
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(target)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 172, Col: 26}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
|
||||
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_Var25 string
|
||||
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 173, Col: 24}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var26 string
|
||||
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 174, Col: 30}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"button\" class=\"btn btntmplt btn-outline-secondary font-weight-bolder rounded-lg\" aria-label=\"Simpan Nama\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if disable {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" disabled")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(">Simpan\r</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 BtnAddDetail(Link string, target string, hxSwap string, modalID string, hxInclude string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var27 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var27 == nil {
|
||||
templ_7745c5c3_Var27 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-post=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var28 string
|
||||
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(Link)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 188, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
|
||||
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_Var29 string
|
||||
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(target)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 189, Col: 26}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
|
||||
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_Var30 string
|
||||
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 190, Col: 24}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var31 string
|
||||
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodal.templ`, Line: 191, Col: 30}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"button\" class=\"btn\" aria-label=\"Add Detail Hasil\"><i aria-hidden=\"true\" class=\"ki ki-solid-plus icon-2x text-primary\"></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
|
||||
})
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package dev_mdnonlabtemplateview
|
||||
|
||||
import "cpone/models"
|
||||
import "cpone/component/customtextfield"
|
||||
|
||||
templ DeleteKonfirmasiBody(
|
||||
inputID models.CustomTextFieldv2Prm,
|
||||
componentID string,
|
||||
message string,
|
||||
dataHeader []string,
|
||||
dataText []string,
|
||||
hxOnLoad templ.ComponentScript,
|
||||
) {
|
||||
<div id={ componentID } hx-on::load={ hxOnLoad }>
|
||||
<p>{ message }</p>
|
||||
<div class="card rounded-lg">
|
||||
<div class="card-body d-flex flex-row">
|
||||
<div class="d-flex flex-column">
|
||||
for _, v := range dataHeader {
|
||||
<div class="mb-1 mt-1 text-disabled font-weight-bold mr-5">{ v }</div>
|
||||
}
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
for _, v := range dataText {
|
||||
<div class="mb-1 mt-1 font-weight-bold">{ v }</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@customtextfield.CustomTextFieldv2(inputID)
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ActionFormNonlabTemplateDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
|
||||
<div>
|
||||
<button
|
||||
hx-on::after-request={ JSHideModal(modalID) }
|
||||
hx-post={ LinkClose }
|
||||
hx-target={ targetClose }
|
||||
hx-swap={ hxSwapClose }
|
||||
hx-indicator=".cancelloading"
|
||||
type="button"
|
||||
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel"
|
||||
data-dismiss="modal"
|
||||
>
|
||||
<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 btnactsavedata"
|
||||
>
|
||||
<span class="htmx-indicator spinner-border spinner-border-sm formloading" role="status" aria-hidden="true"></span>
|
||||
Yakin
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
@@ -1,218 +0,0 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package dev_mdnonlabtemplateview
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
import "cpone/models"
|
||||
import "cpone/component/customtextfield"
|
||||
|
||||
func DeleteKonfirmasiBody(
|
||||
inputID models.CustomTextFieldv2Prm,
|
||||
componentID string,
|
||||
message string,
|
||||
dataHeader []string,
|
||||
dataText []string,
|
||||
hxOnLoad templ.ComponentScript,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var1 == nil {
|
||||
templ_7745c5c3_Var1 = 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_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodaldel.templ`, Line: 14, Col: 25}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" 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("\"><p>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(message)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodaldel.templ`, Line: 15, Col: 20}
|
||||
}
|
||||
_, 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("</p><div class=\"card rounded-lg\"><div class=\"card-body d-flex flex-row\"><div class=\"d-flex flex-column\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for _, v := range dataHeader {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 text-disabled font-weight-bold mr-5\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodaldel.templ`, Line: 20, Col: 86}
|
||||
}
|
||||
_, 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("</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"d-flex flex-column\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for _, v := range dataText {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 font-weight-bold\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodaldel.templ`, Line: 25, Col: 67}
|
||||
}
|
||||
_, 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("</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputID).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func ActionFormNonlabTemplateDelete(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_Var7 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var7 == nil {
|
||||
templ_7745c5c3_Var7 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JSHideModal(modalID))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-on::after-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 templ.ComponentScript = JSHideModal(modalID)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.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_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodaldel.templ`, Line: 38, Col: 31}
|
||||
}
|
||||
_, 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("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodaldel.templ`, Line: 39, Col: 35}
|
||||
}
|
||||
_, 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-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodaldel.templ`, Line: 40, Col: 33}
|
||||
}
|
||||
_, 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-indicator=\".cancelloading\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel\" data-dismiss=\"modal\"><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 btnactsavedata\"><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
|
||||
})
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
package dev_mdnonlabtemplateview
|
||||
|
||||
import "cpone/component/table"
|
||||
import "cpone/models"
|
||||
import "strconv"
|
||||
|
||||
templ TableNonlabTmplt(
|
||||
data []models.MDNonlabTemplate,
|
||||
tableID string,
|
||||
hxGetEdit string,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) {
|
||||
<div id={ tableID } hx-swap-oob="true" >
|
||||
@tablecomponent.TableV3([]string{"NAMA", "AKSI"},
|
||||
[]string{"80%","20%"},
|
||||
RowNonlabTmplt(data,
|
||||
tableID,
|
||||
hxGetEdit,
|
||||
hxTargetEdit,
|
||||
hxSwapEdit,
|
||||
hxIncludeEdit,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
hxIncludeDelete,
|
||||
))
|
||||
</div>
|
||||
}
|
||||
|
||||
templ RowNonlabTmplt(
|
||||
data []models.MDNonlabTemplate,
|
||||
tableID string,
|
||||
hxGetEdit string,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) {
|
||||
if len(data) == 0 {
|
||||
<tr>
|
||||
<td colspan="2" class="text-center">Data Tidak Ditemukan</td>
|
||||
</tr>
|
||||
}
|
||||
for _, v := range data {
|
||||
<tr>
|
||||
<td>{ v.NonlabTemplateName }</td>
|
||||
<td>
|
||||
@RowAction(v.NonlabTemplateID,
|
||||
hxGetEdit,
|
||||
hxTargetEdit,
|
||||
hxSwapEdit,
|
||||
hxIncludeEdit,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
hxIncludeDelete,
|
||||
)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
|
||||
templ RowAction(
|
||||
id int,
|
||||
hxGetEdit string,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) {
|
||||
<div class="row px-5 d-flex justify-content-around">
|
||||
<a
|
||||
type="button"
|
||||
class="btnactnlt col-12 col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2 btn-sm"
|
||||
hx-get={ hxGetEdit + "?id=" + strconv.Itoa(id) }
|
||||
hx-target={ hxTargetEdit }
|
||||
hx-swap={ hxSwapEdit }
|
||||
hx-include={ hxIncludeEdit }
|
||||
hx-indicator={ "#spnredt" + strconv.Itoa(id) }
|
||||
hx-on::before-request={ HandleBeforeRequestRow(strconv.Itoa(id)) }
|
||||
hx-on::after-request={ HandleAfterRequestRow(strconv.Itoa(id)) }
|
||||
>
|
||||
<span id={ "spnredt" + strconv.Itoa(id) } class="htmx-indicator spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
||||
Edit
|
||||
</a>
|
||||
<a
|
||||
type="button"
|
||||
class="btnactnlt col-12 col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2 btn-sm"
|
||||
hx-get={ hxGetDelete + "?id=" + strconv.Itoa(id) }
|
||||
hx-target={ hxTargetDelete }
|
||||
hx-swap={ hxSwapDelete }
|
||||
hx-include={ hxIncludeDelete }
|
||||
hx-indicator={ "#spnrdel" + strconv.Itoa(id) }
|
||||
hx-on::before-request={ HandleBeforeRequestRow(strconv.Itoa(id)) }
|
||||
hx-on::after-request={ HandleAfterRequestRow(strconv.Itoa(id)) }
|
||||
>
|
||||
<span id={ "spnrdel" + strconv.Itoa(id) } class="htmx-indicator spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
||||
Hapus
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
|
||||
script HandleBeforeRequestRow(id string) {
|
||||
var cusid_ele = document.getElementsByClassName('btnactnlt');
|
||||
for (var i = 0; i < cusid_ele.length; ++i) {
|
||||
var item = cusid_ele[i];
|
||||
item.classList.add('disabled');
|
||||
}
|
||||
console.log(id)
|
||||
}
|
||||
|
||||
script HandleAfterRequestRow(id string) {
|
||||
var cusid_ele = document.getElementsByClassName('btnactnlt');
|
||||
for (var i = 0; i < cusid_ele.length; ++i) {
|
||||
var item = cusid_ele[i];
|
||||
item.classList.remove('disabled');
|
||||
}
|
||||
console.log(id)
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
package dev_mdnonlabtemplateview
|
||||
|
||||
import "cpone/models"
|
||||
import "strconv"
|
||||
import "cpone/component/table"
|
||||
|
||||
templ TableDetail(data []models.NonlabTemplateDetail,
|
||||
tableDetailID string,
|
||||
hxGetEdit string,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) {
|
||||
<div id={ tableDetailID }>
|
||||
@tablecomponent.TableV3([]string{"KODE", "TEST", "AKSI"},
|
||||
[]string{"20%","50%","30%"},
|
||||
RowDetail(data,
|
||||
hxGetEdit,
|
||||
hxTargetEdit,
|
||||
hxSwapEdit,
|
||||
hxIncludeEdit,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
hxIncludeDelete,
|
||||
))
|
||||
</div>
|
||||
}
|
||||
|
||||
templ RowDetail(
|
||||
data []models.NonlabTemplateDetail,
|
||||
hxGetEdit string,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) {
|
||||
if len(data) == 0 {
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Data Tidak Ditemukan</td>
|
||||
</tr>
|
||||
}
|
||||
for _, v := range data {
|
||||
<tr>
|
||||
<td>{ v.NonlabTemplateDetailCode }</td>
|
||||
<td>{ v.NonlabTemplateDetailName }</td>
|
||||
<td>
|
||||
@ActionRow(v.NonlabTemplateDetailID,
|
||||
v.NonlabTemplateDetailFlagActive,
|
||||
hxGetEdit,
|
||||
hxTargetEdit,
|
||||
hxSwapEdit,
|
||||
hxIncludeEdit,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
hxIncludeDelete,
|
||||
)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
templ ActionRow(
|
||||
id int,
|
||||
flagActive string,
|
||||
hxGetEdit string,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) {
|
||||
<div class="row px-5 d-flex justify-content-around">
|
||||
<a
|
||||
type="button"
|
||||
class="btn mb-2 btn-sm col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5"
|
||||
hx-get={ hxGetDelete + "?id=" + strconv.Itoa(id) }
|
||||
hx-target={ hxTargetDelete }
|
||||
hx-swap={ hxSwapDelete }
|
||||
hx-include={ hxIncludeDelete }
|
||||
>
|
||||
<i aria-hidden="true" class="flaticon2-trash text-danger"></i>
|
||||
</a>
|
||||
if flagActive == "Y" {
|
||||
<a
|
||||
type="button"
|
||||
class="btn btn-light-danger mb-2 btn-sm col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 mb-2 btn-sm"
|
||||
hx-get={ hxGetEdit + "?id=" + strconv.Itoa(id) }
|
||||
hx-target={ hxTargetEdit }
|
||||
hx-swap={ hxSwapEdit }
|
||||
hx-include={ hxIncludeEdit }
|
||||
>
|
||||
Tidak
|
||||
</a>
|
||||
} else {
|
||||
<a
|
||||
type="button"
|
||||
class="btn btn-light-tosca mb-2 btn-sm col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 mb-2 btn-sm"
|
||||
hx-get={ hxGetEdit + "?id=" + strconv.Itoa(id) }
|
||||
hx-target={ hxTargetEdit }
|
||||
hx-swap={ hxSwapEdit }
|
||||
hx-include={ hxIncludeEdit }
|
||||
>
|
||||
Pilih
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@@ -1,373 +0,0 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package dev_mdnonlabtemplateview
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
import "cpone/models"
|
||||
import "strconv"
|
||||
import "cpone/component/table"
|
||||
|
||||
func TableDetail(data []models.NonlabTemplateDetail,
|
||||
tableDetailID string,
|
||||
hxGetEdit string,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var1 == nil {
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(tableDetailID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 18, Col: 27}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"KODE", "TEST", "AKSI"},
|
||||
[]string{"20%", "50%", "30%"},
|
||||
RowDetail(data,
|
||||
hxGetEdit,
|
||||
hxTargetEdit,
|
||||
hxSwapEdit,
|
||||
hxIncludeEdit,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
hxIncludeDelete,
|
||||
)).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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 RowDetail(
|
||||
data []models.NonlabTemplateDetail,
|
||||
hxGetEdit string,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var3 == nil {
|
||||
templ_7745c5c3_Var3 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
if len(data) == 0 {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td colspan=\"3\" class=\"text-center\">Data Tidak Ditemukan</td></tr>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
for _, v := range data {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(v.NonlabTemplateDetailCode)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 52, Col: 45}
|
||||
}
|
||||
_, 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("</td><td>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v.NonlabTemplateDetailName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 53, Col: 45}
|
||||
}
|
||||
_, 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("</td><td>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ActionRow(v.NonlabTemplateDetailID,
|
||||
v.NonlabTemplateDetailFlagActive,
|
||||
hxGetEdit,
|
||||
hxTargetEdit,
|
||||
hxSwapEdit,
|
||||
hxIncludeEdit,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
hxIncludeDelete,
|
||||
).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td></tr>")
|
||||
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 ActionRow(
|
||||
id int,
|
||||
flagActive string,
|
||||
hxGetEdit string,
|
||||
hxTargetEdit string,
|
||||
hxSwapEdit string,
|
||||
hxIncludeEdit string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var6 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var6 == nil {
|
||||
templ_7745c5c3_Var6 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row px-5 d-flex justify-content-around\"><a type=\"button\" class=\"btn mb-2 btn-sm col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetDelete + "?id=" + strconv.Itoa(id))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 88, Col: 60}
|
||||
}
|
||||
_, 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("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 89, Col: 38}
|
||||
}
|
||||
_, 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-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 90, Col: 34}
|
||||
}
|
||||
_, 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("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 91, Col: 40}
|
||||
}
|
||||
_, 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("\"><i aria-hidden=\"true\" class=\"flaticon2-trash text-danger\"></i></a> ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if flagActive == "Y" {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\"btn btn-light-danger mb-2 btn-sm col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 mb-2 btn-sm\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetEdit + "?id=" + strconv.Itoa(id))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 99, Col: 62}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var12 string
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetEdit)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 100, Col: 40}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapEdit)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 101, Col: 36}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var14 string
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeEdit)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 102, Col: 42}
|
||||
}
|
||||
_, 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("\">Tidak\r</a>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\"btn btn-light-tosca mb-2 btn-sm col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 mb-2 btn-sm\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var15 string
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetEdit + "?id=" + strconv.Itoa(id))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 110, Col: 62}
|
||||
}
|
||||
_, 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(hxTargetEdit)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 111, Col: 40}
|
||||
}
|
||||
_, 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(hxSwapEdit)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 112, Col: 36}
|
||||
}
|
||||
_, 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(hxIncludeEdit)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\tabledetail.templ`, Line: 113, Col: 42}
|
||||
}
|
||||
_, 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("\">Pilih\r</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
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
@@ -100,7 +100,7 @@ templ ContentMDSampleStation(
|
||||
}
|
||||
|
||||
templ CSSMDSampleStation() {
|
||||
<linl
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/poppins.css"
|
||||
/>
|
||||
|
||||
@@ -203,7 +203,7 @@ func CSSMDSampleStation() templ.Component {
|
||||
templ_7745c5c3_Var4 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<linl rel=\"stylesheet\" href=\"assets/css/googlefont/poppins.css\"></linl><link rel=\"stylesheet\" href=\"assets/css/googlefont/publicsans.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/roboto.css\"><style>\r\n body {\r\n background-color: white;\r\n }\r\n #div-chart {\r\n margin: 40px 10vw 40px 10vw;\r\n }\r\n .title {\r\n font-size: 20px;\r\n font-weight: bold;\r\n }\r\n #title {\r\n font-weight: 600;\r\n }\r\n </style>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<link rel=\"stylesheet\" href=\"assets/css/googlefont/poppins.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/publicsans.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/roboto.css\"><style>\r\n body {\r\n background-color: white;\r\n }\r\n #div-chart {\r\n margin: 40px 10vw 40px 10vw;\r\n }\r\n .title {\r\n font-size: 20px;\r\n font-weight: bold;\r\n }\r\n #title {\r\n font-weight: 600;\r\n }\r\n </style>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -35,25 +35,25 @@ templ MainLandingPage(medicalServiceComponent templ.Component, listAdvantageComp
|
||||
@medicalServiceComponent
|
||||
<!-- Our Medical Service END -->
|
||||
<!-- Why Westerindo START belum fix di ukuran < 1400 -->
|
||||
<div class="container p-0 mt-5 ">
|
||||
<div class="row">
|
||||
// <div class="container p-0 mt-5 ">
|
||||
<div class="row mt-5">
|
||||
@HeaderSection("Why Westerindo", "With a dedicated team of professionals we’re committed to providing medical attention tailored to your needs, ensuring a journey to optimal health and vitality.")
|
||||
</div>
|
||||
@listAdvantageComponent
|
||||
</div>
|
||||
// </div>
|
||||
<!-- Why Westerindo END -->
|
||||
<!-- Promotion START -->
|
||||
<div class="container mt-4">
|
||||
<div class="row">
|
||||
// <div class="container mt-4">
|
||||
<div class="row mt-4">
|
||||
@HeaderSection("Promotions", "Seize This Opportunity to Enhance Your Health")
|
||||
</div>
|
||||
@listPromotion
|
||||
</div>
|
||||
// </div>
|
||||
<!-- Promotion END -->
|
||||
<!-- footer START -->
|
||||
@footer
|
||||
<!-- footer END -->
|
||||
</div>
|
||||
<!-- footer START -->
|
||||
@footer
|
||||
<!-- footer END -->
|
||||
}
|
||||
|
||||
templ CssLandingPage() {
|
||||
|
||||
@@ -51,7 +51,7 @@ func MainLandingPage(medicalServiceComponent templ.Component, listAdvantageCompo
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Our Medical Service END --><!-- Why Westerindo START belum fix di ukuran < 1400 --><div class=\"container p-0 mt-5 \"><div class=\"row\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Our Medical Service END --><!-- Why Westerindo START belum fix di ukuran < 1400 --><div class=\"row mt-5\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -67,7 +67,7 @@ func MainLandingPage(medicalServiceComponent templ.Component, listAdvantageCompo
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Why Westerindo END --><!-- Promotion START --><div class=\"container mt-4\"><div class=\"row\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Why Westerindo END --><!-- Promotion START --><div class=\"row mt-4\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -83,7 +83,7 @@ func MainLandingPage(medicalServiceComponent templ.Component, listAdvantageCompo
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Promotion END --><!-- footer START -->")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Promotion END --></div><!-- footer START -->")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -91,7 +91,7 @@ func MainLandingPage(medicalServiceComponent templ.Component, listAdvantageCompo
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- footer END --></div>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- footer END -->")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user