Compare commits

..

4 Commits

79 changed files with 912 additions and 19159 deletions

View File

@@ -94,48 +94,6 @@ License: You must have a valid license purchased only from themeforest(the above
>
<!--begin::Main-->
<div class="d-flex flex-column flex-root bg-white">
<div
id="notification-001"
class="toast toast-top-right toas fade show"
role="alert"
aria-live="assertive"
aria-atomic="true"
hx-swap-oob="true"
style="margin-top: 2vh; margin-right: 2vw;"
>
<div class="toast-header bg-success text-white">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true"
role="img"
class="iconify iconify--ep mr-2 icon-xl"
width="1em"
height="1em"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 1024 1024"
data-icon="ep:success-filled"
>
<path
fill="currentColor"
d="M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"
></path>
</svg>
<strong class="mr-auto">Success</strong>
<small class="text-muted text-white">just now</small>
<button
type="button"
class="ml-2 mb-1 close"
data-dismiss="toast"
aria-label="Close"
>
<span aria-hidden="true">×</span>
</button>
</div>
<div class="toast-body bg-success-transparent">
This is a success toast.
</div>
</div>
<!-- begin::Navbar -->
<div
class="d-flex flex-lg-row justify-content-between py-5"

View File

@@ -294,56 +294,6 @@ a.text-white:focus {
-webkit-box-shadow: 0 0 0 0.2rem rgba(84, 168, 255, 0.5);
box-shadow: 0 0 0 0.2rem rgba(84, 168, 255, 0.5);
}
.btn-field {
color: var(--text-black);
background-color: var(--fieldbg) !important;
border-color: var(--fieldbg) !important;
}
.btn-field.btn-lg {
padding: 0.825rem 1.42rem !important;
font-size: 1.08rem !important;
line-height: 1.5 !important;
border-radius: 0.42rem !important;
}
.btn-field.btn-lg.rounded-lg {
padding: 0.825rem 1.42rem !important;
font-size: 1.08rem !important;
line-height: 1.5 !important;
border-radius: 0.85rem !important;
}
.btn-field:hover {
color: var(--text-black);
background-color: var(--fieldbg) !important;
border-color: var(--fieldbg) !important;
}
.btn-field:focus,
.btn-field.focus {
color: var(--text-black);
background-color: var(--fieldbg) !important;
border-color: var(--fieldbg) !important;
-webkit-box-shadow: 0 0 0 0rem var(--fieldbg) !important;
box-shadow: 0 0 0 0rem var(--fieldbg) !important;
}
.btn-field.disabled,
.btn-field:disabled {
color: var(--text-black);
background-color: var(--fieldbg) !important;
border-color: var(--fieldbg) !important;
}
.btn-field:not(:disabled):not(.disabled):active,
.btn-field:not(:disabled):not(.disabled).active,
.show > .btn-field.dropdown-toggle {
color: var(--text-black);
background-color: var(--fieldbg) !important;
border-color: var(--fieldbg) !important;
}
.btn-field:not(:disabled):not(.disabled):active:focus,
.btn-field:not(:disabled):not(.disabled).active:focus,
.show > .btn-field.dropdown-toggle:focus {
-webkit-box-shadow: 0 0 0 0rem var(--fieldbg) !important;
box-shadow: 0 0 0 0rem var(--fieldbg) !important;
}
/* COBA CUSTOM BTN */
.btn-tosca {
color: #ffffff;
@@ -5252,8 +5202,6 @@ a.text-hover-tosca:hover .svg-icon svg:hover g [fill],
z-index: 99999999999 !important;
width: 350px;
height: auto;
margin-top: 2vh;
margin-right: 2vw;
}
/* ### TOAST FONT SIZE */
@@ -5276,12 +5224,6 @@ a.text-hover-tosca:hover .svg-icon svg:hover g [fill],
border-radius: 0.42rem;
}
/* ### CUSTOM CSS SELECTPICKER */
.btn-custom-selectpicker{
height: 8vh;
text-align: center;
}
/* ### OVERLAY */
.overlay-loading {
position: relative !important;
@@ -5351,16 +5293,6 @@ a.text-hover-tosca:hover .svg-icon svg:hover g [fill],
/* ## WARNING */
/* ## DANGER */
/* ### HTMX INDICATOR */
.htmx-indicator {
display: none !important;
}
.htmx-request .htmx-indicator {
display: inline-block !important;
}
.htmx-request.htmx-indicator {
display: inline-block !important;
}
/* ### BUTTON HOVER TEXT */
/* ### */
/* ## PRIMARY */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -1,511 +0,0 @@
<!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>
<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="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/css/bootstrap-select.min.css"
/>
<style>
.filter-option-inner-inner {
margin-top: 1.2vh;
color: var(--text-disabled);
}
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn {
color: var(--text-disabled);
}
.bootstrap-select.btn-group .dropdown-menu {
min-width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
position: sticky;
}
.dropdown-menu {
transform: translate3d(0px, 0px, 0px) !important;
}
</style>
</head>
<!--end::Head-->
<!--begin::Body-->
<body
id="kt_body"
class="bg-white header-fixed header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading"
>
<!--begin::Main-->
<div class="wrapperx p-5 h-100">
<!-- person.png start -->
<div class="row">
<div class="col-4">
<img
src="asset-corporate-portal/media/person/person.png"
style="display: block; width: 13vw"
/>
</div>
</div>
<div class="row mt-5">
<div class="col-4">
<button
class="btn bg-primary-transparent text-center text-primary"
style="width: 13vw; font-weight: 600"
>
Update Foto
</button>
</div>
</div>
<!-- person.png end -->
<div class="row mt-5">
<!-- col 1 start -->
<div class="col-4">
<div class="form-row">
<div class="col">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Sapaan</label
>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-size="4"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
>
<option value="default">Pilih Sapaan</option>
<option value="mr">Tuan</option>
<option value="mrs">Nyonya</option>
<option value="ms">Nona</option>
</select>
</div>
<div class="col">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Imbuhan Awal 1</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Imbuhan Awal 1"
/>
</div>
<div class="col">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Imbuhan Awal 2</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Imbuhan Awal 2"
/>
</div>
</div>
<!-- jenis kelamin -->
<div class="form-row mt-5">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Jenis Kelamin</label
>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-size="4"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
>
<option value="default">Pilih Jenis Kelamin</option>
<option value="mr">Tuan</option>
<option value="mrs">Nyonya</option>
<option value="ms">Nona</option>
</select>
</div>
<!-- jenis kelamin -->
<!-- gol darah -->
<div class="form-row mt-5">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Golongan Darah</label
>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-size="4"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
>
<option value="default">Pilih Golongan Darah</option>
<option value="mr">Tuan</option>
<option value="mrs">Nyonya</option>
<option value="ms">Nona</option>
</select>
</div>
<!-- gol darah -->
<!-- kewarganegaraan -->
<div class="form-row mt-5">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Kewarganegaraan</label
>
<div class="form-control border-0 h-auto p-0 mt-3">
<div class="form-group">
<div style="display: flex; gap: 20px">
<label style="display: flex; align-items: center; gap: 5px">
<input type="radio" name="nationality" value="wni" />
<p style="margin: 0">WNI</p>
</label>
<label style="display: flex; align-items: center; gap: 5px">
<input type="radio" name="nationality" value="wna" />
<p style="margin: 0">WNA</p>
</label>
</div>
</div>
</div>
</div>
<!-- kewarganegaraan -->
<!-- identitas -->
<div class="form-row mt-5">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Imbuhan Awal 1</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Imbuhan Awal 1"
/>
</div>
<!-- identitas -->
</div>
<!-- col 1 end -->
<!-- col 2 start -->
<div class="col-4">
<!-- nama -->
<div class="form-row">
<label style="font-family: Poppins; font-weight: 600">Nama</label>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Input 3"
/>
</div>
<!-- nama -->
<!-- tanggal lahir -->
<div class="form-row mt-5">
<label style="font-family: Poppins; font-weight: 600"
>Tanggal Lahir</label
>
<div class="input-group date bg-field border-0 rounded-lg">
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
readonly
placeholder="Pilih Tanggal"
id="datepicker"
/>
<div class="input-group-prepend">
<span
class="input-group-text bg-field border-0 rounded-lg"
id="calendar-icon"
>
<span
class="iconify text-grey"
data-icon="heroicons-solid:calendar"
style="font-size: 20px"
></span>
</span>
</div>
</div>
</div>
<!-- tanggal lahir -->
<!-- rhesus -->
<div class="form-row mt-5">
<label style="font-family: Poppins; font-weight: 600">Rhesus</label>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-size="5"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
>
<option value="default">Pilih Rhesus</option>
<option value="mr">Tuan</option>
<option value="mrs">Nyonya</option>
<option value="ms">Nona</option>
</select>
</div>
<!-- rhesus -->
<!-- etnis -->
<div class="form-row mt-5">
<label style="font-family: Poppins; font-weight: 600">Etnis</label>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-size="4"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
>
<option value="default">Pilih Etnis</option>
<option value="mr">Tuan</option>
<option value="mrs">Nyonya</option>
<option value="ms">Nona</option>
</select>
</div>
<!-- etnis -->
<!-- no hp -->
<div class="form-row mt-6">
<div class="col">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Nomor HP</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Nomor HP"
/>
</div>
</div>
<!-- no hp -->
</div>
<!-- col 2 end -->
<!-- col 3 start -->
<div class="col-4">
<div class="form-row">
<div class="col">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Imbuhan Akhir 1</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Imbuhan Akhir 1"
/>
</div>
<div class="col">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Imbuhan Akhir 2</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Imbuhan Akhir 2"
/>
</div>
</div>
<!-- umur -->
<div class="form-row mt-5">
<div class="col">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Umur</label
>
<input
type="number"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Tahun"
/>
</div>
<div class="col mt-8">
<input
type="number"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Bulan"
/>
</div>
<div class="col mt-8">
<input
type="number"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Hari"
/>
</div>
</div>
<!-- umur -->
<!-- pendidikan terakhir -->
<div class="form-row mt-5">
<div class="col">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Pendidikan Terakhir</label
>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-size="4"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
>
<option value="default">Pilih Pendidikan</option>
<option value="mr">Tuan</option>
<option value="mrs">Nyonya</option>
<option value="ms">Nona</option>
</select>
</div>
</div>
<!-- pendidikan terakhir -->
<!-- identitas pilihan -->
<div class="form-row mt-5">
<div class="col">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Identitas</label
>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
data-size="4"
>
<option value="default">Pilih Identitas</option>
<option value="mr">Tuan</option>
<option value="mrs">Nyonya</option>
<option value="ms">Nona</option>
</select>
</div>
</div>
<!-- identitas pilihan -->
<!-- email -->
<div class="form-row mt-6">
<div class="col">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Email</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Email"
/>
</div>
</div>
<!-- email -->
</div>
<!-- col 3 end -->
</div>
</div>
<!--end::Main-->
<script src="asset-corporate-portal/js/ktappsetting.js"></script>
<!-- iconify -->
<script src="assets/js/iconify/iconify.min.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>
<script src="assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js"></script>
<script>
function ShowLoading() {
document
.getElementById("demo")
.setAttribute("style", "display:block !important;");
document
.getElementById("a")
.setAttribute("style", "display:none !important;");
}
function ShowForm() {
document
.getElementById("demo")
.setAttribute("style", "display:none !important;");
document
.getElementById("a")
.setAttribute("style", "display:block !important;;");
}
$(document).ready(function () {
// $(".selectpicker").selectpicker();
$(".selectpicker").selectpicker({
dropupAuto: false,
});
$("#datepicker").datepicker({
format: "dd/mm/yyyy",
});
$("#calendar-icon").click(function () {
$("#datepicker").datepicker("show");
});
});
</script>
<!--end::Global Theme Bundle-->
<!--end::Page Scripts-->
</body>
<!--end::Body-->
</html>

View File

@@ -1,631 +0,0 @@
<!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>
<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="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/css/bootstrap-select.min.css"
/>
<style>
.filter-option-inner-inner {
margin-top: 1.2vh;
color: var(--text-disabled);
}
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn {
color: var(--text-disabled);
}
.bootstrap-select.btn-group .dropdown-menu {
min-width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
position: sticky;
}
.dropdown-menu {
transform: translate3d(0px, 0px, 0px) !important;
}
/* mik */
.input-container {
position: relative;
}
.input-label {
position: absolute;
right: 20px;
transform: translateY(-50%);
pointer-events: none;
transition: all 0.2s ease;
}
.input-field:not(:placeholder-shown) + .input-label {
top: 50%;
font-size: 12px;
color: var(--secondary-hover);
}
</style>
</head>
<!--end::Head-->
<!--begin::Body-->
<body
id="kt_body"
class="bg-white header-fixed header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading"
>
<style></style>
<!--begin::Main-->
<div class="wrapperx p-5 h-100">
<div class="row">
<div class="col-lg-10">
<!--begin::Row 1-->
<div class="form-row">
<div class="col-md-6 col-lg-2">
<label
for="input1"
class="font-weight-bolder"
style="font-family: Poppins"
>Sapaan</label
>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-size="4"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
>
<option value="mr">Tn</option>
<option value="mrs">Ny</option>
<option value="ms">Nn</option>
</select>
</div>
<div class="col-md-6 col-lg-3">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Imbuhan Awal</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Imbuhan Awal 1"
/>
</div>
<div class="col-md-6 col-lg-5">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Nama
</label>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Imbuhan Awal 2"
/>
</div>
<div class="col-md-6 col-lg-2">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Imbuhan Akhir</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Imbuhan Awal 2"
/>
</div>
</div>
<!--end::Row 1-->
<!--begin::Row 2-->
<div class="row mt-5">
<div class="col-md-6">
<!-- begin::Jenis Kelamin -->
<div class="form-row">
<label
for="input1"
style="font-family: Poppins; font-weight: 600"
>Jenis Kelamin</label
>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-size="4"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
>
<option value="default">Pilih Jenis Kelamin</option>
<option value="mr">Perempuan</option>
<option value="mrs">Laki-Laki</option>
</select>
</div>
<!-- end::Jenis Kelamin -->
</div>
<div class="col-md-6">
<!-- begin::Tanggal Lahir -->
<div class="form-row">
<label style="font-family: Poppins; font-weight: 600"
>Tanggal Lahir</label
>
<div class="input-group date bg-field border-0 rounded-lg">
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
readonly
placeholder="Pilih Tanggal"
id="datepicker"
/>
<div class="input-group-prepend">
<span
class="input-group-text bg-field border-0 rounded-lg"
id="calendar-icon"
>
<span
class="iconify text-grey"
data-icon="heroicons-solid:calendar"
style="font-size: 20px"
></span>
</span>
</div>
</div>
</div>
<!-- end::Tanggal Lahir -->
</div>
</div>
<!--end::Row 2-->
<!--begin::Row 3-->
<div class="row mt-5">
<div class="col-lg-6">
<!-- begin::Umur -->
<div class="form-row">
<div class="col">
<label
for="input1"
style="font-family: Poppins; font-weight: 600"
>Umur</label
>
<div class="input-container">
<input
type="text"
id="myInput"
class="input-field form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
/>
<label for="myInput" class="input-label">Tahun</label>
</div>
</div>
<div class="col mt-8">
<div class="input-container">
<input
type="text"
id="myInput"
class="input-field form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
/>
<label for="myInput" class="input-label">Bulan</label>
</div>
</div>
<div class="col mt-8">
<div class="input-container">
<input
type="text"
id="myInput"
class="input-field form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
/>
<label for="myInput" class="input-label">Hari</label>
</div>
</div>
</div>
<!-- end::Umur -->
</div>
<div class="col-lg-6">
<!-- begin::Darah -->
<div class="form-row">
<!-- begin::Golongan Darah -->
<div class="col">
<label
for="input1"
style="font-family: Poppins; font-weight: 600"
>Golongan Darah</label
>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-size="4"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
>
<option value="default">Pilih Golongan Darah</option>
<option value="">O</option>
<option value="">A</option>
<option value="">B</option>
<option value="">AB</option>
</select>
</div>
<!-- end::Golongan Darah -->
<!-- begin::Rhesus -->
<div class="col">
<label style="font-family: Poppins; font-weight: 600"
>Rhesus</label
>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-size="5"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
>
<option value="default">Pilih Rhesus</option>
<option value="">-</option>
<option value="">+</option>
</select>
</div>
<!-- end::Rhesus -->
</div>
<!-- end::Darah -->
</div>
</div>
<!--end::Row 3-->
<!--begin::Row 4-->
<div class="row mt-5">
<!--begin::Pekerjaan-->
<div class="col-md-6">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Pekerjaan</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Pekerjaan"
/>
</div>
<!--end::Pekerjaan-->
<!--begin::Departemen-->
<div class="col-md-6">
<div class="form-row">
<label
for="input1"
style="font-family: Poppins; font-weight: 600"
>Departemen</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Departemen"
/>
</div>
</div>
<!--end::Departemen-->
</div>
<!--end::Row 4-->
<!--begin::Row 5-->
<div class="row mt-5">
<!--begin::Posisi-->
<div class="col-md-6">
<label for="input1" style="font-family: Poppins; font-weight: 600"
>Posisi</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Posisi"
/>
</div>
<!--end::Posisi-->
<!--Begin::Pendidikan Terakhir-->
<div class="col-md-6">
<div class="form-row">
<label style="font-family: Poppins; font-weight: 600"
>Pendidikan Terakhir</label
>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-size="5"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
>
<option value="default">Pilih Pendidikan Terakhir</option>
<option value="mr">SMA/SLTA/Sederajat</option>
<option value="mrs">D3</option>
<option value="ms">Sarjana</option>
<option value="ms">Magister</option>
<option value="ms">Doktor</option>
</select>
</div>
</div>
<!--end::Pendidikan Terakhir-->
</div>
<!--end::Row 5-->
<!--begin::Row 6-->
<div class="row mt-5">
<!--begin::Kewarganegaraan-->
<div class="col-md-6">
<div class="form-row">
<label
for="input1"
style="font-family: Poppins; font-weight: 600"
>Kewarganegaraan</label
>
<div class="form-control border-0 h-auto p-0 mt-3">
<div class="form-group">
<div
class="justify-content-between"
style="display: flex; gap: 20px"
>
<label
style="display: flex; align-items: center; gap: 5px"
>
<input type="radio" name="nationality" value="wni" />
<p style="margin: 0">WNI</p>
</label>
<label
style="display: flex; align-items: center; gap: 5px"
>
<input type="radio" name="nationality" value="wna" />
<p style="margin: 0">WNA</p>
</label>
</div>
</div>
</div>
</div>
</div>
<!--end::Kewarganegaraan-->
<!--Begin::Etnis-->
<div class="col-md-6">
<div class="form-row">
<label style="font-family: Poppins; font-weight: 600"
>Etnis</label
>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-size="4"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
>
<option value="default">Pilih Etnis</option>
<option value="">Jawa</option>
<option value="">Sunda</option>
<option value="">Batak</option>
<option value="">Betawi</option>
<option value="">Dayak</option>
</select>
</div>
</div>
<!--end::Etnis-->
</div>
<!--end::Row 6-->
<!--begin::Row 7-->
<div class="row mt-5">
<!--begin::Identitas-->
<div class="col-md-6">
<div class="form-row">
<div class="col">
<label
for="input1"
style="font-family: Poppins; font-weight: 600"
>Identitas</label
>
<select
class="selectpicker form-control"
id="select1"
data-live-search="true"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
data-size="4"
>
<option value="default">Pilih Identitas</option>
<option value="">KTP</option>
<option value="">SIM</option>
<option value="">Paspor</option>
<option value="">Kartu Pelajar</option>
<option value="">Surat Keterangan</option>
</select>
</div>
</div>
</div>
<!--end::Identitas-->
<!--Begin::Nomor Identitas-->
<div class="col-md-6">
<div class="form-row">
<div class="col">
<label
for="input1"
style="font-family: Poppins; font-weight: 600"
>Nomor Identitas</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Nomor Identitas"
/>
</div>
</div>
</div>
<!--end::Nomor Identitas-->
</div>
<!--end::Row 7-->
<!--begin::Row 8-->
<div class="row mt-5">
<!--begin::Nomor Hp-->
<div class="col-md-6">
<div class="form-row">
<div class="col">
<label
for="input1"
style="font-family: Poppins; font-weight: 600"
>Nomor HP</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Nomor HP"
/>
</div>
</div>
</div>
<!--end::Nomor Hp-->
<!--Begin::Email-->
<div class="col-md-6">
<div class="form-row">
<div class="col">
<label
for="input1"
style="font-family: Poppins; font-weight: 600"
>Email</label
>
<input
type="text"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
placeholder="Email"
/>
</div>
</div>
</div>
<!--end::Email-->
</div>
<!--end::Row 8-->
</div>
<div class="col-lg-2">
<!-- person.png start -->
<div class="row">
<div class="col">
<img
src="asset-corporate-portal/media/person/person.png"
style="display: block; width: 13vw"
/>
</div>
</div>
<div class="row mt-5">
<div class="col">
<button
class="btn bg-primary-transparent text-center text-primary"
style="width: 13vw; font-weight: 600"
>
Update Foto
</button>
</div>
</div>
<!-- person.png end -->
</div>
</div>
</div>
<!--end::Main-->
<script src="asset-corporate-portal/js/ktappsetting.js"></script>
<!-- iconify -->
<script src="assets/js/iconify/iconify.min.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>
<script src="assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js"></script>
<script>
function ShowLoading() {
document
.getElementById("demo")
.setAttribute("style", "display:block !important;");
document
.getElementById("a")
.setAttribute("style", "display:none !important;");
}
function ShowForm() {
document
.getElementById("demo")
.setAttribute("style", "display:none !important;");
document
.getElementById("a")
.setAttribute("style", "display:block !important;;");
}
$(document).ready(function () {
// $(".selectpicker").selectpicker();
$(".selectpicker").selectpicker({
dropupAuto: false,
});
$("#datepicker").datepicker({
format: "dd/mm/yyyy",
});
$("#calendar-icon").click(function () {
$("#datepicker").datepicker("show");
});
});
</script>
<!--end::Global Theme Bundle-->
<!--end::Page Scripts-->
</body>
<!--end::Body-->
</html>

View File

@@ -1,25 +0,0 @@
package customcheckbox
import "cpone/models"
templ MainCustomCheckboxInput(inp models.CustomCheckboxv1Prm) {
<div class="form-control bg-field border-0 h-auto">
<div class="form-group">
<label>{ inp.Label }</label>
<div class="checkbox-list">
<label class="checkbox">
if (inp.Value == "on") {
<input type="checkbox" name={ inp.Name } id={ inp.ID } checked/>
} else {
<input type="checkbox" name={ inp.Name } id={ inp.ID }/>
}
<span></span>
{ inp.Text }
</label>
</div>
</div>
<div class="invalid-feedback text-danger mt-3 ml-2 mt-5">
{ inp.ErrorMsg }
</div>
</div>
}

View File

@@ -1,143 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package customcheckbox
//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"
func MainCustomCheckboxInput(inp models.CustomCheckboxv1Prm) 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=\"form-control bg-field border-0 h-auto\"><div class=\"form-group\"><label>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Label)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 8, Col: 21}
}
_, 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("</label><div class=\"checkbox-list\"><label class=\"checkbox\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if inp.Value == "on" {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input type=\"checkbox\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 12, Col: 44}
}
_, 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("\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 12, Col: 58}
}
_, 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("\" checked> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input type=\"checkbox\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 14, Col: 44}
}
_, 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("\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 14, Col: 58}
}
_, 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("\"> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<span></span> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 17, Col: 15}
}
_, 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("</label></div></div><div class=\"invalid-feedback text-danger mt-3 ml-2 mt-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 22, Col: 17}
}
_, 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("</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
})
}

View File

@@ -1,119 +0,0 @@
package customdropdown;
import "cpone/models"
templ MainCustomDropdown(inp models.CustomDropdownv1Prm, listItem templ.Component) {
<div class="form-control bg-field border-0 h-auto">
<select
name={ inp.Name }
class="form-control bg-field selectpicker"
data-live-search="true"
data-size="5"
id={ inp.ID }
hx-get={ inp.HxGet }
hx-target={ inp.HxTarget }
hx-indicator={ inp.HxIndicator }
hx-trigger={ inp.HxTrigger }
hx-include={ inp.HxInclude }
>
@listItem
</select>
<div class="invalid-feedback text-danger mt-3 ml-2 mt-5">
{ inp.ErrorMsg }
</div>
</div>
}
templ MainCustomDropdownInput(inp models.CustomDropdownv1Prm, listItem templ.Component) {
<div class="form-control bg-field border-0 h-auto">
<select
name={ inp.Name }
class="form-control bg-field selectpicker"
data-live-search="true"
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
data-size="5"
id={ inp.ID }
>
@listItem
</select>
<div class="invalid-feedback text-danger mt-3 ml-2 mt-5">
{ inp.ErrorMsg }
</div>
</div>
}
templ MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string, listItem templ.Component) {
<div class="form-control bg-field border-0 h-auto">
<select
name={ name }
class="form-control bg-field selectpicker"
data-live-search="true"
data-size="5"
id={ id }
hx-get={ hxGet }
hx-target={ hxTarget }
hx-indicator={ hxIndicator }
hx-trigger={ hxTrigger }
hx-include={ hxInclude }
>
@listItem
</select>
</div>
}
templ CustomDropdownFilter(
idCmp string,
hxName string,
hxInclude string,
hxGet string,
hxSwap string,
hxTarget string,
hxTrigger string,
hxBeforeRequest templ.ComponentScript,
hxAfterRequest templ.ComponentScript,
listItem templ.Component) {
<select
class="form-control form-control-lg bg-field btn-lg rounded-lg selectpicker"
data-live-search="true"
data-size="5"
data-style="btn-field btn-lg rounded-lg"
data-live-search-placeholder="cari ..."
id={ idCmp }
name={ hxName }
hx-include={ hxInclude }
hx-get={ hxGet }
hx-swap={ hxSwap }
hx-target={ hxTarget }
hx-trigger={ hxTrigger }
hx-on::before-request={ hxBeforeRequest }
hx-on::after-request={ hxAfterRequest }
>
@listItem
</select>
}
templ CustomDropdownForm(
inp models.CustomDropdownV2Prm) {
<div class="form-group">
<label class="text-black" style="font-family: Poppins; font-weight: 600;">{ inp.Label } </label>
<select
if inp.ErrorMsg =="" {
class="form-control form-control-lg bg-field btn-lg rounded-lg selectpicker"
} else {
class="form-control form-control-lg bg-field btn-lg rounded-lg selectpicker is-invalid"
}
data-live-search="true"
data-size="5"
title={ inp.Placeholder }
data-style="btn-field btn-lg rounded-lg"
data-live-search-placeholder="cari ..."
name={ inp.Name }
id={ inp.ID }
>
@inp.ListItem
</select>
<div class="invalid-feedback text-danger mt-3 ml-2">
{ inp.ErrorMsg }
</div>
</div>
}

View File

@@ -1,611 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package customdropdown
//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"
func MainCustomDropdown(inp models.CustomDropdownv1Prm, listItem templ.Component) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"form-control bg-field border-0 h-auto\"><select name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 8, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"form-control bg-field selectpicker\" data-live-search=\"true\" data-size=\"5\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 12, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxGet)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 13, Col: 21}
}
_, 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-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 14, Col: 27}
}
_, 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-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxIndicator)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 15, Col: 33}
}
_, 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-trigger=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxTrigger)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 16, Col: 29}
}
_, 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-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 17, Col: 29}
}
_, 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
}
templ_7745c5c3_Err = listItem.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</select><div class=\"invalid-feedback text-danger mt-3 ml-2 mt-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 22, Col: 17}
}
_, 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("</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 MainCustomDropdownInput(inp models.CustomDropdownv1Prm, listItem 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_Var10 := templ.GetChildren(ctx)
if templ_7745c5c3_Var10 == nil {
templ_7745c5c3_Var10 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"form-control bg-field border-0 h-auto\"><select name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 30, Col: 18}
}
_, 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("\" class=\"form-control bg-field selectpicker\" data-live-search=\"true\" data-style=\"bg-field btn-lg rounded-lg btn-custom-selectpicker\" data-size=\"5\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 35, Col: 14}
}
_, 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("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = listItem.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</select><div class=\"invalid-feedback text-danger mt-3 ml-2 mt-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 40, Col: 17}
}
_, 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("</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 MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string, listItem 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_Var14 := templ.GetChildren(ctx)
if templ_7745c5c3_Var14 == nil {
templ_7745c5c3_Var14 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"form-control bg-field border-0 h-auto\"><select name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 48, Col: 14}
}
_, 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("\" class=\"form-control bg-field selectpicker\" data-live-search=\"true\" data-size=\"5\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 52, Col: 10}
}
_, 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-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 53, Col: 17}
}
_, 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-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 54, Col: 23}
}
_, 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-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 55, Col: 29}
}
_, 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-trigger=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 56, Col: 25}
}
_, 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-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 57, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = listItem.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</select></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 CustomDropdownFilter(
idCmp string,
hxName string,
hxInclude string,
hxGet string,
hxSwap string,
hxTarget string,
hxTrigger string,
hxBeforeRequest templ.ComponentScript,
hxAfterRequest templ.ComponentScript,
listItem 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_Var22 := templ.GetChildren(ctx)
if templ_7745c5c3_Var22 == nil {
templ_7745c5c3_Var22 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest, hxAfterRequest)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<select class=\"form-control form-control-lg bg-field btn-lg rounded-lg selectpicker\" data-live-search=\"true\" data-size=\"5\" data-style=\"btn-field btn-lg rounded-lg\" data-live-search-placeholder=\"cari ...\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(idCmp)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 80, Col: 12}
}
_, 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("\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(hxName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 81, Col: 15}
}
_, 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-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 82, 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-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 83, Col: 16}
}
_, 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("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 84, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 85, 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-trigger=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var29 string
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 86, Col: 24}
}
_, 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-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var30 templ.ComponentScript = hxBeforeRequest
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var30.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_Var31 templ.ComponentScript = hxAfterRequest
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var31.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 = listItem.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</select>")
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 CustomDropdownForm(
inp models.CustomDropdownV2Prm) 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_Var32 := templ.GetChildren(ctx)
if templ_7745c5c3_Var32 == nil {
templ_7745c5c3_Var32 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"form-group\"><label class=\"text-black\" style=\"font-family: Poppins; font-weight: 600;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var33 string
templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Label)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 97, Col: 87}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</label> <select")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if inp.ErrorMsg == "" {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"form-control form-control-lg bg-field btn-lg rounded-lg selectpicker\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"form-control form-control-lg bg-field btn-lg rounded-lg selectpicker is-invalid\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" data-live-search=\"true\" data-size=\"5\" title=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var34 string
templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Placeholder)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 106, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" data-style=\"btn-field btn-lg rounded-lg\" data-live-search-placeholder=\"cari ...\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var35 string
templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 109, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var36 string
templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 110, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
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 = inp.ListItem.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</select><div class=\"invalid-feedback text-danger mt-3 ml-2\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var37 string
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 115, Col: 17}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
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
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -1,22 +0,0 @@
package customradiobuttoninline
import "cpone/models"
templ MainCustomRadioButtonInput(inp models.CustomRadioButtonv1Prm) {
<div class="mt-5">
<label for="input1" style="font-family: Poppins; font-weight: 600">{ inp.Label }</label>
<div class="form-control">
<div class="form-group">
<div style="display: flex; gap: 20px">
<label style="display: flex; align-items: center; gap: 5px">
<input type="radio" name="nationality" value={ inp.Value }/>
<p style="margin: 0">{ inp.Text }</p>
</label>
</div>
</div>
</div>
<div class="invalid-feedback text-danger mt-3 ml-2 mt-5">
{ inp.ErrorMsg }
</div>
</div>
}

View File

@@ -1,89 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package customradiobuttoninline
//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"
func MainCustomRadioButtonInput(inp models.CustomRadioButtonv1Prm) 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=\"mt-5\"><label for=\"input1\" style=\"font-family: Poppins; font-weight: 600\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Label)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customradiobutton\customradiobuttoninline.templ`, Line: 7, Col: 80}
}
_, 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("</label><div class=\"form-control\"><div class=\"form-group\"><div style=\"display: flex; gap: 20px\"><label style=\"display: flex; align-items: center; gap: 5px\"><input type=\"radio\" name=\"nationality\" value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Value)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customradiobutton\customradiobuttoninline.templ`, Line: 12, Col: 62}
}
_, 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("\"><p style=\"margin: 0\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customradiobutton\customradiobuttoninline.templ`, Line: 13, 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("</p></label></div></div></div><div class=\"invalid-feedback text-danger mt-3 ml-2 mt-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customradiobutton\customradiobuttoninline.templ`, Line: 19, Col: 17}
}
_, 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></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
})
}

View File

@@ -19,9 +19,9 @@ templ CustomTextFieldv2(inp models.CustomTextFieldv2Prm) {
placeholder={ inp.Placeholder }
value={ inp.Value }
if inp.ErrorMsg =="" {
class="form-control bg-field border-0 form-control-lg bg-field rounded-lg"
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
} else {
class="form-control bg-field border-1 form-control-lg bg-field rounded-lg is-invalid"
class="form-control bg-field border-1 h-auto py-6 px-6 rounded-lg is-invalid"
}
/>
<div class="invalid-feedback text-danger mt-3 ml-2">

View File

@@ -123,12 +123,12 @@ func CustomTextFieldv2(inp models.CustomTextFieldv2Prm) templ.Component {
return templ_7745c5c3_Err
}
if inp.ErrorMsg == "" {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"form-control bg-field border-0 form-control-lg bg-field rounded-lg\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"form-control bg-field border-0 h-auto py-6 px-6 rounded-lg\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"form-control bg-field border-1 form-control-lg bg-field rounded-lg is-invalid\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"form-control bg-field border-1 h-auto py-6 px-6 rounded-lg is-invalid\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -83,42 +83,3 @@ templ MainCustomTextFieldSearchV2(
});
</script>
}
templ MainCustomTextFieldSearchV3(
inpId,
inpName,
inpPlaceHolder,
inpType,
hxGet,
hxTrigger,
hxTarget,
hxIndicator,
value,
hxSwap string,
hxInclude string,
hxBeforeRequest templ.ComponentScript,
hxAfterRequest templ.ComponentScript) {
<input
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
type={ inpType }
name={ inpName }
id={ inpId }
placeholder={ inpPlaceHolder }
hx-get={ hxGet }
hx-trigger={ hxTrigger }
hx-target={ hxTarget }
hx-indicator={ hxIndicator }
value={ value }
hx-include={ hxInclude }
hx-swap={ hxSwap }
hx-on::before-request={ hxBeforeRequest }
hx-on::after-request={ hxAfterRequest }
autocomplete="off"
/>
<script>
document.body.addEventListener('htmx:targetError', function(event) {
console.error('Error updating target element:', event.detail);
alert('There was an error updating the target element.');
});
</script>
}

View File

@@ -486,205 +486,3 @@ func MainCustomTextFieldSearchV2(
return templ_7745c5c3_Err
})
}
func MainCustomTextFieldSearchV3(
inpId,
inpName,
inpPlaceHolder,
inpType,
hxGet,
hxTrigger,
hxTarget,
hxIndicator,
value,
hxSwap string,
hxInclude 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)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var33 := templ.GetChildren(ctx)
if templ_7745c5c3_Var33 == nil {
templ_7745c5c3_Var33 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
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 class=\"form-control bg-field border-0 h-auto py-6 px-6 rounded-lg\" type=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var34 string
templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(inpType)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 103, Col: 16}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var35 string
templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(inpName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 104, Col: 16}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var36 string
templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(inpId)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 105, Col: 12}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" placeholder=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var37 string
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(inpPlaceHolder)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 106, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var38 string
templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 107, Col: 16}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38))
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_Var39 string
templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 108, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
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_Var40 string
templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 109, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var41 string
templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 110, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var42 string
templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(value)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 111, Col: 15}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42))
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_Var43 string
templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 112, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
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_Var44 string
templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 113, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44))
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_Var45 templ.ComponentScript = hxBeforeRequest
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var45.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_Var46 templ.ComponentScript = hxAfterRequest
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var46.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" autocomplete=\"off\"><script>\r\n document.body.addEventListener('htmx:targetError', function(event) {\r\n console.error('Error updating target element:', event.detail);\r\n alert('There was an error updating the target element.');\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
})
}

View File

@@ -27,16 +27,18 @@ templ PaginationV2(length int,
hx-trigger="click"
hx-target={ hxTarget }
hx-include={ hxInclude }
hx-disabled-elt=".btneditug, .btndeleteug"
>{ strconv.Itoa(i+1) }</a>
} else {
<a
hx-get={ link + "?" + "page=" + strconv.Itoa(i+1) }
class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1 btneditug"
class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1"
hx-swap={ hxSwap }
hx-indicator={ hxIndicator }
hx-trigger="click"
hx-target={ hxTarget }
hx-include={ hxInclude }
hx-disabled-elt=".btneditug, .btndeleteug"
>{ strconv.Itoa(i+1) }</a>
}
}

View File

@@ -132,14 +132,14 @@ func PaginationV2(length int,
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-disabled-elt=\".btneditug, .btndeleteug\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 30, Col: 25}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 31, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
@@ -157,20 +157,20 @@ func PaginationV2(length int,
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(link + "?" + "page=" + strconv.Itoa(i+1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 33, Col: 55}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 34, Col: 55}
}
_, 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("\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1 btneditug\" hx-swap=\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 35, Col: 22}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 36, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
@@ -183,7 +183,7 @@ func PaginationV2(length int,
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 36, Col: 32}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 37, Col: 32}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
@@ -196,7 +196,7 @@ func PaginationV2(length int,
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: `component\pagination\paginationv2.templ`, Line: 38, Col: 26}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 39, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
@@ -209,20 +209,20 @@ func PaginationV2(length int,
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 39, Col: 28}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 40, Col: 28}
}
_, 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("\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-disabled-elt=\".btneditug, .btndeleteug\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 40, Col: 25}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 42, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {

View File

@@ -1,60 +0,0 @@
package pagination
import "strconv"
import "cpone/component/customtextfield"
import "cpone/models"
templ PaginationV3(length int,
currentPage int,
link string,
paginationID string,
hxInclude string,
hxTarget string,
hxSwap string,
hxIndicator string,
hxSwapOob string,
hxBeforeRequest templ.ComponentScript,
hxAfterRequest templ.ComponentScript,
) {
// hx-on::before-request={ HideContent(contentID) }
// hx-on::after-request="alert('Done making a request!')"
<div
class="d-flex justify-content-between align-items-center flex-wrap"
hx-on::load={ hxAfterRequest }
id={ paginationID }
hx-swap-oob={ hxSwapOob }
>
<div class="d-flex flex-wrap py-2 mr-3">
for i:=0; i<length; i++ {
if (i+1) == currentPage {
<a
hx-get={ link + "?" + "page=" + strconv.Itoa(i+1) }
class="btn btn-icon btn-sm border-0 btn-light btn-hover-primary active mr-2 my-1"
hx-swap={ hxSwap }
hx-indicator={ hxIndicator }
hx-trigger="click"
hx-on::before-request={ hxBeforeRequest }
hx-target={ hxTarget }
hx-include={ hxInclude }
>{ strconv.Itoa(i+1) }</a>
} else {
<a
hx-get={ link + "?" + "page=" + strconv.Itoa(i+1) }
class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1 btneditug"
hx-swap={ hxSwap }
hx-on::before-request={ hxBeforeRequest }
hx-indicator={ hxIndicator }
hx-trigger="click"
hx-target={ hxTarget }
hx-include={ hxInclude }
>{ strconv.Itoa(i+1) }</a>
}
}
</div>
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{
ID: "currpage" + paginationID,
Name: "currpage" + paginationID,
Type: "hidden",
Value: strconv.Itoa(currentPage)})
</div>
}

View File

@@ -1,300 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package pagination
//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 "strconv"
import "cpone/component/customtextfield"
import "cpone/models"
func PaginationV3(length int,
currentPage int,
link string,
paginationID string,
hxInclude string,
hxTarget string,
hxSwap string,
hxIndicator string,
hxSwapOob 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)
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, hxAfterRequest)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex justify-content-between align-items-center flex-wrap\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 templ.ComponentScript = hxAfterRequest
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var2.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(paginationID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 24, Col: 19}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap-oob=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapOob)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 25, Col: 25}
}
_, 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("\"><div class=\"d-flex flex-wrap py-2 mr-3\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for i := 0; i < length; i++ {
if (i + 1) == currentPage {
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(link + "?" + "page=" + strconv.Itoa(i+1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 31, Col: 55}
}
_, 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("\" class=\"btn btn-icon btn-sm border-0 btn-light btn-hover-primary active mr-2 my-1\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 33, Col: 22}
}
_, 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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 34, Col: 32}
}
_, 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-trigger=\"click\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 templ.ComponentScript = hxBeforeRequest
_, 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-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 37, Col: 26}
}
_, 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(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 38, Col: 28}
}
_, 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("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 39, Col: 25}
}
_, 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("</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(link + "?" + "page=" + strconv.Itoa(i+1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 42, Col: 55}
}
_, 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("\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1 btneditug\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 44, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 templ.ComponentScript = hxBeforeRequest
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 46, Col: 32}
}
_, 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-trigger=\"click\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 48, Col: 26}
}
_, 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(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 49, Col: 28}
}
_, 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("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 50, Col: 25}
}
_, 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("</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
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{
ID: "currpage" + paginationID,
Name: "currpage" + paginationID,
Type: "hidden",
Value: strconv.Itoa(currentPage)}).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
})
}

View File

@@ -13,7 +13,7 @@ func toastBody(typeToastBody string) string {
}
func toastIcon(typeToast string) string {
var stringx string
var stringx string
if typeToast == "success" {
stringx = "solar:check-circle-broken"
} else {
@@ -30,12 +30,12 @@ func toastIcon(typeToast string) string {
}
}
return stringx
return stringx
}
templ CustomToastV2Show(title string, message string, typeToast string) {
<div
class="toast toast-top-right fade show"
class="toast fade show"
role="alert"
aria-live="assertive"
aria-atomic="true"
@@ -63,15 +63,14 @@ templ CustomToastV2Show(title string, message string, typeToast string) {
}
templ CustomToastV2Hide() {
<div
id="notification-001"
class="toast fade hide"
role="alert"
aria-live="assertive"
aria-atomic="true"
style="opacity: 0"
hx-swap-oob="true"
>
<div id="notification-001"
class="toast fade hide"
role="alert"
aria-live="assertive"
aria-atomic="true"
style="opacity: 0"
hx-swap-oob="true"
>
<div class="toast-header bg-success text-white">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--ep mr-2 icon-xl" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 1024 1024" data-icon="ep:success-filled"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"></path></svg>
<strong class="mr-auto">Success</strong>

View File

@@ -56,7 +56,7 @@ func CustomToastV2Show(title string, message string, typeToast string) templ.Com
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"toast toast-top-right fade show\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" id=\"notification-001\" hx-swap-oob=\"true\" hx-get=\"/dev/hidetoast\" hx-trigger=\"load delay:3s\" hx-target=\"this\" style=\"border-radius: 8px 8px 8px 8px;\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"toast fade show\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" id=\"notification-001\" hx-swap-oob=\"true\" hx-get=\"/dev/hidetoast\" hx-trigger=\"load delay:3s\" hx-target=\"this\" style=\"border-radius: 8px 8px 8px 8px;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

10
go.mod
View File

@@ -4,17 +4,18 @@ go 1.21.0
require (
github.com/a-h/templ v0.2.663
github.com/fsnotify/fsnotify v1.7.0
github.com/glebarez/go-sqlite v1.22.0
github.com/go-sql-driver/mysql v1.8.1
github.com/jmoiron/sqlx v1.4.0
github.com/labstack/echo/v4 v4.12.0
github.com/spf13/viper v1.18.2
golang.org/x/text v0.14.0
)
require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jmoiron/sqlx v1.4.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
@@ -24,7 +25,6 @@ require (
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.18.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
@@ -36,7 +36,7 @@ require (
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/labstack/gommon v0.4.2
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect

40
go.sum
View File

@@ -3,10 +3,13 @@ filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4
github.com/a-h/templ v0.2.663 h1:aa0WMm27InkYHGjimcM7us6hJ6BLhg98ZbfaiDPyjHE=
github.com/a-h/templ v0.2.663/go.mod h1:SA7mtYwVEajbIXFRh3vKdYm/4FYyLQAtPH1+KxzGPA8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/glebarez/go-sqlite v1.22.0 h1:uAcMJhaA6r3LHMTFgP0SifzgXg46yJkgxqyuyec+ruQ=
@@ -25,33 +28,36 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
github.com/labstack/echo/v4 v4.11.3 h1:Upyu3olaqSHkCjs1EJJwQ3WId8b8b1hxbogyommKktM=
github.com/labstack/echo/v4 v4.11.3/go.mod h1:UcGuQ8V6ZNRmSweBIJkPvGfwCMIlFmiqrPqiEBfPYws=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/labstack/echo/v4 v4.12.0 h1:IKpw49IMryVB2p1a4dzwlhP1O2Tf2E0Ir/450lH+kI0=
github.com/labstack/echo/v4 v4.12.0/go.mod h1:UP9Cr2DJXbOK3Kr9ONYzNowSh7HP0aG0ShAyycHSJvM=
github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8=
github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
@@ -69,7 +75,6 @@ github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMV
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
@@ -78,43 +83,34 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
modernc.org/libc v1.37.6 h1:orZH3c5wmhIQFTXF+Nt+eeauyd+ZIt2BX6ARe+kD+aw=

File diff suppressed because it is too large Load Diff

View File

@@ -1,954 +0,0 @@
package dev_handlers
import (
breadcrumadmin "cpone/component/breadcrumbadmin"
navbarmenu "cpone/component/navbar"
"cpone/component/pagination"
sidebaruserprofile "cpone/component/sidebar_user_profile"
customtoastv2 "cpone/component/toastbootstrap"
"cpone/models"
"cpone/services"
"cpone/utils"
dev_mdbahanview "cpone/views/dev/mdbahan"
"strconv"
"strings"
"github.com/a-h/templ"
"github.com/labstack/echo/v4"
"go.uber.org/zap"
)
type MdBahanServices interface {
GetListMdBahan(
search string,
stationID string,
currentPage int,
rowPerPage int) ([]models.Bahan, int, error)
GetMdBahanBreadCrumb(title string) (models.BreadCrumbV1, error)
GetListSampleStation(isFilter bool) ([]models.TmpSampleStation, error)
AddMdBahan(code string, name string, stationid string) (bool, error)
EditMdBahan(id string, code string, name string, stationid string) (bool, error)
GetMdBahanByID(id string) (models.Bahan, error)
DeleteMdBahan(id string) (bool, error)
}
func NewMdBahanHandler(us MdBahanServices) *MdBahanHandler {
return &MdBahanHandler{
MdBahanServices: us,
}
}
type MdBahanHandler struct {
MdBahanServices MdBahanServices
}
func (lh *MdBahanHandler) HandleShowMdBahanScreen(c echo.Context) error {
logger, _ := zap.NewProduction()
dataMenu, err := services.GetMenu()
paginationID := utils.GenerateRandomID("paginationID")
modalAddID := utils.GenerateRandomID("modalAdd")
modalAddBodyID := utils.GenerateRandomID("modalAddbody")
modalEditID := utils.GenerateRandomID("modalEdit")
modalEditBodyID := utils.GenerateRandomID("modalEditbody")
modalDeleteID := utils.GenerateRandomID("modalDelete")
modalDeleteBodyID := utils.GenerateRandomID("modalDeletebody")
tableBahanID := utils.GenerateRandomID("BahanID")
if err != nil {
defer logger.Sync()
logger.Info("ERROR BREADCRUMB DEV",
zap.Any("error", err),
)
return err
}
//get user login
dataUser, err := services.GetUserLogin()
if err != nil {
defer logger.Sync()
logger.Info("ERROR BREADCRUMB DEV",
zap.Any("error", err),
)
return err
}
dataBreadCrumb, err := lh.MdBahanServices.GetMdBahanBreadCrumb("Bahan")
if err != nil {
defer logger.Sync()
logger.Info("ERROR BREADCRUMB DEV",
zap.Any("error", err),
)
return err
}
//Breadcrumb component
breadcrumbComponent := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadCrumb)
// navbar menu
navbarmenuComponent := navbarmenu.NavbarMenu(dataMenu)
// navbar user
navbaruserComponent := navbarmenu.Navbar(dataUser)
// sidebar
sidebaruserprofileComponent := sidebaruserprofile.Navbaruserprofile(dataUser)
bahanList, totalPage, err := lh.MdBahanServices.GetListMdBahan("", "0", 1, 5)
defer logger.Sync()
logger.Info("GET DATA BAHAN",
zap.Any("data", bahanList),
zap.Any("err", err),
zap.Any("totalPage", totalPage),
)
stationListFilter, err := lh.MdBahanServices.GetListSampleStation(true)
defer logger.Sync()
logger.Info("GET STATION LIST Filter",
zap.Any("err", err),
)
stationList, err := lh.MdBahanServices.GetListSampleStation(false)
defer logger.Sync()
logger.Info("GET STATION LIST ",
zap.Any("err", err),
)
//Bahan Table
// #dialogDeleteBodyID, #dialogDeleteID
mdBahanTable := dev_mdbahanview.TableBahan(
bahanList,
tableBahanID,
"/dev/md/bahan/openedit",
"#"+modalEditBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"/dev/md/bahan/opendelete",
"#"+modalDeleteBodyID,
"outerHTML",
"#dialogDeleteBodyID, #dialogDeleteID, #dialogEditBodyID, #dialogEditID")
//FIlter table
mdBahanFilter := dev_mdbahanview.MdBahanFilter(
"/dev/md/bahan/filter",
"input changed delay:500ms",
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
"outerHTML",
"#"+paginationID,
stationListFilter,
stationListFilter[0].T_SampleStationID,
dev_mdbahanview.BeforeRequestContent(),
dev_mdbahanview.AfterRequestContent(),
)
//Pagination
mdbahanPagination := pagination.PaginationV3(
totalPage, 1,
"/dev/md/bahan/pagination",
paginationID,
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
"#"+paginationID,
"outerHTML",
"",
"",
dev_mdbahanview.BeforeRequestContent(),
dev_mdbahanview.AfterRequestContent(),
)
//Form Add
modalAddBody := dev_mdbahanview.BodyFormBahan(
"",
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
Name: "kodebahan",
Placeholder: "Kode Bahan",
Type: "text"},
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
Name: "namabahan",
Placeholder: "Nama Bahan",
Type: "text"},
models.CustomDropdownV2Prm{
Name: "stationid",
Label: "Sample Station",
ListItem: dev_mdbahanview.ListItemStation(stationList, 0),
},
modalAddBodyID,
dev_mdbahanview.JsShowModal(""),
)
modalAddAction := dev_mdbahanview.ActionFormBahan("/dev/md/bahan/closeaddform", "#"+modalAddBodyID, "outerHTML", "#"+modalAddID)
modalAddBtnCls := dev_mdbahanview.BtnCloseFormBahan("/dev/md/bahan/closeaddform", "#"+modalAddBodyID, "outerHTML", "#"+modalAddID)
modalAddBahan := dev_mdbahanview.BahanForm(models.BahanFormComponent{
IDComponent: "",
Link: "/dev/md/bahan/add",
HxTarget: "#" + modalAddBodyID,
HxSwap: "outerHTML",
HxInclude: "#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage" + paginationID,
ModalID: modalAddID,
ModalTitle: "New-Bahan",
DialogBody: modalAddBody,
DialogAction: modalAddAction,
ButtonCLose: modalAddBtnCls,
})
//Form Edit
modalEditBody := dev_mdbahanview.BodyFormBahan(
"",
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
Name: "kodebahan",
Placeholder: "Kode Bahan",
Type: "text"},
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
Name: "namabahan",
Placeholder: "Nama Bahan",
Type: "text"},
models.CustomDropdownV2Prm{
Name: "stationid",
Label: "Sample Station",
ListItem: dev_mdbahanview.ListItemStation(stationList, 0),
},
modalEditBodyID,
dev_mdbahanview.JsShowModal(""),
)
modalEditAction := dev_mdbahanview.ActionFormBahan("/dev/md/bahan/closeeditform", "#"+modalEditBodyID, "outerHTML", "#"+modalEditID)
modalEditBtnCls := dev_mdbahanview.BtnCloseFormBahan("/dev/md/bahan/closeeditform", "#"+modalEditBodyID, "outerHTML", "#"+modalEditID)
modalEditBahan := dev_mdbahanview.BahanForm(models.BahanFormComponent{
IDComponent: "",
Link: "/dev/md/bahan/edit",
HxTarget: "#" + modalEditBodyID,
HxSwap: "outerHTML",
HxInclude: "#filter-name, #filter-station, #tableID, #paginationID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage" + paginationID,
ModalID: modalEditID,
ModalTitle: "Edit-Bahan",
DialogBody: modalEditBody,
DialogAction: modalEditAction,
ButtonCLose: modalEditBtnCls,
})
//Form Delete
modalDeleteBody := dev_mdbahanview.DeleteConfirmationBody(
"",
modalDeleteBodyID,
"Apakah anda yakin menghapus bahan berikut ?",
[]string{"Kode", "Nama Bahan", "Sample Station"},
[]string{"", "", ""}, dev_mdbahanview.JsShowModal(""))
modalDeleteAction := dev_mdbahanview.ActionFormBahanDelete("/dev/md/bahan/closedeleteform", "#"+modalDeleteBodyID, "outerHTML", "#"+modalDeleteID)
modalDeleteBtnCls := dev_mdbahanview.BtnCloseFormBahan("/dev/md/bahan/closedeleteform", "#"+modalDeleteBodyID, "outerHTML", "#"+modalDeleteID)
modalDeleteBahan := dev_mdbahanview.BahanForm(models.BahanFormComponent{
IDComponent: "",
Link: "/dev/md/bahan/delete",
HxTarget: "#" + modalDeleteBodyID,
HxSwap: "outerHTML",
HxInclude: "#filter-name, #filter-station, #tableID, #paginationID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage" + paginationID,
ModalID: modalDeleteID,
ModalTitle: "Delete-Bahan",
DialogBody: modalDeleteBody,
DialogAction: modalDeleteAction,
ButtonCLose: modalDeleteBtnCls,
})
mdBahanScreen := dev_mdbahanview.MdBahanScreen(
tableBahanID,
paginationID,
modalAddID,
modalAddBodyID,
modalEditID,
modalEditBodyID,
modalDeleteID,
modalDeleteBodyID,
breadcrumbComponent,
mdBahanTable,
mdBahanFilter,
mdbahanPagination,
modalAddBahan,
modalEditBahan,
modalDeleteBahan)
cssMdBahan := dev_mdbahanview.CssMdUserGroup()
jsMdBahan := dev_mdbahanview.JsMdBahan()
view := dev_mdbahanview.ShowMdBahanScreen(
"Md Bahan",
mdBahanScreen,
cssMdBahan,
jsMdBahan,
navbarmenuComponent,
navbaruserComponent,
sidebaruserprofileComponent)
return utils.View(c, view)
}
func (lh *MdBahanHandler) HandleFilterMdBahan(c echo.Context) error {
logger, _ := zap.NewProduction()
var retval []templ.Component
filtername := c.QueryParam("filtername")
filterstation := c.QueryParam("filterstation")
dialogEditBodyID := c.QueryParam("dialogEditBodyID")
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
tableID := c.QueryParam("tableID")
paginationID := c.QueryParam("paginationID")
bahanList, totalPage, err := lh.MdBahanServices.GetListMdBahan(filtername, filterstation, 1, 5)
defer logger.Sync()
logger.Info("GET DATA BAHAN",
zap.Any("data", bahanList),
zap.Any("err", err),
zap.Any("totalPage", totalPage),
)
//Bahan Table
mdBahanTable := dev_mdbahanview.TableBahan(
bahanList,
tableID,
"/dev/md/bahan/openedit",
"#"+dialogEditBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"/dev/md/bahan/opendelete",
"#"+dialogDeleteBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
//Pagination
mdbahanPagination := pagination.PaginationV3(
totalPage, 1,
"/dev/md/bahan/pagination",
paginationID,
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
"#"+paginationID,
"outerHTML",
"",
"",
dev_mdbahanview.BeforeRequestContent(),
dev_mdbahanview.AfterRequestContent(),
)
retval = append(retval, mdBahanTable)
retval = append(retval, mdbahanPagination)
return utils.ViewMulti(c, retval)
}
func (lh *MdBahanHandler) HandlePaginationMdBahan(c echo.Context) error {
logger, _ := zap.NewProduction()
var retval []templ.Component
pageparam := c.QueryParam("page")
filtername := c.QueryParam("filtername")
filterstation := c.QueryParam("filterstation")
tableID := c.QueryParam("tableID")
dialogEditBodyID := c.QueryParam("dialogEditBodyID")
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
paginationID := c.QueryParam("paginationID")
page, err := strconv.Atoi(pageparam)
if err != nil {
defer logger.Sync()
logger.Info("ERROR CONVERT PAGE PARAM",
zap.Any("page", page),
zap.Any("error ", err),
)
return err
}
bahanList, totalPage, err := lh.MdBahanServices.GetListMdBahan(filtername, filterstation, page, 5)
defer logger.Sync()
logger.Info("GET DATA BAHAN",
zap.Any("data", bahanList),
zap.Any("err", err),
zap.Any("totalPage", totalPage),
)
//Bahan Table
mdBahanTable := dev_mdbahanview.TableBahan(
bahanList,
tableID,
"/dev/md/bahan/openedit",
"#"+dialogEditBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"/dev/md/bahan/opendelete",
"#"+dialogDeleteBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
//Pagination
mdbahanPagination := pagination.PaginationV3(
totalPage, page,
"/dev/md/bahan/pagination",
paginationID,
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
"#"+paginationID,
"outerHTML",
"",
"",
dev_mdbahanview.BeforeRequestContent(),
dev_mdbahanview.AfterRequestContent(),
)
retval = append(retval, mdBahanTable)
retval = append(retval, mdbahanPagination)
return utils.ViewMulti(c, retval)
}
func (lh *MdBahanHandler) HandleCloseFormAddMdBahan(c echo.Context) error {
logger, _ := zap.NewProduction()
stationList, err := lh.MdBahanServices.GetListSampleStation(false)
defer logger.Sync()
logger.Info("GET DATA STATIOn",
zap.Any("err", err),
)
dialogAddBodyID := c.FormValue("dialogAddBodyID")
dialogAddID := c.FormValue("dialogAddID")
modalAddBody := dev_mdbahanview.BodyFormBahan(
"",
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
Name: "kodebahan",
Placeholder: "Kode Bahan",
Type: "text"},
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
Name: "namabahan",
Placeholder: "Nama Bahan",
Type: "text"},
models.CustomDropdownV2Prm{
Name: "stationid",
Label: "Sample Station",
ListItem: dev_mdbahanview.ListItemStation(stationList, 0),
},
dialogAddBodyID,
dev_mdbahanview.JsHideModal("#"+dialogAddID),
)
return utils.View(c, modalAddBody)
}
func (lh *MdBahanHandler) HandleAddMdBahan(c echo.Context) error {
logger, _ := zap.NewProduction()
code := c.FormValue("kodebahan")
name := c.FormValue("namabahan")
stationIDPrm := c.FormValue("stationid")
tableID := c.FormValue("tableID")
paginationID := c.FormValue("paginationID")
filtername := c.FormValue("filtername")
filterstation := c.FormValue("filterstation")
currPagePrm := c.FormValue("currpage" + paginationID)
dialogAddBodyID := c.FormValue("dialogAddBodyID")
// searchID := c.FormValue("searchID")
dialogAddID := c.FormValue("dialogAddID")
dialogEditBodyID := c.FormValue("dialogEditBodyID")
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
currPage, err := strconv.Atoi(currPagePrm)
if err != nil {
return err
}
stationID, err := strconv.Atoi(stationIDPrm)
if err != nil {
return err
}
formValidation := ""
codeValidation := ""
nameValidation := ""
stationValidation := ""
if strings.TrimSpace(code) == "" {
formValidation = "Code bahan tidak boleh kosong"
codeValidation = "Code bahan tidak boleh kosong"
nameValidation = ""
stationValidation = ""
}
if strings.TrimSpace(name) == "" {
formValidation = "Nama bahan tidak boleh kosong"
codeValidation = ""
stationValidation = ""
nameValidation = "Nama bahan tidak boleh kosong"
}
if stationID == 0 {
formValidation = "Pilih salah satu station"
codeValidation = ""
nameValidation = ""
stationValidation = "Pilih salah satu station"
}
if strings.TrimSpace(code) == "" && strings.TrimSpace(name) == "" {
formValidation = "Code,nama, dan station bahan tidak boleh kosong"
codeValidation = "Code bahan tidak boleh kosong"
stationValidation = "Pilih salah satu station"
nameValidation = "Nama bahan tidak boleh kosong"
}
stationList, err := lh.MdBahanServices.GetListSampleStation(false)
defer logger.Sync()
logger.Info("GET DATA STATIOn",
zap.Any("err", err),
)
if formValidation != "" || codeValidation != "" || nameValidation != "" || stationValidation != "" {
newForm := dev_mdbahanview.BodyFormBahan(
"",
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
Name: "kodebahan",
Placeholder: "Kode Bahan",
Value: code,
ErrorMsg: codeValidation,
Type: "text"},
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
Name: "namabahan",
Placeholder: "Nama Bahan",
ErrorMsg: nameValidation,
Value: name,
Type: "text"},
models.CustomDropdownV2Prm{
Name: "stationid",
Label: "Sample Station",
ErrorMsg: stationValidation,
ListItem: dev_mdbahanview.ListItemStation(stationList, stationID),
},
dialogAddBodyID,
dev_mdbahanview.JsShowModal(""),
)
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Warning", formValidation, "warning"), newForm})
}
_, err = lh.MdBahanServices.AddMdBahan(code, name, stationIDPrm)
if err != nil {
newForm := dev_mdbahanview.BodyFormBahan(
"",
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
Name: "kodebahan",
Placeholder: "Kode Bahan",
Value: code,
Type: "text"},
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
Name: "namabahan",
Placeholder: "Nama Bahan",
Value: name,
Type: "text"},
models.CustomDropdownV2Prm{
Name: "stationid",
Label: "Sample Station",
ListItem: dev_mdbahanview.ListItemStation(stationList, int(stationID)),
},
dialogAddBodyID,
dev_mdbahanview.JsShowModal(""),
)
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Gagal", err.Error(), "danger"), newForm})
}
bahanList, totalPage, err := lh.MdBahanServices.GetListMdBahan(filtername, filterstation, currPage, 5)
defer logger.Sync()
logger.Info("GET DATA BAHAN",
zap.Any("data", bahanList),
zap.Any("err", err),
zap.Any("totalPage", totalPage),
)
//Bahan Table
mdBahanTable := dev_mdbahanview.TableBahan(
bahanList,
tableID,
"/dev/md/bahan/openedit",
"#"+dialogEditBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"/dev/md/bahan/opendelete",
"#"+dialogDeleteBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
//Pagination
mdbahanPagination := pagination.PaginationV3(
totalPage, currPage,
"/dev/md/bahan/pagination",
paginationID,
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
"#"+paginationID,
"outerHTML",
"",
"true",
dev_mdbahanview.BeforeRequestContent(),
dev_mdbahanview.AfterRequestContent(),
)
//Form Add
modalAddBody := dev_mdbahanview.BodyFormBahan(
"",
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
Name: "kodebahan",
Placeholder: "Kode Bahan",
Type: "text"},
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
Name: "namabahan",
Placeholder: "Nama Bahan",
Type: "text"},
models.CustomDropdownV2Prm{
Name: "stationid",
Label: "Sample Station",
ListItem: dev_mdbahanview.ListItemStation(stationList, 0),
},
dialogAddBodyID,
dev_mdbahanview.JsHideModal("#"+dialogAddID),
)
toastSuccess := customtoastv2.CustomToastV2Show("Success", "Success add bahan ", "success")
retval := []templ.Component{toastSuccess, mdBahanTable, mdbahanPagination, modalAddBody}
// time.Sleep(20 * time.Second)
return utils.ViewMulti(c, retval)
}
func (lh *MdBahanHandler) HandleOpenEditMdBahan(c echo.Context) error {
logger, _ := zap.NewProduction()
id := c.QueryParam("id")
dialogEditID := c.QueryParam("dialogEditID")
dialogEditBodyID := c.QueryParam("dialogEditBodyID")
stationList, err := lh.MdBahanServices.GetListSampleStation(false)
defer logger.Sync()
logger.Info("GET DATA STATION",
zap.Any("err", err),
)
dataBahan, err := lh.MdBahanServices.GetMdBahanByID(id)
if err != nil {
newForm := dev_mdbahanview.BodyFormBahan(
id,
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
Name: "kodebahan",
Placeholder: "Kode Bahan",
Type: "text"},
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
Name: "namabahan",
Placeholder: "Nama Bahan",
Type: "text"},
models.CustomDropdownV2Prm{
Name: "stationid",
Label: "Sample Station",
ListItem: dev_mdbahanview.ListItemStation(stationList, dataBahan.T_BahanT_SampleStationID),
},
dialogEditBodyID,
dev_mdbahanview.JsHideModal(""),
)
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Error", "Get data bahan error", "danger"), newForm})
}
newForm := dev_mdbahanview.BodyFormBahan(
id,
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
Name: "kodebahan",
Placeholder: "Kode Bahan",
Value: dataBahan.T_BahanCode,
Type: "text"},
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
Name: "namabahan",
Placeholder: "Nama Bahan",
Value: dataBahan.T_BahanName,
Type: "text"},
models.CustomDropdownV2Prm{
Name: "stationid",
Label: "Sample Station",
ListItem: dev_mdbahanview.ListItemStation(stationList, dataBahan.T_BahanT_SampleStationID),
},
dialogEditBodyID,
dev_mdbahanview.JsShowModal("#"+dialogEditID),
)
return utils.View(c, newForm)
}
func (lh *MdBahanHandler) HandleCloseFormEditMdBahan(c echo.Context) error {
logger, _ := zap.NewProduction()
stationList, err := lh.MdBahanServices.GetListSampleStation(false)
dialogEditID := c.FormValue("dialogEditID")
dialogEditBodyID := c.FormValue("dialogEditBodyID")
defer logger.Sync()
logger.Info("GET DATA STATION",
zap.Any("err", err),
zap.Any("dialogeditbodyid", dialogEditBodyID),
)
modalAddBody := dev_mdbahanview.BodyFormBahan(
"",
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
Name: "kodebahan",
Placeholder: "Kode Bahan",
Type: "text"},
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
Name: "namabahan",
Placeholder: "Nama Bahan",
Type: "text"},
models.CustomDropdownV2Prm{
Name: "stationid",
Label: "Sample Station",
ListItem: dev_mdbahanview.ListItemStation(stationList, 0),
},
dialogEditBodyID,
dev_mdbahanview.JsHideModal("#"+dialogEditID),
)
return utils.View(c, modalAddBody)
}
func (lh *MdBahanHandler) HandleEditMdBahan(c echo.Context) error {
logger, _ := zap.NewProduction()
code := c.FormValue("kodebahan")
name := c.FormValue("namabahan")
id := c.FormValue("bahanid")
stationIDPrm := c.FormValue("stationid")
tableID := c.FormValue("tableID")
paginationID := c.FormValue("paginationID")
filtername := c.FormValue("filtername")
filterstation := c.FormValue("filterstation")
currPagePrm := c.FormValue("currpage" + paginationID)
// dialogAddBodyID := c.FormValue("dialogAddBodyID")
// searchID := c.FormValue("searchID")
dialogEditID := c.FormValue("dialogEditID")
dialogEditBodyID := c.FormValue("dialogEditBodyID")
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
currPage, err := strconv.Atoi(currPagePrm)
if err != nil {
return err
}
stationID, err := strconv.Atoi(stationIDPrm)
if err != nil {
return err
}
formValidation := ""
codeValidation := ""
nameValidation := ""
stationValidation := ""
if strings.TrimSpace(code) == "" {
formValidation = "Code bahan tidak boleh kosong"
codeValidation = "Code bahan tidak boleh kosong"
nameValidation = ""
stationValidation = ""
}
if strings.TrimSpace(name) == "" {
formValidation = "Nama bahan tidak boleh kosong"
codeValidation = ""
stationValidation = ""
nameValidation = "Nama bahan tidak boleh kosong"
}
if stationID == 0 {
formValidation = "Pilih salah satu station"
codeValidation = ""
nameValidation = ""
stationValidation = "Pilih salah satu station"
}
if strings.TrimSpace(code) == "" && strings.TrimSpace(name) == "" {
formValidation = "Code,nama, dan station bahan tidak boleh kosong"
codeValidation = "Code bahan tidak boleh kosong"
stationValidation = "Pilih salah satu station"
nameValidation = "Nama bahan tidak boleh kosong"
}
stationList, err := lh.MdBahanServices.GetListSampleStation(false)
defer logger.Sync()
logger.Info("GET DATA STATIOn",
zap.Any("err", err),
)
if formValidation != "" || codeValidation != "" || nameValidation != "" || stationValidation != "" {
newForm := dev_mdbahanview.BodyFormBahan(
id,
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
Name: "kodebahan",
Placeholder: "Kode Bahan",
Value: code,
ErrorMsg: codeValidation,
Type: "text"},
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
Name: "namabahan",
Placeholder: "Nama Bahan",
ErrorMsg: nameValidation,
Value: name,
Type: "text"},
models.CustomDropdownV2Prm{
Name: "stationid",
Label: "Sample Station",
ErrorMsg: stationValidation,
ListItem: dev_mdbahanview.ListItemStation(stationList, stationID),
},
dialogEditBodyID,
dev_mdbahanview.JsShowModal(""),
)
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Warning", formValidation, "warning"), newForm})
}
_, err = lh.MdBahanServices.EditMdBahan(id, code, name, stationIDPrm)
if err != nil {
newForm := dev_mdbahanview.BodyFormBahan(
id,
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
Name: "kodebahan",
Placeholder: "Kode Bahan",
Value: code,
Type: "text"},
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
Name: "namabahan",
Placeholder: "Nama Bahan",
Value: name,
Type: "text"},
models.CustomDropdownV2Prm{
Name: "stationid",
Label: "Sample Station",
ListItem: dev_mdbahanview.ListItemStation(stationList, int(stationID)),
},
dialogEditBodyID,
dev_mdbahanview.JsShowModal(""),
)
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Gagal", err.Error(), "danger"), newForm})
}
bahanList, totalPage, err := lh.MdBahanServices.GetListMdBahan(filtername, filterstation, currPage, 5)
defer logger.Sync()
logger.Info("GET DATA BAHAN",
zap.Any("data", bahanList),
zap.Any("err", err),
zap.Any("totalPage", totalPage),
)
//Bahan Table
mdBahanTable := dev_mdbahanview.TableBahan(
bahanList,
tableID,
"/dev/md/bahan/openedit",
"#"+dialogEditBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"/dev/md/bahan/opendelete",
"#"+dialogDeleteBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
//Pagination
mdbahanPagination := pagination.PaginationV3(
totalPage, currPage,
"/dev/md/bahan/pagination",
paginationID,
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
"#"+paginationID,
"outerHTML",
"",
"true",
dev_mdbahanview.BeforeRequestContent(),
dev_mdbahanview.AfterRequestContent(),
)
//Form Add
modalAddBody := dev_mdbahanview.BodyFormBahan(
"",
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
Name: "kodebahan",
Placeholder: "Kode Bahan",
Type: "text"},
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
Name: "namabahan",
Placeholder: "Nama Bahan",
Type: "text"},
models.CustomDropdownV2Prm{
Name: "stationid",
Label: "Sample Station",
ListItem: dev_mdbahanview.ListItemStation(stationList, 0),
},
dialogEditBodyID,
dev_mdbahanview.JsHideModal("#"+dialogEditID),
)
toastSuccess := customtoastv2.CustomToastV2Show("Success", "Success edit bahan ", "success")
retval := []templ.Component{toastSuccess, mdBahanTable, mdbahanPagination, modalAddBody}
// time.Sleep(20 * time.Second)
return utils.ViewMulti(c, retval)
}
func (lh *MdBahanHandler) HandleOpenDeleteMdBahan(c echo.Context) error {
logger, _ := zap.NewProduction()
id := c.QueryParam("id")
dialogDeleteID := c.QueryParam("dialogDeleteID")
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
dataBahan, err := lh.MdBahanServices.GetMdBahanByID(id)
if err != nil {
defer logger.Sync()
logger.Info("GET DATA BAHAN",
zap.Any("err", err),
)
newForm := dev_mdbahanview.DeleteConfirmationBody(
"",
dialogDeleteBodyID,
"Apakah anda yakin menghapus bahan berikut ?",
[]string{"Kode", "Nama Bahan", "Sample Station"},
[]string{"", "", ""}, dev_mdbahanview.JsShowModal(""))
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Error", "Get data bahan error", "danger"), newForm})
}
newForm := dev_mdbahanview.DeleteConfirmationBody(
strconv.Itoa(dataBahan.T_BahanID),
dialogDeleteBodyID,
"Apakah anda yakin menghapus bahan berikut ?",
[]string{"Kode", "Nama Bahan", "Sample Station"},
[]string{dataBahan.T_BahanCode, dataBahan.T_BahanName, dataBahan.T_SampleStationName}, dev_mdbahanview.JsShowModal("#"+dialogDeleteID))
return utils.View(c, newForm)
}
func (lh *MdBahanHandler) HandleCloseDeleteMdBahan(c echo.Context) error {
dialogDeleteID := c.FormValue("dialogDeleteID")
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
newForm := dev_mdbahanview.DeleteConfirmationBody(
"",
dialogDeleteBodyID,
"Apakah anda yakin menghapus bahan berikut ?",
[]string{"Kode", "Nama Bahan", "Sample Station"},
[]string{"", "", ""}, dev_mdbahanview.JsHideModal("#"+dialogDeleteID))
return utils.View(c, newForm)
}
func (lh *MdBahanHandler) HandleDeleteMdBahan(c echo.Context) error {
logger, _ := zap.NewProduction()
id := c.FormValue("bahanid")
tableID := c.FormValue("tableID")
paginationID := c.FormValue("paginationID")
filtername := c.FormValue("filtername")
filterstation := c.FormValue("filterstation")
currPagePrm := c.FormValue("currpage" + paginationID)
// dialogAddBodyID := c.FormValue("dialogAddBodyID")
// searchID := c.FormValue("searchID")
dialogDeleteID := c.FormValue("dialogDeleteID")
dialogEditBodyID := c.FormValue("dialogEditBodyID")
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
currPage, err := strconv.Atoi(currPagePrm)
if err != nil {
return err
}
_, err = lh.MdBahanServices.DeleteMdBahan(id)
if err != nil {
defer logger.Sync()
logger.Info("ERR DELETE MD BAHAN",
zap.Any("err", err),
)
newForm := dev_mdbahanview.DeleteConfirmationBody(
"",
dialogDeleteBodyID,
"Apakah anda yakin menghapus bahan berikut ?",
[]string{"Kode", "Nama Bahan", "Sample Station"},
[]string{"", "", ""}, dev_mdbahanview.JsShowModal(""))
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Error", "Get data bahan error", "danger"), newForm})
}
bahanList, totalPage, err := lh.MdBahanServices.GetListMdBahan(filtername, filterstation, currPage, 5)
defer logger.Sync()
logger.Info("GET DATA BAHAN",
zap.Any("data", bahanList),
zap.Any("err", err),
zap.Any("totalPage", totalPage),
)
//Bahan Table
mdBahanTable := dev_mdbahanview.TableBahan(
bahanList,
tableID,
"/dev/md/bahan/openedit",
"#"+dialogEditBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"/dev/md/bahan/opendelete",
"#"+dialogDeleteBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
//Pagination
mdbahanPagination := pagination.PaginationV3(
totalPage, currPage,
"/dev/md/bahan/pagination",
paginationID,
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
"#"+paginationID,
"outerHTML",
"",
"true",
dev_mdbahanview.BeforeRequestContent(),
dev_mdbahanview.AfterRequestContent(),
)
toastSuccess := customtoastv2.CustomToastV2Show("Success", "Berhasil hapus bahan", "success")
newForm := dev_mdbahanview.DeleteConfirmationBody(
"",
dialogDeleteBodyID,
"Apakah anda yakin menghapus bahan berikut ?",
[]string{"Kode", "Nama Bahan", "Sample Station"},
[]string{"", "", ""}, dev_mdbahanview.JsHideModal("#"+dialogDeleteID))
return utils.ViewMulti(c, []templ.Component{toastSuccess, mdBahanTable, mdbahanPagination, newForm})
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,141 @@
package dev_handlers
import (
breadcrumbadmin "cpone/component/breadcrumbadmin"
navbarmenu "cpone/component/navbar"
"cpone/component/pagination"
sidebaruserprofile "cpone/component/sidebar_user_profile"
"cpone/models"
"cpone/services"
"cpone/utils"
dev_mdsamplestationview "cpone/views/dev/mdsamplestation"
"fmt"
"strconv"
"github.com/a-h/templ"
"github.com/labstack/echo/v4"
"go.uber.org/zap"
)
type MDSampleStationServices interface {
GetMDSampleStationBreadcrumb() (models.BreadCrumbV1, error)
GetListSampleStation(search string, currentPage int, rowPerPage int) ([]models.MDSampleStation, int, error)
}
func NewMDSampleStationHandler(ss MDSampleStationServices) *MDSampleStationHandler {
return &MDSampleStationHandler{
MDSampleStationServices: ss,
}
}
type MDSampleStationHandler struct {
MDSampleStationServices MDSampleStationServices
}
func (mdss *MDSampleStationHandler) HandleShowMDSampleStationScreen(c echo.Context) error {
logger, _ := zap.NewProduction()
title := "Master Sample Station"
tableID := utils.GenerateRandomID("tableID")
paginationID := utils.GenerateRandomID("paginationID")
dialogAddID := utils.GenerateRandomID("dialogAddID")
// dialogEditID := utils.GenerateRandomID("dialogEditID")
// dialogEditBodyID := utils.GenerateRandomID("dialogEditBodyID")
// dialogDeleteID := utils.GenerateRandomID("dialogDeleteID")
// dialogDeleteBodyID := utils.GenerateRandomID("dialogDeleteBodyID")
dataMenu, err := services.GetMenu()
if err != nil {
return err
}
dataUser, err := services.GetUserLogin()
if err != nil {
return err
}
defer logger.Sync()
logger.Info("ERROR LOAD DEV", zap.Any("data", dataUser))
dataBreadcrumb, err := mdss.MDSampleStationServices.GetMDSampleStationBreadcrumb()
if err != nil {
defer logger.Sync()
logger.Info("ERROR BREADCRUMB DEV", zap.Any("error", err))
return err
}
navbarmenuComp := navbarmenu.NavbarMenu(dataMenu)
navbaruserComp := navbarmenu.Navbar(dataUser)
breadcrumbComp := breadcrumbadmin.MainBreadcrumbAdminV1(dataBreadcrumb)
sidebaruserprofilceComp := sidebaruserprofile.Navbaruserprofile(dataUser)
// table content
dataTable, totalPage, err := mdss.MDSampleStationServices.GetListSampleStation("", 1, 5)
if err != nil {
defer logger.Sync()
logger.Info("ERROR GET LIST SAMPLE STATION", zap.Any("error", err))
return err
}
fmt.Println("data sample station", dataTable)
tableComponent := dev_mdsamplestationview.TableSampleStation(dataTable, tableID)
// pagination table
paginationTable := pagination.PaginationV2(
totalPage,
1,
"/dev/md/samplestation/changepage",
paginationID,
"#tableID, #paginationID",
"#"+paginationID,
"outerHTML", "", "",
)
content := dev_mdsamplestationview.ContentMDSampleStation(
tableID,
dialogAddID,
paginationID,
breadcrumbComp,
tableComponent,
paginationTable,
)
css := dev_mdsamplestationview.CSSMDSampleStation()
js := dev_mdsamplestationview.JSMDSampleStation()
view := dev_mdsamplestationview.ShowMDSampleStation(title, content, css, js, navbarmenuComp, navbaruserComp, sidebaruserprofilceComp)
return utils.View(c, view)
}
func (mdss *MDSampleStationHandler) HandleChangePageSampleStation(c echo.Context) error {
pageparam := c.QueryParam("page")
tableID := c.QueryParam("tableID")
paginationID := c.QueryParam("paginationID")
var retval []templ.Component
logger, _ := zap.NewProduction()
page, err := strconv.Atoi(pageparam)
if err != nil {
defer logger.Sync()
logger.Info("ERROR CONVERT PAGE PARAM", zap.Any("page", page), zap.Any("error", err))
return err
}
dataSS, totalPage, err := mdss.MDSampleStationServices.GetListSampleStation("", page, 5)
if err != nil {
defer logger.Sync()
logger.Info("ERROR GET DATA", zap.Any("error", err))
return err
}
tableComp := dev_mdsamplestationview.TableSampleStation(dataSS, tableID)
paginationComp := pagination.PaginationV2(
totalPage,
page,
"/dev/md/samplestation/changepage",
paginationID,
"#tableID, #paginationID",
"#"+paginationID,
"outerHTML", "", "")
retval = append(retval, tableComp)
retval = append(retval, paginationComp)
return utils.ViewMulti(c, retval)
}

View File

@@ -126,17 +126,15 @@ func (lh *MdUserGroupHandler) HandleShowMdUserGroupScreen(c echo.Context) error
)
//filter user group component
usergroupFilterComponent := customtextfieldsearch.MainCustomTextFieldSearchV3(searchID,
usergroupFilterComponent := customtextfieldsearch.MainCustomTextFieldSearchV2(searchID,
"search",
"Cari Kode/Nama",
"text",
"/dev/md/usergroupv2/filter",
"input changed delay:500ms, search",
"#"+paginationID, "#loadingcontent", "", "outerHTML", "#tableID, #paginationID, #searchID,#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent())
"#"+paginationID, "", "", "outerHTML", "#tableID, #paginationID, #searchID,#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
//Pagination
userGroupPaginationComponent := pagination.PaginationV3(
userGroupPaginationComponent := pagination.PaginationV2(
totalPage,
1,
"/dev/md/usergroupv2/changepage",
@@ -144,8 +142,6 @@ func (lh *MdUserGroupHandler) HandleShowMdUserGroupScreen(c echo.Context) error
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"#"+paginationID,
"outerHTML", "", "",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent(),
)
//modal add form
@@ -182,7 +178,7 @@ func (lh *MdUserGroupHandler) HandleShowMdUserGroupScreen(c echo.Context) error
Link: "/dev/md/usergroupv2/add",
HxTarget: "#" + dialogAddBodyID,
HxSwap: "outerHTML",
HxInclude: "#tableID, #paginationID, #searchID, #dialogAddBodyID, #dialogAddID, #dialogDeleteBodyID, #dialogEditBodyID, #" + searchID + ", #currpage" + paginationID,
HxInclude: "#tableID, #paginationID, #searchID, #dialogAddBodyID, #dialogAddID, #" + searchID + ", #currpage" + paginationID,
ModalID: dialogAddID,
ModalTitle: "New-User Group",
DialogBody: dialogAddBodyCmp,
@@ -225,7 +221,7 @@ func (lh *MdUserGroupHandler) HandleShowMdUserGroupScreen(c echo.Context) error
Link: "/dev/md/usergroupv2/edit",
HxTarget: "#" + dialogEditBodyID,
HxSwap: "outerHTML",
HxInclude: "#tableID, #paginationID, #searchID, #dialogDeleteBodyID, #dialogEditBodyID, #dialogEditID, #" + searchID + ", #currpage" + paginationID,
HxInclude: "#tableID, #paginationID, #searchID, #dialogEditBodyID, #dialogEditID, #" + searchID + ", #currpage" + paginationID,
ModalID: dialogEditID,
ModalTitle: "New-User Group",
DialogBody: dialogEditBodyCmp,
@@ -267,7 +263,7 @@ func (lh *MdUserGroupHandler) HandleShowMdUserGroupScreen(c echo.Context) error
Link: "/dev/md/usergroupv2/delete",
HxTarget: "#" + dialogDeleteBodyID,
HxSwap: "outerHTML",
HxInclude: "#tableID, #paginationID, #searchID, #dialogDeleteBodyID, #dialogDeleteID, #dialogEditBodyID, #" + searchID + ", #currpage" + paginationID,
HxInclude: "#tableID, #paginationID, #searchID, #dialogDeleteBodyID, #dialogDeleteID, #" + searchID + ", #currpage" + paginationID,
ModalID: dialogDeleteID,
ModalTitle: "New-User Group",
DialogBody: dialogDeleteBodyCmp,
@@ -335,7 +331,7 @@ func (lh *MdUserGroupHandler) HandleFilterMdUserGroup(c echo.Context) error {
"#"+dialogDeleteBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
userGroupPaginationComponent := pagination.PaginationV3(
userGroupPaginationComponent := pagination.PaginationV2(
totalpage,
1,
"/dev/md/usergroupv2/changepage",
@@ -343,8 +339,6 @@ func (lh *MdUserGroupHandler) HandleFilterMdUserGroup(c echo.Context) error {
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"#"+paginationID,
"outerHTML", "", "",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent(),
)
retval = append(retval, tableComponent)
retval = append(retval, userGroupPaginationComponent)
@@ -389,7 +383,7 @@ func (lh *MdUserGroupHandler) HandleChangePageMdUserGroup(c echo.Context) error
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
)
userGroupPaginationComponent := pagination.PaginationV3(
userGroupPaginationComponent := pagination.PaginationV2(
totalpage,
page,
"/dev/md/usergroupv2/changepage",
@@ -397,8 +391,6 @@ func (lh *MdUserGroupHandler) HandleChangePageMdUserGroup(c echo.Context) error
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"#"+paginationID,
"outerHTML", "", "",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent(),
)
retval = append(retval, tableComponent)
retval = append(retval, userGroupPaginationComponent)
@@ -561,7 +553,7 @@ func (lh *MdUserGroupHandler) HandleAddUserGroup(c echo.Context) error {
//pagination component
//Pagination
userGroupPaginationComponent := pagination.PaginationV3(
userGroupPaginationComponent := pagination.PaginationV2(
totalPage,
currPage,
"/dev/md/usergroupv2/changepage",
@@ -569,8 +561,6 @@ func (lh *MdUserGroupHandler) HandleAddUserGroup(c echo.Context) error {
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"#"+paginationID,
"outerHTML", "", "true",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent(),
)
newForm := dev_mdusergroupview.BodyFormUserGroup(
@@ -807,7 +797,7 @@ func (lh *MdUserGroupHandler) HandleEditUserGroup(c echo.Context) error {
//pagination component
//Pagination
userGroupPaginationComponent := pagination.PaginationV3(
userGroupPaginationComponent := pagination.PaginationV2(
totalPage,
currPage,
"/dev/md/usergroupv2/changepage",
@@ -815,8 +805,6 @@ func (lh *MdUserGroupHandler) HandleEditUserGroup(c echo.Context) error {
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"#"+paginationID,
"outerHTML", "", "true",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent(),
)
var retVal []templ.Component
newForm := dev_mdusergroupview.BodyFormUserGroup(
@@ -966,7 +954,7 @@ func (lh *MdUserGroupHandler) HandleDeleteUserGroup(c echo.Context) error {
//pagination component
//Pagination
userGroupPaginationComponent := pagination.PaginationV3(
userGroupPaginationComponent := pagination.PaginationV2(
totalPage,
currPage,
"/dev/md/usergroupv2/changepage",
@@ -974,8 +962,6 @@ func (lh *MdUserGroupHandler) HandleDeleteUserGroup(c echo.Context) error {
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"#"+paginationID,
"outerHTML", "", "true",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent(),
)
var retVal []templ.Component
newForm := dev_mdusergroupview.DeleteConfirmationBody(

View File

@@ -247,62 +247,9 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
dev.POST("/md/usergroupv2/closedeleteform", devMdUserGroupHandlers.HandleCloseFormDelete)
dev.POST("/md/usergroupv2/delete", devMdUserGroupHandlers.HandleDeleteUserGroup)
// group result
devGRServices := dev_services.NewServicesGroupResult(appStore)
devGRhandlers := dev_handlers.NewGroupResultHandler(devGRServices)
dev.GET("/groupresult", devGRhandlers.HandlerShowGroupResultV1)
dev.GET("/searchgroupresultv1", devGRhandlers.HandlerShowGroupResultSearchV1)
dev.GET("/groupresultv1pagination", devGRhandlers.HandlerShowGroupResultPaginationV1)
dev.POST("/groupresulthandlecloseform", devGRhandlers.HandleCloseForm)
dev.POST("/groupresulthandlecloseformedit", devGRhandlers.HandleCloseFormEdit)
dev.GET("/groupresultshoweditform", devGRhandlers.HandleEditForm)
dev.GET("/groupresultshowdeleteform", devGRhandlers.HandleDeleteForm)
// dev.GET("/groupresultshowdeleteform", devGRhandlers.HandleDeleteForm)
// form add
dev.POST("/groupresult/add", devGRhandlers.AddGroupResult)
dev.POST("/groupresult/edit", devGRhandlers.EditGroupResult)
dev.POST("/groupresult/delete", devGRhandlers.DeleteGroupResult)
// masterdata nat unit
devMdNatUnitServices := dev_services.NewMdNatUnitServices(appStore)
devMdNatUnitHandlers := dev_handlers.NeWMdNatUnitHandler(devMdNatUnitServices)
dev.GET("/md/natunit", devMdNatUnitHandlers.HandleShowMdNatUnitScreen)
dev.GET("/md/natunit/filter", devMdNatUnitHandlers.HandleFilterMdNatUnit)
dev.GET("/md/natunit/changepage", devMdNatUnitHandlers.HandlerChangePageMdNatUnit)
dev.POST("/md/natunit/closeaddform", devMdNatUnitHandlers.HandlerCloseFormAdd)
dev.POST("/md/natunit/add", devMdNatUnitHandlers.HandlerAddNatUnit)
dev.GET("/md/natunit/openedit", devMdNatUnitHandlers.HandlerOpenEditForm)
dev.POST("/md/natunit/closeeditform", devMdNatUnitHandlers.HandlerCloseFormEdit)
dev.POST("/md/natunit/edit", devMdNatUnitHandlers.HandlerEditNatUnit)
dev.GET("/md/natunit/opendelete", devMdNatUnitHandlers.HandlerOpenDeleteForm)
dev.POST("/md/natunit/closedeleteform", devMdNatUnitHandlers.HandlerCloseFormDelete)
dev.POST("/md/natunit/delete", devMdNatUnitHandlers.HandlerDeleteNatUnit)
// group result v2
devMdGRServices := dev_services.NewServicesMdGroupResult(appStore)
devMdGRhandlers := dev_handlers.NewMdGroupResultHandler(devMdGRServices)
dev.GET("/md/groupresultv2", devMdGRhandlers.HandleShowMdGroupResultScreen)
dev.GET("/md/groupresultv2/filter", devMdGRhandlers.HandleFilterMdGroupResult)
dev.GET("/md/groupresultv2/changepage", devMdGRhandlers.HandleChangePageMdGroupResult)
dev.POST("/md/groupresultv2/closeaddform", devMdGRhandlers.HandleCloseFormAdd)
dev.POST("/md/groupresultv2/add", devMdGRhandlers.HandleAddGroupResult)
dev.GET("/md/groupresultv2/openedit", devMdGRhandlers.HandleOpenEditForm)
dev.POST("/md/groupresultv2/closeeditform", devMdGRhandlers.HandleCloseFormEdit)
dev.POST("/md/groupresultv2/edit", devMdGRhandlers.HandleEditGroupResult)
dev.GET("/md/groupresultv2/opendelete", devMdGRhandlers.HandleOpenDeleteForm)
dev.POST("/md/groupresultv2/closedeleteform", devMdGRhandlers.HandleCloseFormDelete)
dev.POST("/md/groupresultv2/delete", devMdGRhandlers.HandleDeleteUserGroup)
//MD BAHAN
devMdBahanServices := dev_services.NewMdBahanServices(appStore)
devMdBahanHandlers := dev_handlers.NewMdBahanHandler(devMdBahanServices)
dev.GET("/md/bahan", devMdBahanHandlers.HandleShowMdBahanScreen)
dev.GET("/md/bahan/filter", devMdBahanHandlers.HandleFilterMdBahan)
dev.GET("/md/bahan/pagination", devMdBahanHandlers.HandlePaginationMdBahan)
dev.POST("/md/bahan/add", devMdBahanHandlers.HandleAddMdBahan)
dev.POST("/md/bahan/closeaddform", devMdBahanHandlers.HandleCloseFormAddMdBahan)
dev.GET("/md/bahan/openedit", devMdBahanHandlers.HandleOpenEditMdBahan)
dev.POST("/md/bahan/closeeditform", devMdBahanHandlers.HandleCloseFormEditMdBahan)
dev.POST("/md/bahan/edit", devMdBahanHandlers.HandleEditMdBahan)
dev.GET("/md/bahan/opendelete", devMdBahanHandlers.HandleOpenDeleteMdBahan)
dev.POST("/md/bahan/closedeleteform", devMdBahanHandlers.HandleCloseDeleteMdBahan)
dev.POST("/md/bahan/delete", devMdBahanHandlers.HandleDeleteMdBahan)
// md sample station
devMDSampleStationServices := dev_services.NewMDSampleStationServices(appStore)
devMDSampleStationHandlers := dev_handlers.NewMDSampleStationHandler(devMDSampleStationServices)
dev.GET("/md/samplestation", devMDSampleStationHandlers.HandleShowMDSampleStationScreen)
dev.GET("/md/samplestation/changepage", devMDSampleStationHandlers.HandleChangePageSampleStation)
}

View File

@@ -266,8 +266,6 @@ templ CorporateLayout(title string, css templ.Component, js templ.Component, nav
<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>

View File

@@ -78,7 +78,7 @@ func CorporateLayout(title string, css templ.Component, js templ.Component, navb
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>")
_, 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>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -1,38 +0,0 @@
package models
import "github.com/a-h/templ"
type Bahan struct {
T_BahanID int `db:"T_BahanID"`
T_BahanT_SampleStationID int `db:"T_BahanT_SampleStationID"`
T_SampleStationID int `db:"T_SampleStationID"`
T_SampleStationName string `db:"T_SampleStationName"`
T_BahanCode string `db:"T_BahanCode"`
T_BahanName string `db:"T_BahanName"`
T_BahanLangName string `db:"T_BahanLangName"`
T_BahanIsActive string `db:"T_BahanIsActive"`
T_BahanCreated string `db:"T_BahanCreated"`
T_BahanCreatedUserID string `db:"T_BahanCreatedUserID"`
T_BahanLastUpdated string `db:"T_BahanLastUpdated"`
T_BahanLastUpdatedUserID string `db:"T_BahanLastUpdatedUserID"`
T_BahanDeleted string `db:"T_BahanDeleted"`
T_BahanDeletedUserID string `db:"T_BahanDeletedUserID"`
}
type TmpSampleStation struct {
T_SampleStationID int `db:"T_SampleStationID"`
T_SampleStationName string `db:"T_SampleStationName"`
}
type BahanFormComponent struct {
IDComponent string
Link string
HxTarget string
HxSwap string
HxInclude string
ModalID string
ModalTitle string
DialogBody templ.Component
DialogAction templ.Component
ButtonCLose templ.Component
}

View File

@@ -1,18 +0,0 @@
package models
// name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string,
type CustomCheckboxv1Prm struct {
HxTarget string `default:"hxTarget"`
HxGet string `default:"hxGet"`
HxIndicator string `default:"hxIndicator"`
HxInclude string `default:"hxInclude"`
HxTrigger string `default:"hxTrigger"`
Label string `default:"Label"`
Name string `default:"name"`
Text string `default:"text"`
// Type string `default:"text"`
Value string `default:""`
ErrorMsg string `default:""`
ID string
}

View File

@@ -1,36 +0,0 @@
package models
import "github.com/a-h/templ"
// name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string,
type CustomDropdownv1Prm struct {
HxTarget string `default:"hxTarget"`
HxGet string `default:"hxGet"`
HxIndicator string `default:"hxIndicator"`
HxInclude string `default:"hxInclude"`
HxTrigger string `default:"hxTrigger"`
Label string `default:"Label"`
Name string `default:"name"`
// Placeholder string `default:"Placeholder"`
// Type string `default:"text"`
// Value string `default:""`
ErrorMsg string `default:""`
ID string
}
type CustomDropdownV2Prm struct {
HxTarget string `default:"hxTarget"`
HxGet string `default:"hxGet"`
HxIndicator string `default:"hxIndicator"`
HxInclude string `default:"hxInclude"`
HxTrigger string `default:"hxTrigger"`
HxSwap string `default:"HxSwap"`
Label string `default:"Label"`
Name string `default:"name"`
Placeholder string `default:"Placeholder"`
// Type string `default:"text"`
// Value string `default:""`
ErrorMsg string `default:""`
ID string
ListItem templ.Component
}

View File

@@ -1,38 +0,0 @@
package models
import "github.com/a-h/templ"
type GroupResultResumeMcu struct {
Text string `default:"text"`
ID int `default:"id"`
}
type GroupResult struct {
Nomor string `db:"nomor"`
Group_ResultID int `db:"Group_ResultID"`
Group_ResultName string `db:"Group_ResultName"`
Group_ResultFlagPerTest string `db:"Group_ResultFlagPerTest"`
Group_ResultFlagNonLab string `db:"Group_ResultFlagNonLab"`
Group_ResultResumeMcu string `db:"Group_ResultResumeMcu"`
Group_ResultIsActive string `db:"Group_ResultIsActive"`
}
// form component
type GroupResultFormComponent struct {
IDComponent string
Link string
HxTarget string
HxSwap string
HxInclude string
ModalID string
ModalTitle string
InputGroupResultName CustomTextFieldv2Prm
InputGroupResult CustomTextFieldv2Prm
CheckboxGroupResultFlagPerTest CustomCheckboxv1Prm
CheckboxGroupResultFlagNonLab CustomCheckboxv1Prm
InputID CustomTextFieldv2Prm
DropdownGroupResultResumeMcu CustomDropdownv1Prm
DialogBody templ.Component
DialogAction templ.Component
ButtonCLose templ.Component
}

View File

@@ -1,29 +0,0 @@
package models
import "github.com/a-h/templ"
type NatUnit struct {
Nomor string `db:"nomor"`
Nat_UnitID int `db:"Nat_UnitID"`
Nat_UnitCode string `db:"Nat_UnitCode"`
Nat_UnitName string `db:"Nat_UnitName"`
Nat_UnitCreated string `db:"Nat_UnitCreated"`
Nat_UnitLastUpdated string `db:"Nat_UnitLastUpdated"`
Nat_UnitIsActive string `db:"Nat_UnitIsActive"`
}
type NatUnitFormComponent struct {
IDComponent string
Link string
HxTarget string
HxSwap string
HxInclude string
ModalID string
ModalTitle string
InputName CustomTextFieldv2Prm
InputCode CustomTextFieldv2Prm
InputID CustomTextFieldv2Prm
DialogBody templ.Component
DialogAction templ.Component
ButtonCLose templ.Component
}

View File

@@ -0,0 +1,10 @@
package models
type MDSampleStation struct {
T_SampleStationID int `db:"T_SampleStationID"`
T_SampleStationCode string `db:"T_SampleStationCode"`
T_SampleStationName string `db:"T_SampleStationName"`
T_SampleStationNat_GroupID string `db:"T_SampleStationNat_GroupID"`
T_SampleStationIsNonLab string `db:"T_SampleStationIsNonLab"`
T_SampleStationIsActive string `db:"T_SampleStationIsActive"`
}

View File

@@ -514,7 +514,3 @@ func GetUserLogin() (models.User, error) {
}
return a, nil
}
func GetTerminology(attributePath string, codeSystem string) {
}

View File

@@ -1,878 +0,0 @@
package dev_services
import (
"cpone/db"
"cpone/models"
"fmt"
"math"
"strconv"
"strings"
dbx "cpone/package/database"
"go.uber.org/zap"
)
func NewServicesGroupResult(uStore db.AppStore) *ServicesGroupResult {
return &ServicesGroupResult{
GroupResultStore: uStore,
}
}
type ServicesGroupResult struct {
GroupResultStore db.AppStore
}
func (su *ServicesGroupResult) GetMasterMenus() ([]MasterMenu, error) {
// dummyBreadcrumb := []Breadcrumb{
// {
// Name: "Dashboard",
// Url: "/client/dashboard",
// },
// {
// Name: "Front Office",
// Url: "/client/usermanagement",
// },
// }
dummyMenu := []MasterMenu{
// 1. Dashboard
{
ID: "1",
ParentMenuID: "0",
ParentMenuName: "Dashboard",
ParentUrl: "/client/md/dashboard",
ParentIcon: "",
Children: []ChildrenMenu{
{
ChildrenParentID: "1",
ChildrenMenuID: "1",
ChildrenMenuName: "Master User",
ChildrenMenuURL: "/client/md/user",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "Y",
// },
// },
},
},
},
// 2. Front Office
{
ID: "2",
ParentMenuID: "1",
ParentMenuName: "Front Office",
ParentUrl: "#",
ParentIcon: "",
Children: []ChildrenMenu{
{
ChildrenParentID: "1",
ChildrenMenuID: "1",
ChildrenMenuName: "Registrasi",
ChildrenMenuURL: "/fo/registrasi",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User",
// IsActive: "Y",
// },
// },
},
},
},
// 3. Station
{
ID: "3",
ParentMenuID: "2",
ParentMenuName: "Station",
ParentUrl: "#",
ParentIcon: "",
Children: []ChildrenMenu{
{
ChildrenParentID: "2",
ChildrenMenuID: "1",
ChildrenMenuName: "Sample Station",
ChildrenMenuURL: "/station/sample",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User",
// IsActive: "Y",
// },
// },
},
},
},
// 4. Management MCU
{
ID: "4",
ParentMenuID: "3",
ParentMenuName: "Management MCU",
ParentUrl: "#",
ParentIcon: "",
Children: []ChildrenMenu{
{
ChildrenParentID: "3",
ChildrenMenuID: "1",
ChildrenMenuName: "Setup MCU",
ChildrenMenuURL: "/mcu/setup",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User",
// IsActive: "Y",
// },
// },
},
{
ChildrenParentID: "3",
ChildrenMenuID: "2",
ChildrenMenuName: "Pre-Registrasi",
ChildrenMenuURL: "/mcu/preregister",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User",
// IsActive: "Y",
// },
// },
},
},
},
// 5. Master Data
{
ID: "5",
ParentMenuID: "4",
ParentMenuName: "Master Data",
ParentUrl: "#",
ParentIcon: "",
Children: []ChildrenMenu{
// * Master User
{
ChildrenParentID: "4",
ChildrenMenuID: "1",
ChildrenMenuName: "Master User",
ChildrenMenuURL: "/client/md/user",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User",
// IsActive: "Y",
// },
// },
},
// * Master User Group
{
ChildrenParentID: "4",
ChildrenMenuID: "2",
ChildrenMenuName: "Master User Group",
ChildrenMenuURL: "/client/md/usergroup",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Master Corporate
{
ChildrenParentID: "4",
ChildrenMenuID: "3",
ChildrenMenuName: "Corporate",
ChildrenMenuURL: "/client/md/corp",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Test
{
ChildrenParentID: "4",
ChildrenMenuID: "4",
ChildrenMenuName: "Test",
ChildrenMenuURL: "/client/md/test",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Bahan
{
ChildrenParentID: "4",
ChildrenMenuID: "5",
ChildrenMenuName: "Bahan",
ChildrenMenuURL: "/client/md/bahan",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Sample Type
{
ChildrenParentID: "4",
ChildrenMenuID: "6",
ChildrenMenuName: "Sample Type",
ChildrenMenuURL: "/client/sample/type",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Sample Station
{
ChildrenParentID: "4",
ChildrenMenuID: "7",
ChildrenMenuName: "Sample Station",
ChildrenMenuURL: "/station/sample",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Result Non Lab
{
ChildrenParentID: "4",
ChildrenMenuID: "8",
ChildrenMenuName: "Result Non Lab",
ChildrenMenuURL: "/client/md/resultnonlab",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Template Fisik
{
ChildrenParentID: "4",
ChildrenMenuID: "9",
ChildrenMenuName: "Template Fisik",
ChildrenMenuURL: "/client/md/template-fisik",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Pasien
{
ChildrenParentID: "4",
ChildrenMenuID: "10",
ChildrenMenuName: "Pasien",
ChildrenMenuURL: "/client/md/pasien",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Dokter
{
ChildrenParentID: "4",
ChildrenMenuID: "11",
ChildrenMenuName: "Dokter",
ChildrenMenuURL: "/client/md/dokter",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Paket
{
ChildrenParentID: "4",
ChildrenMenuID: "12",
ChildrenMenuName: "Paket",
ChildrenMenuURL: "/client/md/paket",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Harga Single
{
ChildrenParentID: "4",
ChildrenMenuID: "13",
ChildrenMenuName: "Harga Single",
ChildrenMenuURL: "/client/md/hargasingle",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
},
},
}
return dummyMenu, nil
}
func (ug *ServicesGroupResult) GetUserGroup() ([]models.UserGroup, error) {
data := []models.UserGroup{
{UserGroupID: 1, UserGroupKode: "A", UserGroupName: "UG1"},
{UserGroupID: 2, UserGroupKode: "B", UserGroupName: "UG2"},
{UserGroupID: 3, UserGroupKode: "C", UserGroupName: "UG3"},
}
return data, nil
}
func (su *ServicesGroupResult) GetListBreadCrumb(title string) (models.BreadCrumbV1, error) {
var ret models.BreadCrumbV1
dummyBreadcrumb := []models.BreadCrumbV1{
{
Title: "Master User Group",
Item: []models.ItemBreadCrumbV1{
{
Item: "Dashboard",
Url: "/dev/dashboard",
},
{
Item: "Master",
Url: "/dev/master",
},
{
Item: "User Group",
Url: "",
},
},
},
{
Title: "Master User",
Item: []models.ItemBreadCrumbV1{
{
Item: "Dashboard",
Url: "/dev/dashboard",
},
{
Item: "Master",
Url: "/dev/master",
},
{
Item: "User",
Url: "",
},
},
},
{
Title: "Master Group Result",
Item: []models.ItemBreadCrumbV1{
{
Item: "Dashboard",
Url: "/dev/dashboard",
},
{
Item: "Master",
Url: "/dev/master",
},
{
Item: "Group Result",
Url: "",
},
},
},
}
for _, breadcrumb := range dummyBreadcrumb {
// if utils.Contains(breadcrumb.Title, title) {
// ret = breadcrumb
// return ret, nil
// }
if breadcrumb.Title == title {
ret = breadcrumb
return ret, nil
}
}
return ret, nil
}
// (LAB, NONLAB, FISIK, DOCTOR)
// hardcore group result resume mcu
func (ug *ServicesGroupResult) GetGroupResultResumeMcu() ([]models.GroupResultResumeMcu, error) {
data := []models.GroupResultResumeMcu{
{
ID: 1,
Text: "LAB",
},
{
ID: 2,
Text: "NONLAB",
},
{
ID: 3,
Text: "FISIK",
},
{
ID: 4,
Text: "DOCTOR",
},
}
return data, nil
}
// versi 2
func (su *ServicesGroupResult) GetListGroupResult(search string, currentPage int, rowPerPage int) ([]models.GroupResult, int, error) {
var groupresultList []models.GroupResult
logger, _ := zap.NewProduction()
defer logger.Sync()
var totalData int
offset := (currentPage - 1) * rowPerPage
prm := "%" + strings.TrimSpace(search) + "%"
querytotal := `
SELECT COUNT(*)
FROM group_result
WHERE Group_ResultIsActive = 'Y'
AND (Group_ResultName LIKE ? OR Group_ResultResumeMcu LIKE ?)
`
logger.Info("QUERY SEARCH INITIAL TOTAL COUNT",
zap.String("query search", querytotal),
)
if err := dbx.Handlex.Get(&totalData, querytotal, prm, prm); err != nil {
return nil, 0, fmt.Errorf("error querying database: %v", err)
}
query := `
SELECT
ROW_NUMBER() OVER () AS nomor,
Group_ResultID,
IFNULL(Group_ResultName, '') AS Group_ResultName,
IFNULL(Group_ResultFlagPerTest, '') AS Group_ResultFlagPerTest,
IFNULL(Group_ResultFlagNonLab, '') AS Group_ResultFlagNonLab,
IFNULL(Group_ResultResumeMcu, '') AS Group_ResultResumeMcu,
Group_ResultIsActive
FROM group_result
WHERE Group_ResultIsActive = 'Y'
AND (Group_ResultName LIKE ? OR Group_ResultResumeMcu LIKE ?)
ORDER BY Group_ResultID ASC
LIMIT ? OFFSET ?
`
logger.Info("QUERY SEARCH INITIAL",
zap.String("query search", query),
)
if err := dbx.Handlex.Select(&groupresultList, query, prm, prm, rowPerPage, offset); err != nil {
return nil, 0, fmt.Errorf("error querying database: %v", err)
}
totalPage := int(math.Ceil(float64(totalData) / float64(rowPerPage)))
return groupresultList, totalPage, nil
}
// GET BY ID
func (ug *ServicesGroupResult) GetGroupResultByIDV1(id string) (models.GroupResult, error) {
logger, _ := zap.NewProduction()
var data models.GroupResult
err := dbx.Handlex.Get(&data, `SELECT
Group_ResultID,
Group_ResultName,
CASE
WHEN Group_ResultFlagPerTest = 'Y' THEN 'on'
ELSE Group_ResultFlagPerTest
END AS Group_ResultFlagPerTest,
CASE
WHEN Group_ResultFlagNonLab = 'Y' THEN 'on'
ELSE Group_ResultFlagNonLab
END AS Group_ResultFlagNonLab,
Group_ResultResumeMcu,
Group_ResultIsActive
FROM group_result
WHERE Group_ResultID = ?`, id)
if err != nil {
defer logger.Sync()
logger.Error("Error get data gr by id vs",
zap.String("ID", id),
zap.Error(err),
)
return data, fmt.Errorf("QUERY_FAILED")
}
return data, nil
}
// ADD DATA
func (ug *ServicesGroupResult) AddGroupResult(groupresultname string, groupresultflagpertest string, groupresultflagnonlab string, groupresultresumemcu string) (models.GroupResult, error) {
logger, _ := zap.NewProduction()
var data models.GroupResult
var datacek []models.GroupResult
// var groupresultflagpertestConvert string = ""
// var groupresultflagnonlabConvert string = ""
// var groupresultresumemcuConvert string = ""
prm := "%" + strings.TrimSpace(groupresultname) + "%"
qryCek := `SELECT Group_ResultName FROM group_result WHERE Group_ResultName LIKE ? AND Group_ResultIsActive = 'Y'`
err := dbx.Handlex.Select(&datacek, qryCek, prm)
if err != nil {
defer logger.Sync()
logger.Error("Error cek data by groupresultname",
zap.String("groupresultname", groupresultname),
zap.Any("datacek", datacek),
)
return data, fmt.Errorf("QUERY_FAILED")
}
if len(datacek) > 0 {
defer logger.Sync()
logger.Error("Group Result Name already taken by another data",
zap.String("groupresultname", groupresultname),
)
return data, fmt.Errorf("group result name sudah dipakai")
}
qry := `INSERT INTO group_result
(
Group_ResultName,
Group_ResultFlagPerTest,
Group_ResultFlagNonLab,
Group_ResultResumeMcu
)
VALUES (
?,
?,
?,
?
);`
// time.Sleep(5 * time.Second)
rst := dbx.Handlex.MustExec(qry, groupresultname, groupresultflagpertest, groupresultflagnonlab, groupresultresumemcu)
insertedID, err := rst.LastInsertId()
if err != nil {
defer logger.Sync()
logger.Error("Error Insert group result",
zap.Any("groupresultname", groupresultname),
zap.Any("groupresultflagpertest", groupresultflagpertest),
zap.Any("groupresultflagnonlab", groupresultflagnonlab),
zap.Any("groupresultresumemcu", groupresultresumemcu),
)
return data, fmt.Errorf("QUERY_FAILED")
}
s := strconv.Itoa(int(insertedID))
data, err = ug.GetGroupResultByIDV1(s)
if err != nil {
defer logger.Sync()
logger.Error("Error get usergroup by id",
zap.Any("groupresultname", groupresultname),
zap.Any("groupresultflagpertest", groupresultflagpertest),
zap.Any("groupresultflagnonlab", groupresultflagnonlab),
zap.Any("groupresultresumemcu", groupresultresumemcu),
)
return data, fmt.Errorf("QUERY_FAILED")
}
return data, nil
}
// EDIT DATA
func (ug *ServicesGroupResult) EditGroupResult(id string, groupresultname string, groupresultflagpertest string, groupresultflagnonlab string, groupresultresumemcu string) (models.GroupResult, error) {
logger, _ := zap.NewProduction()
var data models.GroupResult
var datacek []models.GroupResult
prm := "%" + strings.TrimSpace(groupresultname) + "%"
qryCek := `SELECT Group_ResultName FROM group_result WHERE Group_ResultName LIKE ? AND Group_ResultIsActive = 'Y' AND Group_ResultID <> ?`
err := dbx.Handlex.Select(&datacek, qryCek, prm, id)
if err != nil {
defer logger.Sync()
logger.Error("Error cek data by code",
zap.String("groupresultname", groupresultname),
zap.Any("datacek", datacek),
)
return data, fmt.Errorf("QUERY_FAILED")
}
if len(datacek) > 0 {
defer logger.Sync()
logger.Error("Code already taken by another data",
zap.String("groupresultname", groupresultname),
)
return data, fmt.Errorf("group result name sudah dipakai")
}
qry := `UPDATE group_result
SET Group_ResultName = ?,
Group_ResultFlagPerTest = ?,
Group_ResultFlagNonLab = ?,
Group_ResultResumeMcu = ?
WHERE Group_ResultID = ?`
// time.Sleep(5 * time.Second)
rst := dbx.Handlex.MustExec(qry, groupresultname, groupresultflagpertest, groupresultflagnonlab, groupresultresumemcu, id)
_, err = rst.RowsAffected()
if err != nil {
defer logger.Sync()
logger.Error("Error Update group result",
zap.Any("groupresultname", groupresultname),
zap.Any("groupresultflagpertest", groupresultflagpertest),
zap.Any("groupresultflagnonlab", groupresultflagnonlab),
zap.Any("groupresultresumemcu", groupresultresumemcu),
)
return data, fmt.Errorf("QUERY_FAILED")
}
data, err = ug.GetGroupResultByIDV1(id)
if err != nil {
defer logger.Sync()
logger.Error("Error get group result by id",
zap.Any("groupresultname", groupresultname),
zap.Any("groupresultflagpertest", groupresultflagpertest),
zap.Any("groupresultflagnonlab", groupresultflagnonlab),
zap.Any("groupresultresumemcu", groupresultresumemcu),
)
return data, fmt.Errorf("QUERY_FAILED")
}
return data, nil
}
// DELETE DATA
func (ug *ServicesGroupResult) DeleteGroupResult(id string) (models.GroupResult, error) {
logger, _ := zap.NewProduction()
var data models.GroupResult
qry := `UPDATE group_result
SET Group_ResultIsActive = 'N'
WHERE Group_ResultID = ?;`
// time.Sleep(5 * time.Second)
rst := dbx.Handlex.MustExec(qry, id)
_, err := rst.RowsAffected()
if err != nil {
defer logger.Sync()
logger.Error("Error delete group result",
zap.String("id", id),
)
return data, fmt.Errorf("QUERY_FAILED")
}
data, err = ug.GetGroupResultByIDV1(id)
if err != nil {
defer logger.Sync()
logger.Error("Error get group result by id",
zap.String("id", id),
)
return data, fmt.Errorf("QUERY_FAILED")
}
return data, nil
}

View File

@@ -1,251 +0,0 @@
package dev_services
import (
"cpone/db"
"cpone/models"
dbx "cpone/package/database"
"fmt"
"math"
"strings"
"go.uber.org/zap"
)
func NewMdBahanServices(uStore db.AppStore) *MdBahanServices {
return &MdBahanServices{
MdBahanStore: uStore,
}
}
type MdBahanServices struct {
MdBahanStore db.AppStore
}
func (su *MdBahanServices) GetListMdBahan(
search string,
stationID string,
currentPage int,
rowPerPage int) ([]models.Bahan, int, error) {
var bahanList []models.Bahan
var totalData int
offset := (currentPage - 1) * rowPerPage
prm := "%" + strings.TrimSpace(search) + "%"
filterStation := ""
if stationID != "0" {
filterStation = "AND T_BahanT_SampleStationID = " + stationID
}
querytotal := `
SELECT COUNT(*) FROM
t_bahan
JOIN
t_samplestation
ON T_BahanT_SampleStationID = T_SampleStationID
AND T_BahanIsActive = 'Y'
AND T_SampleStationIsActive = 'Y'
WHERE (T_BahanName LIKE ? OR T_BahanCode LIKE ? )
` + filterStation
if err := dbx.Handlex.Get(&totalData, querytotal, prm, prm); err != nil {
return nil, 0, fmt.Errorf("error querying database: %v", err)
}
query := `
SELECT t_bahan.*,
T_SampleStationName,
T_SampleStationID FROM
t_bahan
JOIN
t_samplestation
ON T_BahanT_SampleStationID = T_SampleStationID
AND T_BahanIsActive = 'Y'
AND T_SampleStationIsActive = 'Y'
WHERE (T_BahanName LIKE ? OR T_BahanCode LIKE ? )
` + filterStation + `
LIMIT ? OFFSET ?
`
if err := dbx.Handlex.Select(&bahanList, query, prm, prm, rowPerPage, offset); err != nil {
return nil, 0, fmt.Errorf("error querying database: %v", err)
}
totalPage := int(math.Ceil(float64(totalData) / float64(rowPerPage)))
return bahanList, totalPage, nil
}
func (su *MdBahanServices) GetMdBahanBreadCrumb(title string) (models.BreadCrumbV1, error) {
ret := models.BreadCrumbV1{
Title: "Master Bahan",
Item: []models.ItemBreadCrumbV1{
{
Item: "Dashboard",
Url: "/dev/dashboard",
},
{
Item: "Master",
Url: "/dev/master",
},
{
Item: "Bahan",
Url: "",
},
},
}
return ret, nil
}
func (su *MdBahanServices) GetListSampleStation(isFilter bool) ([]models.TmpSampleStation, error) {
var stationList []models.TmpSampleStation
query := `
SELECT
T_SampleStationID,
T_SampleStationName
FROM
t_samplestation
WHERE T_SampleStationIsActive = 'Y'
`
if err := dbx.Handlex.Select(&stationList, query); err != nil {
return nil, fmt.Errorf("error querying database: %v", err)
}
if isFilter {
stationList = append(
[]models.TmpSampleStation{{T_SampleStationID: 0, T_SampleStationName: "Semua"}}, stationList...)
}
return stationList, nil
}
func (su *MdBahanServices) AddMdBahan(code string, name string, stationid string) (bool, error) {
logger, _ := zap.NewProduction()
var datacek []models.Bahan
qryCek := `SELECT T_BahanCode FROM t_bahan WHERE T_BahanCode = ? AND T_BahanIsActive = 'Y'`
err := dbx.Handlex.Select(&datacek, qryCek, code)
if err != nil {
defer logger.Sync()
logger.Error("Error cek data by code",
zap.String("code", code),
zap.Any("datacek", datacek),
)
return false, fmt.Errorf("query cek failed")
}
if len(datacek) > 0 {
defer logger.Sync()
logger.Error("Code already taken by another data",
zap.String("code", code),
)
return false, fmt.Errorf("code sudah dipakai")
}
query := `
INSERT INTO t_bahan(
T_BahanT_SampleStationID,
T_BahanCode,
T_BahanName,
T_BahanCreated,
T_BahanCreatedUserID)
VALUES(?,?,?, NOW(), 1)
`
rst := dbx.Handlex.MustExec(query, stationid, code, name)
_, err = rst.LastInsertId()
if err != nil {
defer logger.Sync()
logger.Error("Error Insert t bahan",
zap.Any("code", err),
)
return false, fmt.Errorf("insert data failed")
}
return true, nil
}
func (ug *MdBahanServices) GetMdBahanByID(id string) (models.Bahan, error) {
logger, _ := zap.NewProduction()
var data models.Bahan
err := dbx.Handlex.Get(&data,
`SELECT t_bahan.*,
T_SampleStationID,
T_SampleStationName
FROM t_bahan
JOIN
t_samplestation
ON T_BahanT_SampleStationID = T_SampleStationID
AND T_BahanIsActive = 'Y'
AND T_SampleStationIsActive = 'Y'
WHERE T_BahanID = ? `, id)
if err != nil {
defer logger.Sync()
logger.Error("Error get data bahan by id vs",
zap.String("ID", id),
zap.Error(err),
)
return data, fmt.Errorf("get bahan failed")
}
return data, nil
}
func (su *MdBahanServices) EditMdBahan(id string, code string, name string, stationid string) (bool, error) {
logger, _ := zap.NewProduction()
var datacek []models.Bahan
qryCek := `SELECT T_BahanCode FROM t_bahan WHERE T_BahanCode = ? AND T_BahanIsActive = 'Y' AND T_BahanID <> ?`
err := dbx.Handlex.Select(&datacek, qryCek, code, id)
if err != nil {
defer logger.Sync()
logger.Error("Error cek data by code",
zap.String("code", code),
zap.Any("datacek", datacek),
)
return false, fmt.Errorf("query cek failed")
}
if len(datacek) > 0 {
defer logger.Sync()
logger.Error("Code already taken by another data",
zap.String("code", code),
)
return false, fmt.Errorf("code sudah dipakai")
}
query := `
UPDATE t_bahan SET
T_BahanCode = ?,
T_BahanName = ?,
T_BahanT_SampleStationID = ?
WHERE T_BahanID = ?
`
rst := dbx.Handlex.MustExec(query, code, name, stationid, id)
_, err = rst.LastInsertId()
if err != nil {
defer logger.Sync()
logger.Error("Error edit t bahan",
zap.Any("code", err),
)
return false, fmt.Errorf("edit data failed")
}
return true, nil
}
func (su *MdBahanServices) DeleteMdBahan(id string) (bool, error) {
logger, _ := zap.NewProduction()
query := `
UPDATE t_bahan
SET T_BahanIsActive = 'N',
T_BahanDeleted = NOW(),
T_BahanDeletedUserID = '1'
WHERE T_BahanID = ?
`
rst := dbx.Handlex.MustExec(query, id)
_, err := rst.LastInsertId()
if err != nil {
defer logger.Sync()
logger.Error("Error edit t bahan",
zap.Any("code", err),
)
return false, fmt.Errorf("edit data failed")
}
return true, nil
}

View File

@@ -1,878 +0,0 @@
package dev_services
import (
"cpone/db"
"cpone/models"
"fmt"
"math"
"strconv"
"strings"
dbx "cpone/package/database"
"go.uber.org/zap"
)
func NewServicesMdGroupResult(uStore db.AppStore) *ServicesMdGroupResult {
return &ServicesMdGroupResult{
MdGroupResultStore: uStore,
}
}
type ServicesMdGroupResult struct {
MdGroupResultStore db.AppStore
}
func (su *ServicesMdGroupResult) GetMasterMenus() ([]MasterMenu, error) {
// dummyBreadcrumb := []Breadcrumb{
// {
// Name: "Dashboard",
// Url: "/client/dashboard",
// },
// {
// Name: "Front Office",
// Url: "/client/usermanagement",
// },
// }
dummyMenu := []MasterMenu{
// 1. Dashboard
{
ID: "1",
ParentMenuID: "0",
ParentMenuName: "Dashboard",
ParentUrl: "/client/md/dashboard",
ParentIcon: "",
Children: []ChildrenMenu{
{
ChildrenParentID: "1",
ChildrenMenuID: "1",
ChildrenMenuName: "Master User",
ChildrenMenuURL: "/client/md/user",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "Y",
// },
// },
},
},
},
// 2. Front Office
{
ID: "2",
ParentMenuID: "1",
ParentMenuName: "Front Office",
ParentUrl: "#",
ParentIcon: "",
Children: []ChildrenMenu{
{
ChildrenParentID: "1",
ChildrenMenuID: "1",
ChildrenMenuName: "Registrasi",
ChildrenMenuURL: "/fo/registrasi",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User",
// IsActive: "Y",
// },
// },
},
},
},
// 3. Station
{
ID: "3",
ParentMenuID: "2",
ParentMenuName: "Station",
ParentUrl: "#",
ParentIcon: "",
Children: []ChildrenMenu{
{
ChildrenParentID: "2",
ChildrenMenuID: "1",
ChildrenMenuName: "Sample Station",
ChildrenMenuURL: "/station/sample",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User",
// IsActive: "Y",
// },
// },
},
},
},
// 4. Management MCU
{
ID: "4",
ParentMenuID: "3",
ParentMenuName: "Management MCU",
ParentUrl: "#",
ParentIcon: "",
Children: []ChildrenMenu{
{
ChildrenParentID: "3",
ChildrenMenuID: "1",
ChildrenMenuName: "Setup MCU",
ChildrenMenuURL: "/mcu/setup",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User",
// IsActive: "Y",
// },
// },
},
{
ChildrenParentID: "3",
ChildrenMenuID: "2",
ChildrenMenuName: "Pre-Registrasi",
ChildrenMenuURL: "/mcu/preregister",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User",
// IsActive: "Y",
// },
// },
},
},
},
// 5. Master Data
{
ID: "5",
ParentMenuID: "4",
ParentMenuName: "Master Data",
ParentUrl: "#",
ParentIcon: "",
Children: []ChildrenMenu{
// * Master User
{
ChildrenParentID: "4",
ChildrenMenuID: "1",
ChildrenMenuName: "Master User",
ChildrenMenuURL: "/client/md/user",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User",
// IsActive: "Y",
// },
// },
},
// * Master User Group
{
ChildrenParentID: "4",
ChildrenMenuID: "2",
ChildrenMenuName: "Master User Group",
ChildrenMenuURL: "/client/md/usergroup",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Master Corporate
{
ChildrenParentID: "4",
ChildrenMenuID: "3",
ChildrenMenuName: "Corporate",
ChildrenMenuURL: "/client/md/corp",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Test
{
ChildrenParentID: "4",
ChildrenMenuID: "4",
ChildrenMenuName: "Test",
ChildrenMenuURL: "/client/md/test",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Bahan
{
ChildrenParentID: "4",
ChildrenMenuID: "5",
ChildrenMenuName: "Bahan",
ChildrenMenuURL: "/client/md/bahan",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Sample Type
{
ChildrenParentID: "4",
ChildrenMenuID: "6",
ChildrenMenuName: "Sample Type",
ChildrenMenuURL: "/client/sample/type",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Sample Station
{
ChildrenParentID: "4",
ChildrenMenuID: "7",
ChildrenMenuName: "Sample Station",
ChildrenMenuURL: "/station/sample",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Result Non Lab
{
ChildrenParentID: "4",
ChildrenMenuID: "8",
ChildrenMenuName: "Result Non Lab",
ChildrenMenuURL: "/client/md/resultnonlab",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Template Fisik
{
ChildrenParentID: "4",
ChildrenMenuID: "9",
ChildrenMenuName: "Template Fisik",
ChildrenMenuURL: "/client/md/template-fisik",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Pasien
{
ChildrenParentID: "4",
ChildrenMenuID: "10",
ChildrenMenuName: "Pasien",
ChildrenMenuURL: "/client/md/pasien",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Dokter
{
ChildrenParentID: "4",
ChildrenMenuID: "11",
ChildrenMenuName: "Dokter",
ChildrenMenuURL: "/client/md/dokter",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Paket
{
ChildrenParentID: "4",
ChildrenMenuID: "12",
ChildrenMenuName: "Paket",
ChildrenMenuURL: "/client/md/paket",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
// * Harga Single
{
ChildrenParentID: "4",
ChildrenMenuID: "13",
ChildrenMenuName: "Harga Single",
ChildrenMenuURL: "/client/md/hargasingle",
// Breadcrumb: []Breadcrumb{
// {
// IDBreadcrumb: "1",
// Title: "Dashboard",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "2",
// Title: "Master",
// IsActive: "N",
// },
// {
// IDBreadcrumb: "3",
// Title: "User Group",
// IsActive: "Y",
// },
// },
},
},
},
}
return dummyMenu, nil
}
func (ug *ServicesMdGroupResult) GetUserGroup() ([]models.UserGroup, error) {
data := []models.UserGroup{
{UserGroupID: 1, UserGroupKode: "A", UserGroupName: "UG1"},
{UserGroupID: 2, UserGroupKode: "B", UserGroupName: "UG2"},
{UserGroupID: 3, UserGroupKode: "C", UserGroupName: "UG3"},
}
return data, nil
}
func (su *ServicesMdGroupResult) GetMdGroupResultBreadcrumb(title string) (models.BreadCrumbV1, error) {
var ret models.BreadCrumbV1
dummyBreadcrumb := []models.BreadCrumbV1{
{
Title: "Master User Group",
Item: []models.ItemBreadCrumbV1{
{
Item: "Dashboard",
Url: "/dev/dashboard",
},
{
Item: "Master",
Url: "/dev/master",
},
{
Item: "User Group",
Url: "",
},
},
},
{
Title: "Master User",
Item: []models.ItemBreadCrumbV1{
{
Item: "Dashboard",
Url: "/dev/dashboard",
},
{
Item: "Master",
Url: "/dev/master",
},
{
Item: "User",
Url: "",
},
},
},
{
Title: "Master Group Result",
Item: []models.ItemBreadCrumbV1{
{
Item: "Dashboard",
Url: "/dev/dashboard",
},
{
Item: "Master",
Url: "/dev/master",
},
{
Item: "Group Result",
Url: "",
},
},
},
}
for _, breadcrumb := range dummyBreadcrumb {
// if utils.Contains(breadcrumb.Title, title) {
// ret = breadcrumb
// return ret, nil
// }
if breadcrumb.Title == title {
ret = breadcrumb
return ret, nil
}
}
return ret, nil
}
// (LAB, NONLAB, FISIK, DOCTOR)
// hardcore group result resume mcu
func (ug *ServicesMdGroupResult) GetMdGroupResultResumeMcu() ([]models.GroupResultResumeMcu, error) {
data := []models.GroupResultResumeMcu{
{
ID: 1,
Text: "LAB",
},
{
ID: 2,
Text: "NONLAB",
},
{
ID: 3,
Text: "FISIK",
},
{
ID: 4,
Text: "DOCTOR",
},
}
return data, nil
}
// versi 2
func (su *ServicesMdGroupResult) GetListMdGroupResult(search string, currentPage int, rowPerPage int) ([]models.GroupResult, int, error) {
var groupresultList []models.GroupResult
logger, _ := zap.NewProduction()
defer logger.Sync()
var totalData int
offset := (currentPage - 1) * rowPerPage
prm := "%" + strings.TrimSpace(search) + "%"
querytotal := `
SELECT COUNT(*)
FROM group_result
WHERE Group_ResultIsActive = 'Y'
AND (Group_ResultName LIKE ? OR Group_ResultResumeMcu LIKE ?)
`
logger.Info("QUERY SEARCH INITIAL TOTAL COUNT",
zap.String("query search", querytotal),
)
if err := dbx.Handlex.Get(&totalData, querytotal, prm, prm); err != nil {
return nil, 0, fmt.Errorf("error querying database: %v", err)
}
query := `
SELECT
ROW_NUMBER() OVER () AS nomor,
Group_ResultID,
IFNULL(Group_ResultName, '') AS Group_ResultName,
IFNULL(Group_ResultFlagPerTest, '') AS Group_ResultFlagPerTest,
IFNULL(Group_ResultFlagNonLab, '') AS Group_ResultFlagNonLab,
IFNULL(Group_ResultResumeMcu, '') AS Group_ResultResumeMcu,
Group_ResultIsActive
FROM group_result
WHERE Group_ResultIsActive = 'Y'
AND (Group_ResultName LIKE ? OR Group_ResultResumeMcu LIKE ?)
ORDER BY Group_ResultID ASC
LIMIT ? OFFSET ?
`
logger.Info("QUERY SEARCH INITIAL",
zap.String("query search", query),
)
if err := dbx.Handlex.Select(&groupresultList, query, prm, prm, rowPerPage, offset); err != nil {
return nil, 0, fmt.Errorf("error querying database: %v", err)
}
totalPage := int(math.Ceil(float64(totalData) / float64(rowPerPage)))
return groupresultList, totalPage, nil
}
// GET BY ID
func (ug *ServicesMdGroupResult) GetMdGroupResultByID(id string) (models.GroupResult, error) {
logger, _ := zap.NewProduction()
var data models.GroupResult
err := dbx.Handlex.Get(&data, `SELECT
Group_ResultID,
Group_ResultName,
CASE
WHEN Group_ResultFlagPerTest = 'Y' THEN 'on'
ELSE Group_ResultFlagPerTest
END AS Group_ResultFlagPerTest,
CASE
WHEN Group_ResultFlagNonLab = 'Y' THEN 'on'
ELSE Group_ResultFlagNonLab
END AS Group_ResultFlagNonLab,
Group_ResultResumeMcu,
Group_ResultIsActive
FROM group_result
WHERE Group_ResultID = ?`, id)
if err != nil {
defer logger.Sync()
logger.Error("Error get data gr by id vs",
zap.String("ID", id),
zap.Error(err),
)
return data, fmt.Errorf("QUERY_FAILED")
}
return data, nil
}
// ADD DATA
func (ug *ServicesMdGroupResult) AddMdGroupResult(groupresultname string, groupresultflagpertest string, groupresultflagnonlab string, groupresultresumemcu string) (models.GroupResult, error) {
logger, _ := zap.NewProduction()
var data models.GroupResult
var datacek []models.GroupResult
// var groupresultflagpertestConvert string = ""
// var groupresultflagnonlabConvert string = ""
// var groupresultresumemcuConvert string = ""
prm := "%" + strings.TrimSpace(groupresultname) + "%"
qryCek := `SELECT Group_ResultName FROM group_result WHERE Group_ResultName LIKE ? AND Group_ResultIsActive = 'Y'`
err := dbx.Handlex.Select(&datacek, qryCek, prm)
if err != nil {
defer logger.Sync()
logger.Error("Error cek data by groupresultname",
zap.String("groupresultname", groupresultname),
zap.Any("datacek", datacek),
)
return data, fmt.Errorf("QUERY_FAILED")
}
if len(datacek) > 0 {
defer logger.Sync()
logger.Error("Group Result Name already taken by another data",
zap.String("groupresultname", groupresultname),
)
return data, fmt.Errorf("group result name sudah dipakai")
}
qry := `INSERT INTO group_result
(
Group_ResultName,
Group_ResultFlagPerTest,
Group_ResultFlagNonLab,
Group_ResultResumeMcu
)
VALUES (
?,
?,
?,
?
);`
// time.Sleep(5 * time.Second)
rst := dbx.Handlex.MustExec(qry, groupresultname, groupresultflagpertest, groupresultflagnonlab, groupresultresumemcu)
insertedID, err := rst.LastInsertId()
if err != nil {
defer logger.Sync()
logger.Error("Error Insert group result",
zap.Any("groupresultname", groupresultname),
zap.Any("groupresultflagpertest", groupresultflagpertest),
zap.Any("groupresultflagnonlab", groupresultflagnonlab),
zap.Any("groupresultresumemcu", groupresultresumemcu),
)
return data, fmt.Errorf("QUERY_FAILED")
}
s := strconv.Itoa(int(insertedID))
data, err = ug.GetMdGroupResultByID(s)
if err != nil {
defer logger.Sync()
logger.Error("Error get usergroup by id",
zap.Any("groupresultname", groupresultname),
zap.Any("groupresultflagpertest", groupresultflagpertest),
zap.Any("groupresultflagnonlab", groupresultflagnonlab),
zap.Any("groupresultresumemcu", groupresultresumemcu),
)
return data, fmt.Errorf("QUERY_FAILED")
}
return data, nil
}
// EDIT DATA
func (ug *ServicesMdGroupResult) EditMdGroupResult(id string, groupresultname string, groupresultflagpertest string, groupresultflagnonlab string, groupresultresumemcu string) (models.GroupResult, error) {
logger, _ := zap.NewProduction()
var data models.GroupResult
var datacek []models.GroupResult
prm := "%" + strings.TrimSpace(groupresultname) + "%"
qryCek := `SELECT Group_ResultName FROM group_result WHERE Group_ResultName LIKE ? AND Group_ResultIsActive = 'Y' AND Group_ResultID <> ?`
err := dbx.Handlex.Select(&datacek, qryCek, prm, id)
if err != nil {
defer logger.Sync()
logger.Error("Error cek data by code",
zap.String("groupresultname", groupresultname),
zap.Any("datacek", datacek),
)
return data, fmt.Errorf("QUERY_FAILED")
}
if len(datacek) > 0 {
defer logger.Sync()
logger.Error("Code already taken by another data",
zap.String("groupresultname", groupresultname),
)
return data, fmt.Errorf("group result name sudah dipakai")
}
qry := `UPDATE group_result
SET Group_ResultName = ?,
Group_ResultFlagPerTest = ?,
Group_ResultFlagNonLab = ?,
Group_ResultResumeMcu = ?
WHERE Group_ResultID = ?`
// time.Sleep(5 * time.Second)
rst := dbx.Handlex.MustExec(qry, groupresultname, groupresultflagpertest, groupresultflagnonlab, groupresultresumemcu, id)
_, err = rst.RowsAffected()
if err != nil {
defer logger.Sync()
logger.Error("Error Update group result",
zap.Any("groupresultname", groupresultname),
zap.Any("groupresultflagpertest", groupresultflagpertest),
zap.Any("groupresultflagnonlab", groupresultflagnonlab),
zap.Any("groupresultresumemcu", groupresultresumemcu),
)
return data, fmt.Errorf("QUERY_FAILED")
}
data, err = ug.GetMdGroupResultByID(id)
if err != nil {
defer logger.Sync()
logger.Error("Error get group result by id",
zap.Any("groupresultname", groupresultname),
zap.Any("groupresultflagpertest", groupresultflagpertest),
zap.Any("groupresultflagnonlab", groupresultflagnonlab),
zap.Any("groupresultresumemcu", groupresultresumemcu),
)
return data, fmt.Errorf("QUERY_FAILED")
}
return data, nil
}
// DELETE DATA
func (ug *ServicesMdGroupResult) DeleteMdGroupResult(id string) (models.GroupResult, error) {
logger, _ := zap.NewProduction()
var data models.GroupResult
qry := `UPDATE group_result
SET Group_ResultIsActive = 'N'
WHERE Group_ResultID = ?;`
// time.Sleep(5 * time.Second)
rst := dbx.Handlex.MustExec(qry, id)
_, err := rst.RowsAffected()
if err != nil {
defer logger.Sync()
logger.Error("Error delete group result",
zap.String("id", id),
)
return data, fmt.Errorf("QUERY_FAILED")
}
data, err = ug.GetMdGroupResultByID(id)
if err != nil {
defer logger.Sync()
logger.Error("Error get group result by id",
zap.String("id", id),
)
return data, fmt.Errorf("QUERY_FAILED")
}
return data, nil
}

View File

@@ -1,262 +0,0 @@
package dev_services
import (
"cpone/db"
"cpone/models"
dbx "cpone/package/database"
"fmt"
"math"
"strconv"
"strings"
"go.uber.org/zap"
)
func NewMdNatUnitServices(uStore db.AppStore) *MdNatUnitServices {
return &MdNatUnitServices{
MdNatUnitStore: uStore,
}
}
type MdNatUnitServices struct {
MdNatUnitStore db.AppStore
}
func (nu *MdNatUnitServices) GetListMdNatUnit(search string, currentPage int, rowPerPage int) ([]models.NatUnit, int, error) {
var natUnitList []models.NatUnit
var totalData int
offset := (currentPage - 1) * rowPerPage
prm := "%" + strings.TrimSpace(search) + "%"
querytotal := `SELECT COUNT(*)
FROM nat_unit
WHERE Nat_UnitIsActive = 'Y'
AND (Nat_UnitCode LIKE ? OR Nat_UnitName LIKE ?)`
if err := dbx.Handlex.Get(&totalData, querytotal, prm, prm); err != nil {
return nil, 0, fmt.Errorf("error querying database: %v", err)
}
query := `SELECT ROW_NUMBER() OVER (ORDER BY Nat_UnitID DESC) AS nomor,
Nat_UnitID,
Nat_UnitCode,
Nat_UnitName,
Nat_UnitCreated,
Nat_UnitLastUpdated,
Nat_UnitIsActive
FROM nat_unit
WHERE Nat_UnitIsActive = 'Y'
AND (Nat_UnitCode LIKE ? OR Nat_UnitName LIKE ?)
ORDER BY Nat_UnitID DESC
LIMIT ? OFFSET ?`
if err := dbx.Handlex.Select(&natUnitList, query, prm, prm, rowPerPage, offset); err != nil {
return nil, 0, fmt.Errorf("error querying database: %v", err)
}
totalPage := int(math.Ceil(float64(totalData) / float64(rowPerPage)))
return natUnitList, totalPage, nil
}
func (nu *MdNatUnitServices) GetMdNatUnitBreadCrumb(title string) (models.BreadCrumbV1, error) {
var ret models.BreadCrumbV1
dummyBreadcrumb := []models.BreadCrumbV1{
{
Title: "Master Unit",
Item: []models.ItemBreadCrumbV1{
{
Item: "Dashboard",
Url: "/dev/dashboard",
},
{
Item: "Master",
Url: "/dev/master",
},
{
Item: "Unit",
Url: "",
},
},
},
{
Title: "Master User",
Item: []models.ItemBreadCrumbV1{
{
Item: "Dashboard",
Url: "/dev/dashboard",
},
{
Item: "Master",
Url: "/dev/master",
},
{
Item: "User",
Url: "",
},
},
},
}
for _, breadcrumb := range dummyBreadcrumb {
if breadcrumb.Title == title {
ret = breadcrumb
return ret, nil
}
}
return ret, nil
}
func (nu *MdNatUnitServices) GetMdNatUnitByID(id string) (models.NatUnit, error) {
logger, _ := zap.NewProduction()
var data models.NatUnit
err := dbx.Handlex.Get(&data, `SELECT * FROM nat_unit
WHERE Nat_UnitID = ?`, id)
if err != nil {
defer logger.Sync()
logger.Error("Error get data unit by id",
zap.String("ID", id),
zap.Error(err),
)
return data, fmt.Errorf("QUERY_FAILED")
}
return data, nil
}
func (nu *MdNatUnitServices) AddMdNatUnit(code string, name string) (models.NatUnit, error) {
logger, _ := zap.NewProduction()
var data models.NatUnit
var datacek []models.NatUnit
qryCek := `SELECT Nat_UnitCode FROM nat_unit
WHERE Nat_UnitCode = ? AND Nat_UnitIsActive = 'Y'`
err := dbx.Handlex.Select(&datacek, qryCek, code)
if err != nil {
defer logger.Sync()
logger.Error("Error cek data by code",
zap.String("code", code),
zap.Any("datacek", datacek),
)
return data, fmt.Errorf("QUERY_FAILED")
}
if len(datacek) > 0 {
defer logger.Sync()
logger.Error("Code already taken by another data",
zap.String("code", code),
)
return data, fmt.Errorf("code sudah dipakai")
}
qry := `INSERT INTO nat_unit
(Nat_UnitCode,
Nat_UnitName) VALUES(?,?)`
rst := dbx.Handlex.MustExec(qry, code, name)
insertedID, err := rst.LastInsertId()
if err != nil {
defer logger.Sync()
logger.Error("Error Insert natunit",
zap.String("code", code),
zap.String("name", name),
)
return data, fmt.Errorf("QUERY_FAILED")
}
s := strconv.Itoa(int(insertedID))
data, err = nu.GetMdNatUnitByID(s)
if err != nil {
defer logger.Sync()
logger.Error("Error get natunit by id",
zap.String("code", code),
zap.String("name", name),
)
return data, fmt.Errorf("QUERY_FAILED")
}
return data, nil
}
func (nu *MdNatUnitServices) EditMdNatUnit(id string, code string, name string) (models.NatUnit, error) {
logger, _ := zap.NewProduction()
var data models.NatUnit
var datacek []models.NatUnit
qryCek := `SELECT Nat_UnitCode FROM nat_unit
WHERE Nat_UnitCode = ? AND Nat_UnitIsActive = 'Y' AND Nat_UnitID <> ?`
err := dbx.Handlex.Select(&datacek, qryCek, code, id)
if err != nil {
defer logger.Sync()
logger.Error("Error cek data by code",
zap.String("code", code),
zap.Any("datacek", datacek),
)
return data, fmt.Errorf("QUERY_FAILED")
}
if len(datacek) > 0 {
defer logger.Sync()
logger.Error("Code already taken by another data",
zap.String("code", code),
)
return data, fmt.Errorf("code sudah dipakai")
}
qry := `UPDATE nat_unit
SET Nat_UnitCode = ?,
Nat_UnitName = ?,
Nat_UnitLastUpdated = NOW()
WHERE Nat_UnitID = ?`
rst := dbx.Handlex.MustExec(qry, code, name, id)
_, err = rst.RowsAffected()
if err != nil {
defer logger.Sync()
logger.Error("Error Update natunit",
zap.String("code", code),
zap.String("name", name),
)
return data, fmt.Errorf("QUERY_FAILED")
}
data, err = nu.GetMdNatUnitByID(id)
if err != nil {
defer logger.Sync()
logger.Error("Error get natunit by id",
zap.String("code", code),
zap.String("name", name),
)
return data, fmt.Errorf("QUERY_FAILED")
}
return data, nil
}
func (nu *MdNatUnitServices) DeleteMdNatUnit(id string) (models.NatUnit, error) {
logger, _ := zap.NewProduction()
var data models.NatUnit
qry := `UPDATE nat_unit
SET Nat_UnitLastUpdated = NOW(),
Nat_UnitIsActive = 'N'
WHERE Nat_UnitID = ?`
rst := dbx.Handlex.MustExec(qry, id)
_, err := rst.RowsAffected()
if err != nil {
defer logger.Sync()
logger.Error("Error delete nat unit",
zap.String("id", id),
)
return data, fmt.Errorf("QUERY_FAILED")
}
data, err = nu.GetMdNatUnitByID(id)
if err != nil {
defer logger.Sync()
logger.Error("Error get nat unit by id",
zap.String("id", id),
)
return data, fmt.Errorf("QUERY_FAILED")
}
return data, nil
}

View File

@@ -0,0 +1,88 @@
package dev_services
import (
"cpone/db"
"cpone/models"
dbx "cpone/package/database"
"fmt"
"math"
"strings"
)
func NewMDSampleStationServices(uStore db.AppStore) *MDSampleStationServices {
return &MDSampleStationServices{
MDSampleStationStore: uStore,
}
}
type MDSampleStationServices struct {
MDSampleStationStore db.AppStore
}
func (ss *MDSampleStationServices) GetMDSampleStationBreadcrumb() (models.BreadCrumbV1, error) {
var ret models.BreadCrumbV1
Breadcrumb := models.BreadCrumbV1{
Title: "Master Sample Station",
Item: []models.ItemBreadCrumbV1{
{
Item: "Dashboard",
Url: "/dev/dashboard",
},
{
Item: "Master",
Url: "/dev/master",
},
{
Item: "Sample Stasion",
Url: "",
},
},
}
ret = Breadcrumb
return ret, nil
}
func (ss *MDSampleStationServices) GetListSampleStation(search string, currentPage int, rowPerPage int) ([]models.MDSampleStation, int, error) {
var sampleStationList []models.MDSampleStation
var totalData int
offset := (currentPage - 1) * rowPerPage
prm := "%" + strings.TrimSpace(search) + "%"
querytotal := `
SELECT COUNT(*)
FROM t_samplestation
WHERE T_SampleStationIsActive = 'Y' AND (T_SampleStationCode LIKE ? OR T_SampleStationName LIKE ?)
`
if err := dbx.Handlex.Get(&totalData, querytotal, prm, prm); err != nil {
return nil, 0, fmt.Errorf("error query get total data: %v", err)
}
query := `
SELECT
T_SampleStationID,
T_SampleStationCode,
T_SampleStationName,
T_SampleStationNat_GroupID,
T_SampleStationIsNonLab,
T_SampleStationIsActive
FROM t_samplestation
WHERE T_SampleStationIsActive = 'Y'
AND (T_SampleStationCode LIKE ? OR T_SampleStationName LIKE ?)
ORDER BY T_SampleStationID ASC
LIMIT ? OFFSET ?
`
if err := dbx.Handlex.Select(&sampleStationList, query, prm, prm, rowPerPage, offset); err != nil {
return nil, 0, fmt.Errorf("error query database: %v", err)
}
totalPage := int(math.Ceil(float64(totalData) / float64(rowPerPage)))
for _, d := range sampleStationList {
if len(d.T_SampleStationIsNonLab) == 0 {
d.T_SampleStationIsNonLab = "Lab"
}
}
return sampleStationList, totalPage, nil
}

View File

@@ -184,9 +184,7 @@ func (ug *MdUserGroupServices) DeleteMdUserGroup(id string) (models.UserGroupV1,
logger, _ := zap.NewProduction()
var data models.UserGroupV1
qry := `UPDATE m_usergroup
SET M_UserGroupIsActive = 'N',
M_UserGroupDeleted = NOW(),
M_UserGroupDeletedUserID = '1'
SET M_UserGroupIsActive = 'N'
WHERE M_UserGroupID = ?;`
// time.Sleep(5 * time.Second)
rst := dbx.Handlex.MustExec(qry, id)

View File

@@ -1,388 +0,0 @@
package groupresult
import (
"cpone/layout"
"cpone/models"
"cpone/component/modal"
"strconv"
"cpone/component/table"
"cpone/component/customtextfield"
)
// "cpone/component/sidebar_user_profile"
templ ContentGroupResultV1(
tableID string,
paginationID string,
searchID string,
dialogAddID string,
dialogAddBodyID string,
dialogEditID string,
dialogEditBodyID string,
dialogDeleteID string,
dialogDeleteBodyID string,
breadcrumb templ.Component,
tablecontent templ.Component,
filter templ.Component,
paginationGroupResult templ.Component,
modaladdform templ.Component,
modalEditform templ.Component,
modalDeleteform 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",
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})
<div class="row align-items-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-block align-items-center">
<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>
@filter
// table content
@tablecontent
@paginationGroupResult
<div class="d-flex justify-content-center text-primary">
<div class="htmx-indicator spinner-border text-primary" role="status" id="indicator">
<span class="sr-only"></span>
</div>
</div>
// hx-on::after-request="showtoast()"
// hx-on::reponse-error="cobaerror()"
// hx-on::send-error="cobaerror()"
@modaladdform
@modalEditform
@modalDeleteform
// @modalcomponent.Modal("dialogEdit", "Edit - User Group", DialogEditBody("", ""), DialogEditAction(), BtnCloseNew())
@JSkuGroupResultV1()
</div>
}
templ TableRowGroupResultV1(data []models.GroupResult,
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.Group_ResultName }</td>
<td>{ v.Group_ResultFlagPerTest }</td>
<td>{ v.Group_ResultFlagNonLab }</td>
<td>{ v.Group_ResultResumeMcu }</td>
<td>
@TableAction(v.Group_ResultID, hxGetEdit, hxTargetEdit, hxSwapEdit, hxIncludeEdit, hxGetDelete, hxTargetDelete, hxSwapDelete, hxIncludeDelete)
</td>
</tr>
}
}
templ TableAction(
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
id="btneditug"
type="button"
class="btneditug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2"
hx-get={ hxGetEdit + "?id=" + strconv.Itoa(id) }
hx-target={ hxTargetEdit }
hx-swap={ hxSwapEdit }
hx-include={ hxIncludeEdit }
>
// { "/dev/usergroupshoweditform?id=" + strconv.Itoa(v.M_UserGroupID) }
// data-toggle="modal"
// data-target={ "#dialogEdit" + strconv.Itoa(v.M_UserGroupID) }
Edit
</a>
<a
id="btndeleteug"
type="button"
class=" btndeleteug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2"
hx-get={ hxGetDelete + "?id=" + strconv.Itoa(id) }
hx-target={ hxTargetDelete }
hx-swap={ hxSwapDelete }
hx-include={ hxIncludeDelete }
>
// hx-get={ "/dev/usergroupshowdeleteform?id=" + strconv.Itoa(v.M_UserGroupID) }
// data-toggle="modal"
// data-target={ "#dialogDelete" + strconv.Itoa(v.M_UserGroupID) }
Hapus
</a>
</div>
}
templ DialogDeleteGroupResultActionV1() {
<div>
<button
type="button"
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4"
data-dismiss="modal"
>
Batal
</button>
<button
type="button"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg"
>
Yakin
</button>
</div>
}
templ BtnCloseDeleteGroupResultV1() {
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
>
<i aria-hidden="true" class="ki ki-close"></i>
</button>
}
templ JSkuGroupResultV1() {
<script>
function ShowLoading(evt) {
document
.getElementById("modalLoadEdit")
.setAttribute("style", "display:block !important;");
document
.getElementById("modalbdyEdit")
.setAttribute("style", "display:none !important;");
console.log(evt);
}
function ShowForm() {
document
.getElementById("modalLoadEdit")
.setAttribute("style", "display:none !important;");
document
.getElementById("modalbdyEdit")
.setAttribute("style", "display:block !important;;");
}
</script>
}
templ CssMasterGroupResultV1x() {
<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; */
}
#div-chart {
/* overflow-x: scroll; */
margin: 40px 10vw 40px 10vw;
}
.title {
font-size:20px;
font-weight: bold;
}
#title {
font-weight: 600;
}
.dropdown-menu{
transform: translate3d(0px, 35px, 0px)!important;
}
</style>
}
// for item dropdown
templ ItemDropdown(dataDropdown []models.GroupResultResumeMcu, selectedId int) {
if len(dataDropdown) == 0 {
<option value="0" disabled selected>Tidak Ada Data</option>
} else {
for _, v := range dataDropdown {
if (selectedId == v.ID) {
<option value={ strconv.Itoa(v.ID) } selected>{ v.Text }</option>
} else {
<option value={ strconv.Itoa(v.ID) }>{ v.Text }</option>
}
}
}
}
// for empty div
templ EmptyDiv1() {
<div></div>
}
templ ShowGroupResultV1x(title string, cmp templ.Component, css templ.Component, js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,
userprofile templ.Component) {
@layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile) {
@cmp
}
}
// table
templ TableGroupResult(data []models.GroupResult, 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{"GROUP RESULT NAME", "RESULT FLAG PER TEST", "RESULT FLAG NON LAB", "RESULT RESUME MCU", "AKSI"},
[]string{"20%", "20%", "20%", "20%", "20%"},
TableRowGroupResultV1(data, hxGetEdit, hxTargetEdit, hxSwapEdit, hxIncludeEdit, hxGetDelete, hxTargetDelete, hxSwapDelete, hxIncludeDelete))
</div>
}
templ SwapTableGroupResult(pagination templ.Component, table templ.Component) {
@pagination
@table
}
templ GroupResultForm(data models.GroupResultFormComponent) {
<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-on::before-request={ HandleFormBeforeRequest() }
hx-on::after-request={ HandleFormAfterRequest() }
>
@modalcomponent.Modal(data.ModalID,
data.ModalTitle,
data.DialogBody,
data.DialogAction,
data.ButtonCLose)
</form>
</div>
}
script HandleFormBeforeRequest() {
console.log("handle disable btn add");
const boxes = document.querySelectorAll('.btnaddact');
for (let i = 0; i < boxes.length; i++) {
boxes[i].setAttribute('disabled', 'true');
}
}
script HandleFormAfterRequest() {
console.log("handle enable btn add");
const boxes = document.querySelectorAll('.btnaddact');
for (let i = 0; i < boxes.length; i++) {
boxes[i].removeAttribute('disabled');
}
}
templ DeleteConfirmationBody(inputId models.CustomTextFieldv2Prm,
componentID string,
message string,
datHeader []string,
dataText []string,
hxOnLoad templ.ComponentScript) {
<div id={ componentID } hx-on::load={ hxOnLoad }>
<p>{ message }</p>
<div class="card rounded-lg">
<div class="card-body d-flex flex-row">
<div class="d-flex flex-column">
for _, v := range datHeader {
<div class="mb-1 mt-1 text-disabled font-weight-bold mr-5">{ v }</div>
}
</div>
<div class="d-flex flex-column ">
for _, v := range dataText {
<div class="mb-1 mt-1 font-weight-bold">
{ v }
</div>
}
</div>
</div>
</div>
@customtextfield.CustomTextFieldv2(inputId)
</div>
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,111 +0,0 @@
package groupresult
import (
"cpone/models"
"cpone/component/customtextfield"
"cpone/component/customcheckbox"
"cpone/component/customdropdown"
)
templ DialogNewBodyV1(inputId models.CustomTextFieldv2Prm,
inputGrName models.CustomTextFieldv2Prm,
checkboxGrFlagPerTest models.CustomCheckboxv1Prm,
checkboxGrFlagNonLab models.CustomCheckboxv1Prm,
dropdownGrResumeMcu models.CustomDropdownv1Prm,
listItem templ.Component,
componentID string,
hxOnLoad templ.ComponentScript) {
<div id={ componentID } hx-on::load={ hxOnLoad }>
@customtextfield.CustomTextFieldv2(
inputId)
@customtextfield.CustomTextFieldv2(
inputGrName)
@customcheckbox.MainCustomCheckboxInput(
checkboxGrFlagPerTest)
@customcheckbox.MainCustomCheckboxInput(
checkboxGrFlagNonLab)
@customdropdown.MainCustomDropdownInput(
dropdownGrResumeMcu,
listItem)
</div>
<script>
document.addEventListener('htmx:afterSwap', function(event) {
// Reinitialize selectpicker after HTMX content swap
$('.selectpicker').selectpicker('refresh');
});
</script>
}
script HandleJSModalAddGR(modalID string) {
$(modalID).modal('hide');
}
script HandleJSModalAddGRShow(modalID string) {
$(modalID).modal('show')
}
templ DialogNewActionV1(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
<div>
<button
hx-on::after-request={ HandleJSModalAddGR(modalID) }
hx-post={ LinkClose }
hx-target={ targetClose }
hx-swap={ hxSwapClose }
type="button"
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnaddact"
data-dismiss="modal"
>
Batal
</button>
<button
type="submit"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact"
>
Save
</button>
</div>
}
templ DialogNewAction() {
<div>
<button
type="button"
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4"
data-dismiss="modal"
>
Batal
</button>
<button
type="submit"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg"
>
Save changes
</button>
</div>
}
templ BtnCloseNew() {
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
>
<i aria-hidden="true" class="ki ki-close"></i>
</button>
}
templ BtnCloseNewV1(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
<button
hx-post={ LinkClose }
hx-target={ targetClose }
hx-swap={ hxSwapClose }
type="button"
hx-on::after-request={ HandleJSModalAddGR(modalID) }
class="close btnaddact"
data-dismiss="modal"
aria-label="Close"
>
<i aria-hidden="true" class="ki ki-close"></i>
</button>
}

View File

@@ -1,329 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package groupresult
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import (
"cpone/component/customcheckbox"
"cpone/component/customdropdown"
"cpone/component/customtextfield"
"cpone/models"
)
func DialogNewBodyV1(inputId models.CustomTextFieldv2Prm,
inputGrName models.CustomTextFieldv2Prm,
checkboxGrFlagPerTest models.CustomCheckboxv1Prm,
checkboxGrFlagNonLab models.CustomCheckboxv1Prm,
dropdownGrResumeMcu models.CustomDropdownv1Prm,
listItem templ.Component,
componentID 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\groupresult\modaladdgroupresult.templ`, Line: 18, Col: 22}
}
_, 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("\">")
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 = customtextfield.CustomTextFieldv2(
inputGrName).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customcheckbox.MainCustomCheckboxInput(
checkboxGrFlagPerTest).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customcheckbox.MainCustomCheckboxInput(
checkboxGrFlagNonLab).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customdropdown.MainCustomDropdownInput(
dropdownGrResumeMcu,
listItem).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 // Reinitialize selectpicker after HTMX content swap\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 HandleJSModalAddGR(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleJSModalAddGR_a6af`,
Function: `function __templ_HandleJSModalAddGR_a6af(modalID){$(modalID).modal('hide');
}`,
Call: templ.SafeScript(`__templ_HandleJSModalAddGR_a6af`, modalID),
CallInline: templ.SafeScriptInline(`__templ_HandleJSModalAddGR_a6af`, modalID),
}
}
func HandleJSModalAddGRShow(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleJSModalAddGRShow_3147`,
Function: `function __templ_HandleJSModalAddGRShow_3147(modalID){$(modalID).modal('show')
}`,
Call: templ.SafeScript(`__templ_HandleJSModalAddGRShow_3147`, modalID),
CallInline: templ.SafeScriptInline(`__templ_HandleJSModalAddGRShow_3147`, modalID),
}
}
func DialogNewActionV1(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_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = 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, HandleJSModalAddGR(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_Var5 templ.ComponentScript = HandleJSModalAddGR(modalID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5.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_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\groupresult\modaladdgroupresult.templ`, Line: 51, Col: 22}
}
_, 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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\groupresult\modaladdgroupresult.templ`, Line: 52, Col: 26}
}
_, 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-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\groupresult\modaladdgroupresult.templ`, Line: 53, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnaddact\" data-dismiss=\"modal\">Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact\">Save\r</button></div>")
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 DialogNewAction() 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_7745c5c3_Buffer.WriteString("<div><button type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4\" data-dismiss=\"modal\">Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg\">Save changes\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 BtnCloseNew() 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_Var10 := templ.GetChildren(ctx)
if templ_7745c5c3_Var10 == nil {
templ_7745c5c3_Var10 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><i aria-hidden=\"true\" class=\"ki ki-close\"></i></button>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func BtnCloseNewV1(LinkClose string, targetClose string, hxSwapClose string, modalID string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var11 := templ.GetChildren(ctx)
if templ_7745c5c3_Var11 == nil {
templ_7745c5c3_Var11 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleJSModalAddGR(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_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\groupresult\modaladdgroupresult.templ`, Line: 100, Col: 21}
}
_, 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(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\groupresult\modaladdgroupresult.templ`, Line: 101, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\groupresult\modaladdgroupresult.templ`, Line: 102, Col: 23}
}
_, 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("\" type=\"button\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 templ.ComponentScript = HandleJSModalAddGR(modalID)
_, 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("\" class=\"close btnaddact\" 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
})
}

View File

@@ -1,101 +0,0 @@
package groupresult
import (
"cpone/models"
"cpone/component/customtextfield"
"cpone/component/customcheckbox"
"cpone/component/customdropdown"
)
templ DialogEditForm(groupresultname string, groupresultflagpertest string, groupresultflagnonlab string, listItem templ.Component) {
@customtextfield.CustomTextFieldv2(
models.CustomTextFieldv2Prm{
Label: "Group Result name",
Name: "groupresultid",
Placeholder: "Group Result name",
Type: "hidden",
ID: "groupresultid",
})
@customtextfield.CustomTextFieldv2(
models.CustomTextFieldv2Prm{
Label: "Group Result Name",
Name: "groupresultname",
Placeholder: "Group Result Name",
Value: groupresultname,
Type: "text", ID: "groupresultname"})
@customcheckbox.MainCustomCheckboxInput(
models.CustomCheckboxv1Prm{
Label: "Group Result Flag Per Test (Dicentang Maka Ya)",
Name: "groupresultflagpertest",
ID: "groupresultflagpertest",
Value: groupresultflagpertest,
})
@customcheckbox.MainCustomCheckboxInput(
models.CustomCheckboxv1Prm{
Label: "Group Result Flag Non Lab (Dicentang Maka Ya)",
Name: "groupresultflagnonlab",
ID: "groupresultflagnonlab",
Value: groupresultflagnonlab,
})
@customdropdown.MainCustomDropdownInput(
models.CustomDropdownv1Prm{
Label: "Group Result Resume MCU",
Name: "groupresultresumemcu",
ID: "groupresultresumemcu",
},
listItem)
}
templ DialogEditBody(groupresultname string, groupresultflagpertest string, groupresultflagnonlab string, listItem templ.Component) {
<div id="modalbdyEdit">
@DialogEditForm(groupresultname, groupresultflagpertest, groupresultflagnonlab, listItem)
</div>
<div>
// <div class="text-center text-primary" id="modalLoadEdit" style="">
// <div class="spinner-border" role="status"></div>
// </div>
</div>
}
templ LoadingSpinner() {
<div id="modalbdyEdit">
<div class="text-center text-primary">
<div class="spinner-border" role="status"></div>
</div>
</div>
}
templ DialogEditAction() {
<div>
<button
id="btledit"
type="button"
hx-swap="delete"
hx-target="#modalbdyEdit"
onclick="htmx.trigger('.btneditusgp', 'htmx:abort')"
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4"
data-dismiss="modal"
>
Batal
</button>
<button
type="button"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg"
>
Save changes
</button>
</div>
}
templ BtnCloseEdit() {
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
hx-target="#modalbdyEdit"
onclick="htmx.trigger('.btneditusgp', 'htmx:abort')"
>
<i aria-hidden="true" class="ki ki-close"></i>
</button>
}

View File

@@ -1,193 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package groupresult
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import (
"cpone/component/customcheckbox"
"cpone/component/customdropdown"
"cpone/component/customtextfield"
"cpone/models"
)
func DialogEditForm(groupresultname string, groupresultflagpertest string, groupresultflagnonlab string, listItem 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 = customtextfield.CustomTextFieldv2(
models.CustomTextFieldv2Prm{
Label: "Group Result name",
Name: "groupresultid",
Placeholder: "Group Result name",
Type: "hidden",
ID: "groupresultid",
}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(
models.CustomTextFieldv2Prm{
Label: "Group Result Name",
Name: "groupresultname",
Placeholder: "Group Result Name",
Value: groupresultname,
Type: "text", ID: "groupresultname"}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customcheckbox.MainCustomCheckboxInput(
models.CustomCheckboxv1Prm{
Label: "Group Result Flag Per Test (Dicentang Maka Ya)",
Name: "groupresultflagpertest",
ID: "groupresultflagpertest",
Value: groupresultflagpertest,
}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customcheckbox.MainCustomCheckboxInput(
models.CustomCheckboxv1Prm{
Label: "Group Result Flag Non Lab (Dicentang Maka Ya)",
Name: "groupresultflagnonlab",
ID: "groupresultflagnonlab",
Value: groupresultflagnonlab,
}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customdropdown.MainCustomDropdownInput(
models.CustomDropdownv1Prm{
Label: "Group Result Resume MCU",
Name: "groupresultresumemcu",
ID: "groupresultresumemcu",
},
listItem).Render(ctx, templ_7745c5c3_Buffer)
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 DialogEditBody(groupresultname string, groupresultflagpertest string, groupresultflagnonlab string, listItem 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_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("<div id=\"modalbdyEdit\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = DialogEditForm(groupresultname, groupresultflagpertest, groupresultflagnonlab, listItem).Render(ctx, templ_7745c5c3_Buffer)
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 LoadingSpinner() 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)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"modalbdyEdit\"><div class=\"text-center text-primary\"><div class=\"spinner-border\" role=\"status\"></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 DialogEditAction() 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_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div><button id=\"btledit\" type=\"button\" hx-swap=\"delete\" hx-target=\"#modalbdyEdit\" onclick=\"htmx.trigger(&#39;.btneditusgp&#39;, &#39;htmx:abort&#39;)\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4\" data-dismiss=\"modal\">Batal\r</button> <button type=\"button\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg\">Save changes\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 BtnCloseEdit() 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("<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\" hx-target=\"#modalbdyEdit\" onclick=\"htmx.trigger(&#39;.btneditusgp&#39;, &#39;htmx:abort&#39;)\"><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
})
}

View File

@@ -1,265 +0,0 @@
package dev_mdbahanview
import "cpone/layout"
import "cpone/models"
import "cpone/component/customtextfield"
import "cpone/component/customdropdown"
import "strconv"
templ MdBahanScreen(
tableID string,
paginationID string,
dialogAddID string,
dialogAddBodyID string,
dialogEditID string,
dialogEditBodyID string,
dialogDeleteID string,
dialogDeleteBodyID string,
breadcrumb templ.Component,
tablecontent templ.Component,
filterComponent templ.Component,
pagination templ.Component,
dialogAddCmp templ.Component,
dialogEditCmp templ.Component,
dialogDeleteCmp templ.Component,
) {
<div class="container-fluid">
@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: "tableID",
Name: "tableID",
Type: "hidden",
Value: tableID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID",
Name: "paginationID",
Type: "hidden",
Value: paginationID})
<div class="row align-items-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-block align-items-center">
<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
@pagination
<div id="loading-child" class=" rounded bg-transparent">
// <div class="spinner spinner-lg spinner-primary"></div>
<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>
@dialogAddCmp
@dialogEditCmp
@dialogDeleteCmp
</div>
}
templ CssMdUserGroup() {
}
templ JsMdBahan() {
<script>
document.addEventListener('htmx:afterSwap', function(event) {
// Reinitialize selectpicker after HTMX content swap
$('.selectpicker').selectpicker('refresh');
});
document.addEventListener('htmx:beforeRequest', function(event) {
console.log("Before Request")
console.log(event.detail.xhr)
console.log(event.detail.target)
});
document.addEventListener('htmx:afterRequest', function(event) {
console.log("After Request")
console.log(event.detail.xhr)
console.log(event.detail.target)
});
document.addEventListener('htmx:historyCacheError', function(event) {
console.log("Error History Cache Error")
console.log(event.detail.cause)
});
document.addEventListener('htmx:historyCacheMissError', function(event) {
console.log("Error History Cache Miss Error")
console.log(event.detail.xhr)
console.log(event.detail.path)
});
document.addEventListener('htmx:oobErrorNoTarget', function(event) {
console.log("Error OOB No Target")
console.log(event.detail.content)
});
document.addEventListener('htmx:onLoadError', function(event) {
console.log("Error On Load")
console.log(event.detail.xhr)
console.log(event.detail.elt)
console.log(event.detail.target)
console.log(event.detail.exception)
console.log(event.detail.requestConfig)
});
document.addEventListener('htmx:responseError', function(event) {
console.log("Error Response")
console.log(event.detail.xhr)
console.log(event.detail.elt)
console.log(event.detail.requestConfig)
});
document.addEventListener('htmx:sendError', function(event) {
console.log("Error Send Error")
console.log(event.detail.xhr)
console.log(event.detail.elt)
console.log(event.detail.requestConfig)
});
document.addEventListener('htmx:sseError', function(event) {
console.log("Error Sse ")
console.log(event.detail.xhr)
console.log(event.detail.error)
console.log(event.detail.source)
});
document.addEventListener('htmx:swapError', function(event) {
console.log("Error Swap Error")
console.log(event.detail.xhr)
console.log(event.detail.elt)
console.log("Target Swap: "+event.detail.target)
console.log(event.detail.requestConfig)
});
document.addEventListener('htmx:targetError', function(event) {
console.log("Error target")
console.log(event.detail.elt)
console.log("Target ID: "+event.detail.target)
});
</script>
}
script BeforeRequestContent() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}
script AfterRequestContent() {
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");
}
templ MdBahanFilter(
hxGet string,
hxTrigger string,
hxInclude string,
hxSwap string,
hxTarget string,
dataStation []models.TmpSampleStation,
selectedIdStation int,
hxBeforeRequest templ.ComponentScript,
hxAfterRequest templ.ComponentScript,
) {
<div class="container p-0">
<div class="row">
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 mb-2">
<input
id="filter-name"
class="form-control form-control-lg bg-field border-0 rounded-lg"
type="text"
name="filtername"
placeholder="Name/Kode"
autocomplete="off"
hx-target={ hxTarget }
hx-trigger={ hxTrigger }
hx-include={ hxInclude }
hx-get={ hxGet }
hx-swap={ hxSwap }
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">
@customdropdown.CustomDropdownFilter("filter-station",
"filterstation",
hxInclude,
hxGet,
hxSwap,
hxTarget,
"change",
hxBeforeRequest,
hxAfterRequest, ListItemStation(dataStation, selectedIdStation))
</div>
</div>
</div>
}
templ ListItemStation(
dataStation []models.TmpSampleStation,
selectedIdStation int) {
for _, v := range dataStation {
if v.T_SampleStationID == selectedIdStation {
<option value={ strconv.Itoa(v.T_SampleStationID) } selected="selected">{ v.T_SampleStationName }</option>
} else {
<option value={ strconv.Itoa(v.T_SampleStationID) }>{ v.T_SampleStationName }</option>
}
}
}
templ ShowMdBahanScreen(title string, cmp templ.Component, css templ.Component, js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,
userprofile templ.Component) {
@layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile) {
@cmp
}
}

View File

@@ -1,531 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdbahanview
//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/layout"
import "cpone/models"
import "cpone/component/customtextfield"
import "cpone/component/customdropdown"
import "strconv"
func MdBahanScreen(
tableID string,
paginationID string,
dialogAddID string,
dialogAddBodyID string,
dialogEditID string,
dialogEditBodyID string,
dialogDeleteID string,
dialogDeleteBodyID string,
breadcrumb templ.Component,
tablecontent templ.Component,
filterComponent templ.Component,
pagination templ.Component,
dialogAddCmp templ.Component,
dialogEditCmp templ.Component,
dialogDeleteCmp templ.Component,
) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"container-fluid\">")
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: "tableID",
Name: "tableID",
Type: "hidden",
Value: tableID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID",
Name: "paginationID",
Type: "hidden",
Value: paginationID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row align-items-center mb-10\"><div class=\"col-md-10 col-sm-12 p-0 \">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = breadcrumb.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-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\mdbahan\mdbahan.templ`, Line: 70, Col: 37}
}
_, 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</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\mdbahan\mdbahan.templ`, Line: 79, Col: 36}
}
_, 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</button></div></div><div id=\"loading-parent\" class=\" rounded\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = filterComponent.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecontent.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = pagination.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>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = dialogAddCmp.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = dialogEditCmp.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = dialogDeleteCmp.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 CssMdUserGroup() 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_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func JsMdBahan() 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("<script>\r\n\t\tdocument.addEventListener('htmx:afterSwap', function(event) {\r\n\t\t\t// Reinitialize selectpicker after HTMX content swap\r\n\t\t\t$('.selectpicker').selectpicker('refresh');\r\n\t\t});\r\n \r\n document.addEventListener('htmx:beforeRequest', function(event) {\r\n console.log(\"Before Request\")\r\n\t\t\tconsole.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.target)\r\n \r\n });\r\n\r\n document.addEventListener('htmx:afterRequest', function(event) {\r\n console.log(\"After Request\")\r\n console.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.target)\r\n });\r\n document.addEventListener('htmx:historyCacheError', function(event) {\r\n console.log(\"Error History Cache Error\")\r\n console.log(event.detail.cause)\r\n\t\t\t\r\n });\r\n document.addEventListener('htmx:historyCacheMissError', function(event) {\r\n console.log(\"Error History Cache Miss Error\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.path)\r\n\t\t\t\r\n });\r\n document.addEventListener('htmx:oobErrorNoTarget', function(event) {\r\n console.log(\"Error OOB No Target\")\r\n console.log(event.detail.content)\r\n });\r\n document.addEventListener('htmx:onLoadError', function(event) {\r\n console.log(\"Error On Load\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.elt)\r\n console.log(event.detail.target)\r\n console.log(event.detail.exception)\r\n console.log(event.detail.requestConfig)\r\n });\r\n document.addEventListener('htmx:responseError', function(event) {\r\n console.log(\"Error Response\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.elt)\r\n console.log(event.detail.requestConfig)\r\n });\r\n document.addEventListener('htmx:sendError', function(event) {\r\n console.log(\"Error Send Error\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.elt)\r\n console.log(event.detail.requestConfig)\r\n });\r\n document.addEventListener('htmx:sseError', function(event) {\r\n console.log(\"Error Sse \")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.error)\r\n console.log(event.detail.source)\r\n });\r\n\t\tdocument.addEventListener('htmx:swapError', function(event) {\r\n console.log(\"Error Swap Error\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.elt)\r\n console.log(\"Target Swap: \"+event.detail.target)\r\n console.log(event.detail.requestConfig)\r\n });\r\n\t\tdocument.addEventListener('htmx:targetError', function(event) {\r\n console.log(\"Error target\")\r\n console.log(event.detail.elt)\r\n console.log(\"Target ID: \"+event.detail.target)\r\n });\r\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func BeforeRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_BeforeRequestContent_911f`,
Function: `function __templ_BeforeRequestContent_911f(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}`,
Call: templ.SafeScript(`__templ_BeforeRequestContent_911f`),
CallInline: templ.SafeScriptInline(`__templ_BeforeRequestContent_911f`),
}
}
func AfterRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_AfterRequestContent_6cc0`,
Function: `function __templ_AfterRequestContent_6cc0(){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");
}`,
Call: templ.SafeScript(`__templ_AfterRequestContent_6cc0`),
CallInline: templ.SafeScriptInline(`__templ_AfterRequestContent_6cc0`),
}
}
func MdBahanFilter(
hxGet string,
hxTrigger string,
hxInclude string,
hxSwap string,
hxTarget string,
dataStation []models.TmpSampleStation,
selectedIdStation int,
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)
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=\"container p-0\"><div class=\"row\"><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
}
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=\"filter-name\" class=\"form-control form-control-lg bg-field border-0 rounded-lg\" type=\"text\" name=\"filtername\" placeholder=\"Name/Kode\" autocomplete=\"off\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahan.templ`, Line: 222, Col: 25}
}
_, 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-trigger=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahan.templ`, Line: 223, Col: 27}
}
_, 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-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahan.templ`, Line: 224, Col: 27}
}
_, 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-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahan.templ`, Line: 225, Col: 19}
}
_, 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(hxSwap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahan.templ`, Line: 226, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 templ.ComponentScript = hxBeforeRequest
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 templ.ComponentScript = hxAfterRequest
_, 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("\"></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
}
templ_7745c5c3_Err = customdropdown.CustomDropdownFilter("filter-station",
"filterstation",
hxInclude,
hxGet,
hxSwap,
hxTarget,
"change",
hxBeforeRequest,
hxAfterRequest, ListItemStation(dataStation, selectedIdStation)).Render(ctx, templ_7745c5c3_Buffer)
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 ListItemStation(
dataStation []models.TmpSampleStation,
selectedIdStation int) 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_Var14 := templ.GetChildren(ctx)
if templ_7745c5c3_Var14 == nil {
templ_7745c5c3_Var14 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
for _, v := range dataStation {
if v.T_SampleStationID == selectedIdStation {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.T_SampleStationID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahan.templ`, Line: 251, Col: 52}
}
_, 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("\" selected=\"selected\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(v.T_SampleStationName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahan.templ`, Line: 251, Col: 98}
}
_, 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("</option>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.T_SampleStationID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahan.templ`, Line: 253, Col: 52}
}
_, 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("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(v.T_SampleStationName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahan.templ`, Line: 253, Col: 78}
}
_, 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("</option>")
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 ShowMdBahanScreen(title string, cmp templ.Component, css templ.Component, js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,
userprofile 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_Var19 := templ.GetChildren(ctx)
if templ_7745c5c3_Var19 == nil {
templ_7745c5c3_Var19 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Var20 := 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)
}
templ_7745c5c3_Err = cmp.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer)
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var20), templ_7745c5c3_Buffer)
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
})
}

View File

@@ -1,189 +0,0 @@
package dev_mdbahanview
import "cpone/models"
import "cpone/component/modal"
import "cpone/component/customtextfield"
import "cpone/component/customdropdown"
templ BahanForm(data models.BahanFormComponent) {
<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() }
>
@modalcomponent.Modal(data.ModalID,
data.ModalTitle,
data.DialogBody,
data.DialogAction,
data.ButtonCLose)
</form>
</div>
}
script HandleFormBeforeRequest() {
console.log("handle disable btn add");
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
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() {
console.log("handle enable btn add");
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 BodyFormBahan(inputId string,
inputCode models.CustomTextFieldv2Prm,
inputName models.CustomTextFieldv2Prm,
inputStation models.CustomDropdownV2Prm,
componentID string,
hxOnLoad templ.ComponentScript) {
<div id={ componentID } hx-on::load={ hxOnLoad }>
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{Name: "bahanid", ID: "bahanID", Type: "hidden", Value: inputId})
@customtextfield.CustomTextFieldv2(
inputCode)
@customtextfield.CustomTextFieldv2(
inputName)
@customdropdown.CustomDropdownForm(inputStation)
</div>
}
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 ActionFormBahan(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 BtnCloseFormBahan(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 DeleteConfirmationBody(inputId string,
componentID string,
message string,
datHeader []string,
dataText []string,
hxOnLoad templ.ComponentScript) {
<div id={ componentID } hx-on::load={ hxOnLoad }>
<p>{ message }</p>
<div class="card rounded-lg">
<div class="card-body d-flex flex-row">
<div class="d-flex flex-column">
for _, v := range datHeader {
<div class="mb-1 mt-1 text-disabled font-weight-bold mr-5">{ v }</div>
}
</div>
<div class="d-flex flex-column ">
for _, v := range dataText {
<div class="mb-1 mt-1 font-weight-bold">
{ v }
</div>
}
</div>
</div>
</div>
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{Name: "bahanid", ID: "bahanID", Type: "hidden", Value: inputId})
</div>
}
templ ActionFormBahanDelete(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>
}

View File

@@ -1,654 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdbahanview
//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/customdropdown"
func BahanForm(data models.BahanFormComponent) 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\mdbahan\mdbahanformmodal.templ`, Line: 11, Col: 24}
}
_, 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\mdbahan\mdbahanformmodal.templ`, Line: 12, Col: 22}
}
_, 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\mdbahan\mdbahanformmodal.templ`, Line: 14, Col: 28}
}
_, 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\mdbahan\mdbahanformmodal.templ`, Line: 15, Col: 24}
}
_, 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\mdbahan\mdbahanformmodal.templ`, Line: 16, Col: 30}
}
_, 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
}
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 = 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_2922`,
Function: `function __templ_HandleFormBeforeRequest_2922(){console.log("handle disable btn add");
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
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_2922`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_2922`),
}
}
func HandleFormAfterRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormAfterRequest_956b`,
Function: `function __templ_HandleFormAfterRequest_956b(){console.log("handle enable btn add");
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_HandleFormAfterRequest_956b`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_956b`),
}
}
func BodyFormBahan(inputId string,
inputCode models.CustomTextFieldv2Prm,
inputName models.CustomTextFieldv2Prm,
inputStation models.CustomDropdownV2Prm,
componentID 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_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\mdbahan\mdbahanformmodal.templ`, Line: 68, Col: 22}
}
_, 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(models.CustomTextFieldv2Prm{Name: "bahanid", ID: "bahanID", Type: "hidden", Value: inputId}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(
inputCode).Render(ctx, templ_7745c5c3_Buffer)
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 = customdropdown.CustomDropdownForm(inputStation).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 JsHideModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JsHideModal_da6c`,
Function: `function __templ_JsHideModal_da6c(modalID){$(modalID).modal('hide')
}`,
Call: templ.SafeScript(`__templ_JsHideModal_da6c`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsHideModal_da6c`, modalID),
}
}
func JsShowModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JsShowModal_b74d`,
Function: `function __templ_JsShowModal_b74d(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_b74d`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsShowModal_b74d`, modalID),
}
}
func ActionFormBahan(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\mdbahan\mdbahanformmodal.templ`, Line: 102, Col: 22}
}
_, 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\mdbahan\mdbahanformmodal.templ`, Line: 103, Col: 26}
}
_, 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\mdbahan\mdbahanformmodal.templ`, Line: 104, Col: 24}
}
_, 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 BtnCloseFormBahan(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\mdbahan\mdbahanformmodal.templ`, Line: 125, Col: 21}
}
_, 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\mdbahan\mdbahanformmodal.templ`, Line: 126, Col: 25}
}
_, 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\mdbahan\mdbahanformmodal.templ`, Line: 127, Col: 23}
}
_, 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 DeleteConfirmationBody(inputId string,
componentID string,
message string,
datHeader []string,
dataText []string,
hxOnLoad templ.ComponentScript) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var22 := templ.GetChildren(ctx)
if templ_7745c5c3_Var22 == nil {
templ_7745c5c3_Var22 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxOnLoad)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahanformmodal.templ`, Line: 144, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var24 templ.ComponentScript = hxOnLoad
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(message)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahanformmodal.templ`, Line: 145, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p><div class=\"card rounded-lg\"><div class=\"card-body d-flex flex-row\"><div class=\"d-flex flex-column\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range datHeader {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 text-disabled font-weight-bold mr-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahanformmodal.templ`, Line: 150, Col: 68}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"d-flex flex-column \">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range dataText {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 font-weight-bold\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahanformmodal.templ`, Line: 156, Col: 10}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{Name: "bahanid", ID: "bahanID", Type: "hidden", Value: 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 ActionFormBahanDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var28 := templ.GetChildren(ctx)
if templ_7745c5c3_Var28 == nil {
templ_7745c5c3_Var28 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModal(modalID))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var29 templ.ComponentScript = JsHideModal(modalID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahanformmodal.templ`, Line: 170, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahanformmodal.templ`, Line: 171, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahanformmodal.templ`, Line: 172, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" 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
})
}

View File

@@ -1,130 +0,0 @@
package dev_mdbahanview
import "cpone/component/table"
import "cpone/models"
import "strconv"
templ TableBahan(data []models.Bahan,
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{"KODE", "NAMA BAHAN", "SAMPLE STATION", "AKSI"},
[]string{"20%", "30%", "30%", "20%"},
RowBahan(data,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
))
</div>
}
templ RowBahan(data []models.Bahan,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete string,
) {
if len(data) == 0 {
<tr>
<td colspan="4" class="text-center">Data Tidak Ditemukan</td>
</tr>
}
for _, v := range data {
<tr>
<td>{ v.T_BahanCode }</td>
<td>{ v.T_BahanName }</td>
<td>{ v.T_SampleStationName }</td>
<td>
@TableAction(v.T_BahanID,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
)
</td>
</tr>
}
}
templ TableAction(
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="btnactbhn 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=" btnactbhn 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('btnactbhn');
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('btnactbhn');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.remove('disabled');
}
console.log(id)
}

View File

@@ -1,451 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdbahanview
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import "cpone/component/table"
import "cpone/models"
import "strconv"
func TableBahan(data []models.Bahan,
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_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(tableID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 18, Col: 18}
}
_, 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\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"KODE", "NAMA BAHAN", "SAMPLE STATION", "AKSI"},
[]string{"20%", "30%", "30%", "20%"},
RowBahan(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 RowBahan(data []models.Bahan,
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=\"4\" 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.T_BahanCode)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 51, Col: 22}
}
_, 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.T_BahanName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 52, Col: 22}
}
_, 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
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.T_SampleStationName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 53, Col: 30}
}
_, 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("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = TableAction(v.T_BahanID,
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 TableAction(
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_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 class=\"row px-5 d-flex justify-content-around\">")
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=\"btnactbhn 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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, 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\mdbahan\mdbahantable.templ`, Line: 86, Col: 49}
}
_, 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-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 87, Col: 27}
}
_, 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-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 88, Col: 23}
}
_, 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-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 89, Col: 29}
}
_, 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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs("#spnredt" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 90, Col: 47}
}
_, 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-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(id))
_, 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-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><span id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs("spnredt" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 94, Col: 42}
}
_, 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("\" 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=\" btnactbhn 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_Var16 string
templ_7745c5c3_Var16, 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\mdbahan\mdbahantable.templ`, Line: 100, Col: 51}
}
_, 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-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 101, Col: 29}
}
_, 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-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 102, Col: 25}
}
_, 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-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 103, 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-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs("#spnrdel" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 104, Col: 47}
}
_, 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 = HandleBeforeRequestRow(strconv.Itoa(id))
_, 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 = HandleAfterRequestRow(strconv.Itoa(id))
_, 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("\"><span id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs("spnrdel" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdbahan\mdbahantable.templ`, Line: 108, Col: 42}
}
_, 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("\" class=\"htmx-indicator spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span> Hapus\r</a></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 HandleBeforeRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleBeforeRequestRow_7d4f`,
Function: `function __templ_HandleBeforeRequestRow_7d4f(id){var cusid_ele = document.getElementsByClassName('btnactbhn');
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_7d4f`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleBeforeRequestRow_7d4f`, id),
}
}
func HandleAfterRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleAfterRequestRow_ce9e`,
Function: `function __templ_HandleAfterRequestRow_ce9e(id){var cusid_ele = document.getElementsByClassName('btnactbhn');
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_ce9e`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleAfterRequestRow_ce9e`, id),
}
}

View File

@@ -1,255 +0,0 @@
package dev_mdgroupresultview
import (
"cpone/layout"
"cpone/component/customtextfield"
"cpone/models"
"strconv"
)
templ MdGroupResultScreen(
tableID string,
paginationID string,
searchID string,
dialogAddID string,
dialogAddBodyID string,
dialogEditID string,
dialogEditBodyID string,
dialogDeleteID string,
dialogDeleteBodyID string,
breadcrumb templ.Component,
tablecontent templ.Component,
filterComponent templ.Component,
paginationComponent templ.Component,
modalAddForm templ.Component,
modalEditForm templ.Component,
modalDeleteForm templ.Component) {
<div class="container-fluid">
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
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",
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})
<div class="row align-items-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-block align-items-center">
<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>
@filterComponent
<div id="loading-parent" class=" rounded">
@tablecontent
@paginationComponent
@modalAddForm
@modalEditForm
@modalDeleteForm
<div id="loading-child" class=" rounded bg-transparent">
// <div class="spinner spinner-lg spinner-primary"></div>
<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>
}
// for item dropdown
templ ItemDropdown(dataDropdown []models.GroupResultResumeMcu, selectedId int) {
if len(dataDropdown) == 0 {
<option value="0" disabled selected>Tidak Ada Data</option>
} else {
for _, v := range dataDropdown {
if (selectedId == v.ID) {
<option value={ strconv.Itoa(v.ID) } selected>{ v.Text }</option>
} else {
<option value={ strconv.Itoa(v.ID) }>{ v.Text }</option>
}
}
}
}
// for empty div
templ EmptyDiv1() {
<div></div>
}
templ CssMdGroupResult() {
<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; */
}
#div-chart {
/* overflow-x: scroll; */
margin: 40px 10vw 40px 10vw;
}
.title {
font-size:20px;
font-weight: bold;
}
#title {
font-weight: 600;
}
.dropdown-menu{
transform: translate3d(0px, 0px, 0px)!important;
}
.filter-option-inner-inner {
margin-top: 1.2vh;
color: var(--text-disabled);
}
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn {
color: var(--text-disabled);
}
.bootstrap-select.btn-group .dropdown-menu {
min-width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
position: sticky;
}
</style>
}
templ JsMdGroupResult() {
<script>
function onLoadingStart() {
// const loadingParent = document.getElementById("loading-parent");
// const loadingChild = document.getElementById("loading-child");
// const loadingSpinner = document.getElementById("loading-spinner");
// loadingParent.classList.add("overlay");
// loadingParent.classList.add("overlay-block");
// loadingChild.classList.add("overlay-layer");
// loadingSpinner.classList.remove("d-none");
// Additional logic when loading starts
}
function onLoadingEnd() {
console.log('Loading ended');
// 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");
}
document.addEventListener('htmx:beforeRequest', function(event) {
var indicator = document.querySelector('#loadingcontent');
console.log(event.detail.xhr)
console.log(event.detail.elt)
if (indicator) {
onLoadingStart();
}
});
document.addEventListener('htmx:afterRequest', function(event) {
var indicator = document.querySelector('#loadingcontent');
if (indicator) {
onLoadingEnd();
}
});
</script>
}
script BeforeRequestContentMdGroupResult() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}
script AfterRequestContentMdGroupResult() {
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");
}
templ ShowMdGroupResultScreen(title string, cmp templ.Component, css templ.Component, js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,
userprofile templ.Component) {
@layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile) {
@cmp
}
}

View File

@@ -1,433 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdgroupresultview
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import (
"cpone/component/customtextfield"
"cpone/layout"
"cpone/models"
"strconv"
)
func MdGroupResultScreen(
tableID string,
paginationID string,
searchID string,
dialogAddID string,
dialogAddBodyID string,
dialogEditID string,
dialogEditBodyID string,
dialogDeleteID string,
dialogDeleteBodyID string,
breadcrumb templ.Component,
tablecontent templ.Component,
filterComponent templ.Component,
paginationComponent templ.Component,
modalAddForm templ.Component,
modalEditForm templ.Component,
modalDeleteForm templ.Component) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
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=\"container-fluid\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
Name: "tableID",
Type: "hidden",
Value: tableID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID",
Name: "paginationID",
Type: "hidden",
Value: paginationID}).Render(ctx, templ_7745c5c3_Buffer)
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 = templ_7745c5c3_Buffer.WriteString("<div class=\"row align-items-center mb-10\"><div class=\"col-md-10 col-sm-12 p-0 \">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = breadcrumb.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-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\mdgroupresult\mdgroupresult.templ`, Line: 75, Col: 37}
}
_, 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</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\mdgroupresult\mdgroupresult.templ`, Line: 84, Col: 36}
}
_, 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</button></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = filterComponent.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, 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 = tablecontent.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
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 = modalEditForm.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 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
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
// for item dropdown
func ItemDropdown(dataDropdown []models.GroupResultResumeMcu, selectedId int) 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_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if len(dataDropdown) == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"0\" disabled selected>Tidak Ada Data</option>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
for _, v := range dataDropdown {
if selectedId == v.ID {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresult.templ`, Line: 113, Col: 38}
}
_, 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("\" selected>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.Text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresult.templ`, Line: 113, Col: 58}
}
_, 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("</option>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresult.templ`, Line: 115, Col: 38}
}
_, 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("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(v.Text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresult.templ`, Line: 115, Col: 49}
}
_, 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("</option>")
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
})
}
// for empty div
func EmptyDiv1() 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_7745c5c3_Buffer.WriteString("<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 CssMdGroupResult() 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_Var10 := templ.GetChildren(ctx)
if templ_7745c5c3_Var10 == nil {
templ_7745c5c3_Var10 = 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\t\r\n .dropdown-menu{\r\n\t\ttransform: translate3d(0px, 0px, 0px)!important;\r\n\t}\r\n\r\n\t.filter-option-inner-inner {\r\n\t\tmargin-top: 1.2vh;\r\n\t\tcolor: var(--text-disabled);\r\n\t}\r\n\r\n\t.bootstrap-select > .dropdown-toggle.bs-placeholder.btn {\r\n\t\tcolor: var(--text-disabled);\r\n\t}\r\n\r\n\t.bootstrap-select.btn-group .dropdown-menu {\r\n\tmin-width: 100%;\r\n\t-webkit-box-sizing: border-box;\r\n\t-moz-box-sizing: border-box;\r\n\tbox-sizing: border-box;\r\n\tposition: sticky;\r\n\t}\r\n \r\n</style>")
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 JsMdGroupResult() templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var11 := templ.GetChildren(ctx)
if templ_7745c5c3_Var11 == nil {
templ_7745c5c3_Var11 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script>\r\n function onLoadingStart() {\r\n // const loadingParent = document.getElementById(\"loading-parent\");\r\n\t\t\t// const loadingChild = document.getElementById(\"loading-child\");\r\n\t\t\t// const loadingSpinner = document.getElementById(\"loading-spinner\");\r\n\r\n\t\t\t// loadingParent.classList.add(\"overlay\");\r\n\t\t\t// loadingParent.classList.add(\"overlay-block\");\r\n\t\t\t// loadingChild.classList.add(\"overlay-layer\");\r\n\t\t\t// loadingSpinner.classList.remove(\"d-none\");\r\n\r\n // Additional logic when loading starts\r\n }\r\n\r\n function onLoadingEnd() {\r\n console.log('Loading ended');\r\n // const loadingParent = document.getElementById(\"loading-parent\");\r\n\t\t\t// const loadingChild = document.getElementById(\"loading-child\");\r\n\t\t\t// const loadingSpinner = document.getElementById(\"loading-spinner\");\r\n\r\n\t\t\t// loadingParent.classList.remove(\"overlay\");\r\n\t\t\t// loadingParent.classList.remove(\"overlay-block\");\r\n\t\t\t// loadingChild.classList.remove(\"overlay-layer\");\r\n\t\t\t// loadingSpinner.classList.add(\"d-none\");\r\n }\r\n\r\n document.addEventListener('htmx:beforeRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n\t\t\tconsole.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.elt)\r\n if (indicator) {\r\n onLoadingStart();\r\n }\r\n });\r\n\r\n document.addEventListener('htmx:afterRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n if (indicator) {\r\n onLoadingEnd();\r\n }\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 BeforeRequestContentMdGroupResult() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_BeforeRequestContentMdGroupResult_911f`,
Function: `function __templ_BeforeRequestContentMdGroupResult_911f(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}`,
Call: templ.SafeScript(`__templ_BeforeRequestContentMdGroupResult_911f`),
CallInline: templ.SafeScriptInline(`__templ_BeforeRequestContentMdGroupResult_911f`),
}
}
func AfterRequestContentMdGroupResult() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_AfterRequestContentMdGroupResult_6cc0`,
Function: `function __templ_AfterRequestContentMdGroupResult_6cc0(){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");
}`,
Call: templ.SafeScript(`__templ_AfterRequestContentMdGroupResult_6cc0`),
CallInline: templ.SafeScriptInline(`__templ_AfterRequestContentMdGroupResult_6cc0`),
}
}
func ShowMdGroupResultScreen(title string, cmp templ.Component, css templ.Component, js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,
userprofile 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_Var12 := templ.GetChildren(ctx)
if templ_7745c5c3_Var12 == nil {
templ_7745c5c3_Var12 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Var13 := 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)
}
templ_7745c5c3_Err = cmp.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer)
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var13), templ_7745c5c3_Buffer)
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
})
}

View File

@@ -1,205 +0,0 @@
package dev_mdgroupresultview
import "cpone/models"
import "cpone/component/modal"
import "cpone/component/customtextfield"
import "cpone/component/customcheckbox"
import "cpone/component/customdropdown"
templ GroupResultForm(data models.GroupResultFormComponent) {
<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() }
>
@modalcomponent.Modal(data.ModalID,
data.ModalTitle,
data.DialogBody,
data.DialogAction,
data.ButtonCLose)
</form>
</div>
}
script HandleFormBeforeRequest() {
console.log("handle disable btn add");
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
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() {
console.log("handle enable btn add");
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 BodyFormGroupResult(inputId models.CustomTextFieldv2Prm,
inputGrName models.CustomTextFieldv2Prm,
checkboxGrFlagPerTest models.CustomCheckboxv1Prm,
checkboxGrFlagNonLab models.CustomCheckboxv1Prm,
dropdownGrResumeMcu models.CustomDropdownv1Prm,
listItem templ.Component,
componentID string,
hxOnLoad templ.ComponentScript) {
<div id={ componentID } hx-on::load={ hxOnLoad }>
@customtextfield.CustomTextFieldv2(
inputId)
@customtextfield.CustomTextFieldv2(
inputGrName)
@customcheckbox.MainCustomCheckboxInput(
checkboxGrFlagPerTest)
<div class="mt-5"></div>
@customcheckbox.MainCustomCheckboxInput(
checkboxGrFlagNonLab)
<div class="mt-5"></div>
@customdropdown.MainCustomDropdownInput(
dropdownGrResumeMcu,
listItem)
</div>
<script>
document.addEventListener('htmx:afterSwap', function(event) {
// Reinitialize selectpicker after HTMX content swap
$('.selectpicker').selectpicker('refresh');
});
</script>
}
script JsHideModalGroupResult(modalID string) {
$(modalID).modal('hide')
}
script JsShowModalGroupResult(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 ActionFormGroupResult(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
<div>
<button
hx-on::after-request={ JsHideModalGroupResult(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 BtnCloseFormGroupResult(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
<button
hx-post={ LinkClose }
hx-target={ targetClose }
hx-swap={ hxSwapClose }
type="button"
hx-on::after-request={ JsHideModalGroupResult(modalID) }
class="close btnactcancel"
data-dismiss="modal"
aria-label="Close"
>
<i aria-hidden="true" class="ki ki-close"></i>
</button>
}
templ DeleteConfirmationBodyGroupResult(inputId models.CustomTextFieldv2Prm,
componentID string,
message string,
datHeader []string,
dataText []string,
hxOnLoad templ.ComponentScript) {
<div id={ componentID } hx-on::load={ hxOnLoad }>
<p>{ message }</p>
<div class="card rounded-lg">
<div class="card-body d-flex flex-row">
<div class="d-flex flex-column">
for _, v := range datHeader {
<div class="mb-1 mt-1 text-disabled font-weight-bold mr-5">{ v }</div>
}
</div>
<div class="d-flex flex-column ">
for _, v := range dataText {
<div class="mb-1 mt-1 font-weight-bold">
{ v }
</div>
}
</div>
</div>
</div>
@customtextfield.CustomTextFieldv2(inputId)
</div>
}
templ ActionFormGroupResultDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
<div>
<button
hx-on::after-request={ JsHideModalGroupResult(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>
}

View File

@@ -1,673 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdgroupresultview
//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"
import "cpone/component/customdropdown"
func GroupResultForm(data models.GroupResultFormComponent) 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\mdgroupresult\mdgroupresultformmodal.templ`, Line: 12, Col: 24}
}
_, 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\mdgroupresult\mdgroupresultformmodal.templ`, Line: 13, Col: 22}
}
_, 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\mdgroupresult\mdgroupresultformmodal.templ`, Line: 15, Col: 28}
}
_, 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\mdgroupresult\mdgroupresultformmodal.templ`, Line: 16, Col: 24}
}
_, 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\mdgroupresult\mdgroupresultformmodal.templ`, Line: 17, Col: 30}
}
_, 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
}
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 = 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_2922`,
Function: `function __templ_HandleFormBeforeRequest_2922(){console.log("handle disable btn add");
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
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_2922`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_2922`),
}
}
func HandleFormAfterRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormAfterRequest_956b`,
Function: `function __templ_HandleFormAfterRequest_956b(){console.log("handle enable btn add");
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_HandleFormAfterRequest_956b`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_956b`),
}
}
func BodyFormGroupResult(inputId models.CustomTextFieldv2Prm,
inputGrName models.CustomTextFieldv2Prm,
checkboxGrFlagPerTest models.CustomCheckboxv1Prm,
checkboxGrFlagNonLab models.CustomCheckboxv1Prm,
dropdownGrResumeMcu models.CustomDropdownv1Prm,
listItem templ.Component,
componentID 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_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\mdgroupresult\mdgroupresultformmodal.templ`, Line: 71, Col: 22}
}
_, 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 = customtextfield.CustomTextFieldv2(
inputGrName).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customcheckbox.MainCustomCheckboxInput(
checkboxGrFlagPerTest).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mt-5\"></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customcheckbox.MainCustomCheckboxInput(
checkboxGrFlagNonLab).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mt-5\"></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customdropdown.MainCustomDropdownInput(
dropdownGrResumeMcu,
listItem).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 // Reinitialize selectpicker after HTMX content swap\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 JsHideModalGroupResult(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JsHideModalGroupResult_da6c`,
Function: `function __templ_JsHideModalGroupResult_da6c(modalID){$(modalID).modal('hide')
}`,
Call: templ.SafeScript(`__templ_JsHideModalGroupResult_da6c`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsHideModalGroupResult_da6c`, modalID),
}
}
func JsShowModalGroupResult(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JsShowModalGroupResult_b74d`,
Function: `function __templ_JsShowModalGroupResult_b74d(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_JsShowModalGroupResult_b74d`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsShowModalGroupResult_b74d`, modalID),
}
}
func ActionFormGroupResult(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, JsHideModalGroupResult(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 = JsHideModalGroupResult(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\mdgroupresult\mdgroupresultformmodal.templ`, Line: 118, Col: 22}
}
_, 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\mdgroupresult\mdgroupresultformmodal.templ`, Line: 119, Col: 26}
}
_, 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\mdgroupresult\mdgroupresultformmodal.templ`, Line: 120, Col: 24}
}
_, 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 BtnCloseFormGroupResult(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, JsHideModalGroupResult(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\mdgroupresult\mdgroupresultformmodal.templ`, Line: 141, Col: 21}
}
_, 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\mdgroupresult\mdgroupresultformmodal.templ`, Line: 142, Col: 25}
}
_, 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\mdgroupresult\mdgroupresultformmodal.templ`, Line: 143, Col: 23}
}
_, 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 = JsHideModalGroupResult(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 DeleteConfirmationBodyGroupResult(inputId models.CustomTextFieldv2Prm,
componentID string,
message string,
datHeader []string,
dataText []string,
hxOnLoad templ.ComponentScript) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var22 := templ.GetChildren(ctx)
if templ_7745c5c3_Var22 == nil {
templ_7745c5c3_Var22 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxOnLoad)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 160, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var24 templ.ComponentScript = hxOnLoad
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(message)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 161, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p><div class=\"card rounded-lg\"><div class=\"card-body d-flex flex-row\"><div class=\"d-flex flex-column\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range datHeader {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 text-disabled font-weight-bold mr-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 166, Col: 68}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"d-flex flex-column \">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range dataText {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 font-weight-bold\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 172, Col: 10}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputId).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func ActionFormGroupResultDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var28 := templ.GetChildren(ctx)
if templ_7745c5c3_Var28 == nil {
templ_7745c5c3_Var28 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModalGroupResult(modalID))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var29 templ.ComponentScript = JsHideModalGroupResult(modalID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 186, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 187, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 188, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" 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
})
}

View File

@@ -1,131 +0,0 @@
package dev_mdgroupresultview
import "cpone/component/table"
import "cpone/models"
import "strconv"
templ TableGroupResult(data []models.GroupResult,
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{"GROUP RESULT NAME", "RESULT FLAG PER TEST", "RESULT FLAG NON LAB", "RESULT RESUME MCU", "AKSI"},
[]string{"20%", "20%", "20%", "20%", "20%"},
RowGroupResult(data,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
))
</div>
}
templ RowGroupResult(data []models.GroupResult,
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.Group_ResultName }</td>
<td>{ v.Group_ResultFlagPerTest }</td>
<td>{ v.Group_ResultFlagNonLab }</td>
<td>{ v.Group_ResultResumeMcu }</td>
<td>
@TableAction(v.Group_ResultID,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
)
</td>
</tr>
}
}
templ TableAction(
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="btnactiongr 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=" btnactiongr 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('btnactiongr');
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('btnactiongr');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.remove('disabled');
}
console.log(id)
}

View File

@@ -1,464 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdgroupresultview
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import "cpone/component/table"
import "cpone/models"
import "strconv"
func TableGroupResult(data []models.GroupResult,
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_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(tableID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 18, Col: 18}
}
_, 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\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"GROUP RESULT NAME", "RESULT FLAG PER TEST", "RESULT FLAG NON LAB", "RESULT RESUME MCU", "AKSI"},
[]string{"20%", "20%", "20%", "20%", "20%"},
RowGroupResult(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 RowGroupResult(data []models.GroupResult,
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.Group_ResultName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 51, Col: 27}
}
_, 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.Group_ResultFlagPerTest)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 52, Col: 34}
}
_, 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
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.Group_ResultFlagNonLab)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 53, Col: 33}
}
_, 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("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(v.Group_ResultResumeMcu)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 54, Col: 32}
}
_, 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("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = TableAction(v.Group_ResultID,
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 TableAction(
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_Var8 := templ.GetChildren(ctx)
if templ_7745c5c3_Var8 == nil {
templ_7745c5c3_Var8 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row px-5 d-flex justify-content-around\">")
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=\"btnactiongr 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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, 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\mdgroupresult\mdgroupresulttable.templ`, Line: 87, Col: 49}
}
_, 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(hxTargetEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 88, Col: 27}
}
_, 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(hxSwapEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 89, Col: 23}
}
_, 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-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 90, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\"")
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\mdgroupresult\mdgroupresulttable.templ`, Line: 91, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
_, 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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs("spnredt" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 95, Col: 42}
}
_, 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("\" 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=\" btnactiongr 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_Var17 string
templ_7745c5c3_Var17, 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\mdgroupresult\mdgroupresulttable.templ`, Line: 101, Col: 51}
}
_, 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-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 102, Col: 29}
}
_, 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(hxSwapDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 103, Col: 25}
}
_, 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-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 104, Col: 31}
}
_, 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-indicator=\"")
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\mdgroupresult\mdgroupresulttable.templ`, Line: 105, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var22 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(id))
_, 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("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23.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_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs("spnrdel" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 109, Col: 42}
}
_, 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("\" class=\"htmx-indicator spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span> Hapus\r</a></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 HandleBeforeRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleBeforeRequestRow_8869`,
Function: `function __templ_HandleBeforeRequestRow_8869(id){var cusid_ele = document.getElementsByClassName('btnactiongr');
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_8869`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleBeforeRequestRow_8869`, id),
}
}
func HandleAfterRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleAfterRequestRow_ef01`,
Function: `function __templ_HandleAfterRequestRow_ef01(id){var cusid_ele = document.getElementsByClassName('btnactiongr');
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_ef01`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleAfterRequestRow_ef01`, id),
}
}

View File

@@ -1,212 +0,0 @@
package dev_mdnatunitview
import (
"cpone/layout"
"cpone/component/customtextfield"
"cpone/models"
)
templ MdNatUnitScreen(
tableID string,
paginationID string,
searchID string,
dialogAddID string,
dialogAddBodyID string,
dialogEditID string,
dialogEditBodyID string,
dialogDeleteID string,
dialogDeleteBodyID string,
breadcrumb templ.Component,
tablecontent templ.Component,
filterComponent templ.Component,
paginationComponent templ.Component,
modalAddForm templ.Component,
modalEditForm templ.Component,
modalDeleteForm templ.Component) {
<div class="container-fluid">
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
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",
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})
<div class="row align-items-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-block align-items-center">
<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>
@filterComponent
<div id="loading-parent" class=" rounded">
@tablecontent
@paginationComponent
@modalAddForm
@modalEditForm
@modalDeleteForm
<div id="loading-child" class=" rounded bg-transparent">
// <div class="spinner spinner-lg spinner-primary"></div>
<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>
}
templ CssMdNatUnit() {
<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; */
}
#div-chart {
/* overflow-x: scroll; */
margin: 40px 10vw 40px 10vw;
}
.title {
font-size:20px;
font-weight: bold;
}
#title {
font-weight: 600;
}
</style>
}
templ JsMdNatUnit() {
<script>
function onLoadingStart() {
// const loadingParent = document.getElementById("loading-parent");
// const loadingChild = document.getElementById("loading-child");
// const loadingSpinner = document.getElementById("loading-spinner");
// loadingParent.classList.add("overlay");
// loadingParent.classList.add("overlay-block");
// loadingChild.classList.add("overlay-layer");
// loadingSpinner.classList.remove("d-none");
// Additional logic when loading starts
}
function onLoadingEnd() {
console.log('Loading ended');
// 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");
}
document.addEventListener('htmx:beforeRequest', function(event) {
var indicator = document.querySelector('#loadingcontent');
console.log(event.detail.xhr)
console.log(event.detail.elt)
if (indicator) {
onLoadingStart();
}
});
document.addEventListener('htmx:afterRequest', function(event) {
var indicator = document.querySelector('#loadingcontent');
if (indicator) {
onLoadingEnd();
}
});
</script>
}
script BeforeRequestContent() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}
script AfterRequestContent() {
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");
}
templ ShowMdNatUnitScreen(title string, cmp templ.Component, css templ.Component, js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,
userprofile templ.Component) {
@layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile) {
@cmp
}
}

View File

@@ -1,314 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdnatunitview
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import (
"cpone/component/customtextfield"
"cpone/layout"
"cpone/models"
)
func MdNatUnitScreen(
tableID string,
paginationID string,
searchID string,
dialogAddID string,
dialogAddBodyID string,
dialogEditID string,
dialogEditBodyID string,
dialogDeleteID string,
dialogDeleteBodyID string,
breadcrumb templ.Component,
tablecontent templ.Component,
filterComponent templ.Component,
paginationComponent templ.Component,
modalAddForm templ.Component,
modalEditForm templ.Component,
modalDeleteForm templ.Component) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
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=\"container-fluid\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
Name: "tableID",
Type: "hidden",
Value: tableID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID",
Name: "paginationID",
Type: "hidden",
Value: paginationID}).Render(ctx, templ_7745c5c3_Buffer)
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 = templ_7745c5c3_Buffer.WriteString("<div class=\"row align-items-center mb-10\"><div class=\"col-md-10 col-sm-12 p-0 \">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = breadcrumb.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-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\mdnatunit\mdnatunit.templ`, Line: 74, Col: 37}
}
_, 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</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\mdnatunit\mdnatunit.templ`, Line: 83, Col: 36}
}
_, 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</button></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = filterComponent.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, 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 = tablecontent.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
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 = modalEditForm.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 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
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func CssMdNatUnit() 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_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = 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>")
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 JsMdNatUnit() 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("<script>\r\n function onLoadingStart() {\r\n // const loadingParent = document.getElementById(\"loading-parent\");\r\n\t\t\t// const loadingChild = document.getElementById(\"loading-child\");\r\n\t\t\t// const loadingSpinner = document.getElementById(\"loading-spinner\");\r\n\r\n\t\t\t// loadingParent.classList.add(\"overlay\");\r\n\t\t\t// loadingParent.classList.add(\"overlay-block\");\r\n\t\t\t// loadingChild.classList.add(\"overlay-layer\");\r\n\t\t\t// loadingSpinner.classList.remove(\"d-none\");\r\n\r\n // Additional logic when loading starts\r\n }\r\n\r\n function onLoadingEnd() {\r\n console.log('Loading ended');\r\n // const loadingParent = document.getElementById(\"loading-parent\");\r\n\t\t\t// const loadingChild = document.getElementById(\"loading-child\");\r\n\t\t\t// const loadingSpinner = document.getElementById(\"loading-spinner\");\r\n\r\n\t\t\t// loadingParent.classList.remove(\"overlay\");\r\n\t\t\t// loadingParent.classList.remove(\"overlay-block\");\r\n\t\t\t// loadingChild.classList.remove(\"overlay-layer\");\r\n\t\t\t// loadingSpinner.classList.add(\"d-none\");\r\n }\r\n\r\n document.addEventListener('htmx:beforeRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n\t\t\tconsole.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.elt)\r\n if (indicator) {\r\n onLoadingStart();\r\n }\r\n });\r\n\r\n document.addEventListener('htmx:afterRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n if (indicator) {\r\n onLoadingEnd();\r\n }\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 BeforeRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_BeforeRequestContent_911f`,
Function: `function __templ_BeforeRequestContent_911f(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}`,
Call: templ.SafeScript(`__templ_BeforeRequestContent_911f`),
CallInline: templ.SafeScriptInline(`__templ_BeforeRequestContent_911f`),
}
}
func AfterRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_AfterRequestContent_6cc0`,
Function: `function __templ_AfterRequestContent_6cc0(){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");
}`,
Call: templ.SafeScript(`__templ_AfterRequestContent_6cc0`),
CallInline: templ.SafeScriptInline(`__templ_AfterRequestContent_6cc0`),
}
}
func ShowMdNatUnitScreen(title string, cmp templ.Component, css templ.Component, js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,
userprofile 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_Var6 := templ.GetChildren(ctx)
if templ_7745c5c3_Var6 == nil {
templ_7745c5c3_Var6 = 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_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
templ_7745c5c3_Err = cmp.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer)
}
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)
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
})
}

View File

@@ -1,187 +0,0 @@
package dev_mdnatunitview
import "cpone/models"
import "cpone/component/modal"
import "cpone/component/customtextfield"
templ NatUnitForm(data models.NatUnitFormComponent) {
<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() }
>
@modalcomponent.Modal(data.ModalID,
data.ModalTitle,
data.DialogBody,
data.DialogAction,
data.ButtonCLose)
</form>
</div>
}
script HandleFormBeforeRequest() {
console.log("handle disable btn add");
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
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() {
console.log("handle enable btn add");
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 BodyFormNatUnit(inputId models.CustomTextFieldv2Prm,
inputCode models.CustomTextFieldv2Prm,
inputName models.CustomTextFieldv2Prm,
componentID string,
hxOnLoad templ.ComponentScript) {
<div id={ componentID } hx-on::load={ hxOnLoad }>
@customtextfield.CustomTextFieldv2(
inputId)
@customtextfield.CustomTextFieldv2(
inputCode)
@customtextfield.CustomTextFieldv2(
inputName)
</div>
}
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 ActionFormNatUnit(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 BtnCloseFormNatUnit(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 DeleteConfirmationBody(inputId models.CustomTextFieldv2Prm,
componentID string,
message string,
datHeader []string,
dataText []string,
hxOnLoad templ.ComponentScript) {
<div id={ componentID } hx-on::load={ hxOnLoad }>
<p>{ message }</p>
<div class="card rounded-lg">
<div class="card-body d-flex flex-row">
<div class="d-flex flex-column">
for _, v := range datHeader {
<div class="mb-1 mt-1 text-disabled font-weight-bold mr-5">{ v }</div>
}
</div>
<div class="d-flex flex-column ">
for _, v := range dataText {
<div class="mb-1 mt-1 font-weight-bold">
{ v }
</div>
}
</div>
</div>
</div>
@customtextfield.CustomTextFieldv2(inputId)
</div>
}
templ ActionFormUserGroupDelete(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>
}

View File

@@ -1,649 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdnatunitview
//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"
func NatUnitForm(data models.NatUnitFormComponent) 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\mdnatunit\mdnatunitformmodal.templ`, Line: 10, Col: 24}
}
_, 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\mdnatunit\mdnatunitformmodal.templ`, Line: 11, Col: 22}
}
_, 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\mdnatunit\mdnatunitformmodal.templ`, Line: 13, Col: 28}
}
_, 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\mdnatunit\mdnatunitformmodal.templ`, Line: 14, Col: 24}
}
_, 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\mdnatunit\mdnatunitformmodal.templ`, Line: 15, Col: 30}
}
_, 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
}
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 = 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_2922`,
Function: `function __templ_HandleFormBeforeRequest_2922(){console.log("handle disable btn add");
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
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_2922`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_2922`),
}
}
func HandleFormAfterRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormAfterRequest_956b`,
Function: `function __templ_HandleFormAfterRequest_956b(){console.log("handle enable btn add");
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_HandleFormAfterRequest_956b`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_956b`),
}
}
func BodyFormNatUnit(inputId models.CustomTextFieldv2Prm,
inputCode models.CustomTextFieldv2Prm,
inputName models.CustomTextFieldv2Prm,
componentID 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_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\mdnatunit\mdnatunitformmodal.templ`, Line: 66, Col: 22}
}
_, 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 = customtextfield.CustomTextFieldv2(
inputCode).Render(ctx, templ_7745c5c3_Buffer)
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>")
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_da6c`,
Function: `function __templ_JsHideModal_da6c(modalID){$(modalID).modal('hide')
}`,
Call: templ.SafeScript(`__templ_JsHideModal_da6c`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsHideModal_da6c`, modalID),
}
}
func JsShowModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JsShowModal_b74d`,
Function: `function __templ_JsShowModal_b74d(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_b74d`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsShowModal_b74d`, modalID),
}
}
func ActionFormNatUnit(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\mdnatunit\mdnatunitformmodal.templ`, Line: 100, Col: 22}
}
_, 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\mdnatunit\mdnatunitformmodal.templ`, Line: 101, Col: 26}
}
_, 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\mdnatunit\mdnatunitformmodal.templ`, Line: 102, Col: 24}
}
_, 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 BtnCloseFormNatUnit(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\mdnatunit\mdnatunitformmodal.templ`, Line: 123, Col: 21}
}
_, 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\mdnatunit\mdnatunitformmodal.templ`, Line: 124, Col: 25}
}
_, 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\mdnatunit\mdnatunitformmodal.templ`, Line: 125, Col: 23}
}
_, 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 DeleteConfirmationBody(inputId models.CustomTextFieldv2Prm,
componentID string,
message string,
datHeader []string,
dataText []string,
hxOnLoad templ.ComponentScript) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var22 := templ.GetChildren(ctx)
if templ_7745c5c3_Var22 == nil {
templ_7745c5c3_Var22 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxOnLoad)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunitformmodal.templ`, Line: 142, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var24 templ.ComponentScript = hxOnLoad
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(message)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunitformmodal.templ`, Line: 143, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p><div class=\"card rounded-lg\"><div class=\"card-body d-flex flex-row\"><div class=\"d-flex flex-column\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range datHeader {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 text-disabled font-weight-bold mr-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunitformmodal.templ`, Line: 148, Col: 68}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"d-flex flex-column \">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range dataText {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 font-weight-bold\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunitformmodal.templ`, Line: 154, Col: 10}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputId).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func ActionFormUserGroupDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var28 := templ.GetChildren(ctx)
if templ_7745c5c3_Var28 == nil {
templ_7745c5c3_Var28 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModal(modalID))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var29 templ.ComponentScript = JsHideModal(modalID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunitformmodal.templ`, Line: 168, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunitformmodal.templ`, Line: 169, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunitformmodal.templ`, Line: 170, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" 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
})
}

View File

@@ -1,130 +0,0 @@
package dev_mdnatunitview
import (
"cpone/component/table"
"cpone/models"
"strconv"
)
templ TableNatUnit(data []models.NatUnit,
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{"KODE", "UNIT", "AKSI"},
[]string{"40%", "40%", "20%"},
RowNatUnit(data,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
))
</div>
}
templ RowNatUnit(data []models.NatUnit,
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.Nat_UnitCode }</td>
<td>{ v.Nat_UnitName }</td>
<td>
@TableAction(v.Nat_UnitID,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
)
</td>
</tr>
}
}
templ TableAction(
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="btnactionug 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=" btnactionug 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('btnactionug');
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('btnactionug');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.remove('disabled');
}
// console.log(id)
}

View File

@@ -1,439 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdnatunitview
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import (
"cpone/component/table"
"cpone/models"
"strconv"
)
func TableNatUnit(data []models.NatUnit,
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_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(tableID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 20, Col: 18}
}
_, 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\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"KODE", "UNIT", "AKSI"},
[]string{"40%", "40%", "20%"},
RowNatUnit(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 RowNatUnit(data []models.NatUnit,
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.Nat_UnitCode)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 53, Col: 23}
}
_, 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.Nat_UnitName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 54, Col: 23}
}
_, 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 = TableAction(v.Nat_UnitID,
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 TableAction(
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_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\">")
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=\"btnactionug 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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetEdit + "?id=" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 86, Col: 49}
}
_, 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(hxTargetEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 87, Col: 27}
}
_, 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(hxSwapEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 88, Col: 23}
}
_, 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(hxIncludeEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 89, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs("#spnredt" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 90, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(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("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
_, 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("\"><span id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs("spnredt" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 94, 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("\" 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=\" btnactionug 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_Var15 string
templ_7745c5c3_Var15, 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\mdnatunit\mdnatunittable.templ`, Line: 100, Col: 51}
}
_, 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(hxTargetDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 101, Col: 29}
}
_, 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(hxSwapDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 102, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 103, Col: 31}
}
_, 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-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs("#spnrdel" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 104, Col: 47}
}
_, 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-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var20.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_Var21 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
_, 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("\"><span id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var22 string
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs("spnrdel" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnatunit\mdnatunittable.templ`, Line: 108, Col: 42}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"htmx-indicator spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span> Hapus\r</a></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 HandleBeforeRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleBeforeRequestRow_9a4e`,
Function: `function __templ_HandleBeforeRequestRow_9a4e(id){var cusid_ele = document.getElementsByClassName('btnactionug');
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_9a4e`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleBeforeRequestRow_9a4e`, id),
}
}
func HandleAfterRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleAfterRequestRow_9e81`,
Function: `function __templ_HandleAfterRequestRow_9e81(id){var cusid_ele = document.getElementsByClassName('btnactionug');
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_9e81`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleAfterRequestRow_9e81`, id),
}
}

View File

@@ -0,0 +1,101 @@
package dev_mdsamplestationview
import (
"cpone/layout"
"cpone/component/customtextfield"
"cpone/models"
)
templ ContentMDSampleStation(
tableID string,
dialogAddID string,
paginationID string,
breadcrumb templ.Component,
tablecontent templ.Component,
paginationtable 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: "dialogAddID",
Name: "dialogAddID",
Type: "hidden",
Value: dialogAddID})
<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>
@tablecontent
@paginationtable
</div>
}
templ CSSMDSampleStation() {
<linl
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;
}
#div-chart {
margin: 40px 10vw 40px 10vw;
}
.title {
font-size: 20px;
font-weight: bold;
}
#title {
font-weight: 600;
}
</style>
}
templ JSMDSampleStation() {
}
templ ShowMDSampleStation(
title string,
cmp templ.Component,
css templ.Component,
js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,
userprofile templ.Component) {
@layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile) {
@cmp
}
}

View File

@@ -0,0 +1,209 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdsamplestationview
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import (
"cpone/component/customtextfield"
"cpone/layout"
"cpone/models"
)
func ContentMDSampleStation(
tableID string,
dialogAddID string,
paginationID string,
breadcrumb templ.Component,
tablecontent templ.Component,
paginationtable templ.Component,
) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"container-fluid\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
Name: "tableID",
Type: "hidden",
Value: tableID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID",
Name: "paginationID",
Type: "hidden",
Value: paginationID}).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 = 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
}
templ_7745c5c3_Err = breadcrumb.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-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\mdsamplestation\mdsamplestation.templ`, Line: 40, 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</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\mdsamplestation\mdsamplestation.templ`, Line: 48, 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</button></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecontent.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = paginationtable.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 CSSMDSampleStation() 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_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
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>")
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 JSMDSampleStation() 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)
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func ShowMDSampleStation(
title string,
cmp templ.Component,
css templ.Component,
js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,
userprofile 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_Var6 := templ.GetChildren(ctx)
if templ_7745c5c3_Var6 == nil {
templ_7745c5c3_Var6 = 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_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
templ_7745c5c3_Err = cmp.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer)
}
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)
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
})
}

View File

@@ -0,0 +1,51 @@
package dev_mdsamplestationview
import "cpone/models"
import "cpone/component/table"
templ TableSampleStation(data []models.MDSampleStation, tableID string) {
<div id={ tableID } hx-swab-oob="true">
@tablecomponent.TableV3([]string{"KODE", "NAMA STATION", "GROUP", "AKSI"},
[]string{"20%", "30%", "30%", "20%"},
ItemRow(data))
</div>
}
templ ItemRow(data []models.MDSampleStation) {
if len(data) == 0 {
<tr>
<td colspan="4" class="text-center">Data Tidak Ditemukan</td>
</tr>
}
for _, v := range data {
<tr>
<td>{ v.T_SampleStationCode }</td>
<td>{ v.T_SampleStationName }</td>
<td>{ v.T_SampleStationIsNonLab }</td>
<td>
@ItemAction()
</td>
</tr>
}
}
templ ItemAction() {
<div class="row px-5 d-flex justify-content-around">
<a
id="btneditss"
type="button"
class="btneditss col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2"
hx-get=""
hx-target=""
hx-swap=""
hx-include="">Edit</a>
<a
id="btndeletess"
type="button"
class="btndeletess col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2"
hx-get=""
hx-target=""
hx-swap=""
hx-include="">Hapus</a>
</div>
}

View File

@@ -0,0 +1,164 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdsamplestationview
//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/table"
func TableSampleStation(data []models.MDSampleStation, tableID string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(tableID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 7, Col: 21}
}
_, 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-swab-oob=\"true\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"KODE", "NAMA STATION", "GROUP", "AKSI"},
[]string{"20%", "30%", "30%", "20%"},
ItemRow(data)).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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 ItemRow(data []models.MDSampleStation) 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=\"4\" 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.T_SampleStationCode)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 22, Col: 39}
}
_, 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.T_SampleStationName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 23, Col: 39}
}
_, 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
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.T_SampleStationIsNonLab)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 24, Col: 43}
}
_, 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("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ItemAction().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 ItemAction() 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 class=\"row px-5 d-flex justify-content-around\"><a id=\"btneditss\" type=\"button\" class=\"btneditss col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2\" hx-get=\"\" hx-target=\"\" hx-swap=\"\" hx-include=\"\">Edit</a> <a id=\"btndeletess\" type=\"button\" class=\"btndeletess col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2\" hx-get=\"\" hx-target=\"\" hx-swap=\"\" hx-include=\"\">Hapus</a></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
})
}

View File

@@ -85,20 +85,11 @@ templ MdUserGroupScreen(
</div>
</div>
@filterComponent
<div id="loading-parent" class=" rounded">
@tablecontent
@paginationComponent
@modalAddForm
@modalEditForm
@modalDeleteForm
<div id="loading-child" class=" rounded bg-transparent">
// <div class="spinner spinner-lg spinner-primary"></div>
<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>
@tablecontent
@paginationComponent
@modalAddForm
@modalEditForm
@modalDeleteForm
</div>
}
@@ -137,70 +128,6 @@ templ CssMdUserGroup() {
}
templ JsMdUserGroup() {
<script>
function onLoadingStart() {
// const loadingParent = document.getElementById("loading-parent");
// const loadingChild = document.getElementById("loading-child");
// const loadingSpinner = document.getElementById("loading-spinner");
// loadingParent.classList.add("overlay");
// loadingParent.classList.add("overlay-block");
// loadingChild.classList.add("overlay-layer");
// loadingSpinner.classList.remove("d-none");
// Additional logic when loading starts
}
function onLoadingEnd() {
console.log('Loading ended');
// 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");
}
document.addEventListener('htmx:beforeRequest', function(event) {
var indicator = document.querySelector('#loadingcontent');
console.log(event.detail.xhr)
console.log(event.detail.elt)
if (indicator) {
onLoadingStart();
}
});
document.addEventListener('htmx:afterRequest', function(event) {
var indicator = document.querySelector('#loadingcontent');
if (indicator) {
onLoadingEnd();
}
});
</script>
}
script BeforeRequestContent() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}
script AfterRequestContent() {
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");
}
templ ShowMdUserGroupScreen(title string, cmp templ.Component, css templ.Component, js templ.Component,

View File

@@ -154,10 +154,6 @@ func MdUserGroupScreen(
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, 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 = tablecontent.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
@@ -178,7 +174,7 @@ func MdUserGroupScreen(
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-child\" class=\" rounded bg-transparent\"><div id=\"loading-spinner\" class=\"spinner-border text-primary d-none\" style=\"width: 3rem; height: 3rem;\" role=\"status\"><span class=\"sr-only\">Loading...</span></div></div></div><div id=\"loadingcontent\"></div></div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -226,10 +222,6 @@ func JsMdUserGroup() templ.Component {
templ_7745c5c3_Var5 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script>\r\n function onLoadingStart() {\r\n // const loadingParent = document.getElementById(\"loading-parent\");\r\n\t\t\t// const loadingChild = document.getElementById(\"loading-child\");\r\n\t\t\t// const loadingSpinner = document.getElementById(\"loading-spinner\");\r\n\r\n\t\t\t// loadingParent.classList.add(\"overlay\");\r\n\t\t\t// loadingParent.classList.add(\"overlay-block\");\r\n\t\t\t// loadingChild.classList.add(\"overlay-layer\");\r\n\t\t\t// loadingSpinner.classList.remove(\"d-none\");\r\n\r\n // Additional logic when loading starts\r\n }\r\n\r\n function onLoadingEnd() {\r\n console.log('Loading ended');\r\n // const loadingParent = document.getElementById(\"loading-parent\");\r\n\t\t\t// const loadingChild = document.getElementById(\"loading-child\");\r\n\t\t\t// const loadingSpinner = document.getElementById(\"loading-spinner\");\r\n\r\n\t\t\t// loadingParent.classList.remove(\"overlay\");\r\n\t\t\t// loadingParent.classList.remove(\"overlay-block\");\r\n\t\t\t// loadingChild.classList.remove(\"overlay-layer\");\r\n\t\t\t// loadingSpinner.classList.add(\"d-none\");\r\n }\r\n\r\n document.addEventListener('htmx:beforeRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n\t\t\tconsole.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.elt)\r\n if (indicator) {\r\n onLoadingStart();\r\n }\r\n });\r\n\r\n document.addEventListener('htmx:afterRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n if (indicator) {\r\n onLoadingEnd();\r\n }\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)
}
@@ -237,40 +229,6 @@ func JsMdUserGroup() templ.Component {
})
}
func BeforeRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_BeforeRequestContent_911f`,
Function: `function __templ_BeforeRequestContent_911f(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}`,
Call: templ.SafeScript(`__templ_BeforeRequestContent_911f`),
CallInline: templ.SafeScriptInline(`__templ_BeforeRequestContent_911f`),
}
}
func AfterRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_AfterRequestContent_6cc0`,
Function: `function __templ_AfterRequestContent_6cc0(){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");
}`,
Call: templ.SafeScript(`__templ_AfterRequestContent_6cc0`),
CallInline: templ.SafeScriptInline(`__templ_AfterRequestContent_6cc0`),
}
}
func ShowMdUserGroupScreen(title string, cmp templ.Component, css templ.Component, js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,

View File

@@ -13,7 +13,6 @@ templ UserGroupForm(data models.UserGroupFormComponent) {
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() }
>
@@ -28,15 +27,10 @@ templ UserGroupForm(data models.UserGroupFormComponent) {
script HandleFormBeforeRequest() {
console.log("handle disable btn add");
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
const boxes = document.querySelectorAll('.btnaddact');
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');
for (let i = 0; i < boxes.length; i++) {
boxes[i].setAttribute('disabled', 'true');
}
}
@@ -44,16 +38,10 @@ script HandleFormBeforeRequest() {
script HandleFormAfterRequest() {
console.log("handle enable btn add");
const btnactcancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
const boxes = document.querySelectorAll('.btnaddact');
for (let i = 0; i < btnactcancel.length; i++) {
btnactcancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].removeAttribute('disabled');
for (let i = 0; i < boxes.length; i++) {
boxes[i].removeAttribute('disabled');
}
}
@@ -79,18 +67,6 @@ script JsHideModal(modalID string) {
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 ActionFormUserGroup(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
@@ -100,19 +76,16 @@ templ ActionFormUserGroup(LinkClose string, targetClose string, hxSwapClose stri
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 "
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnaddact"
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"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact"
>
<span class="htmx-indicator spinner-border spinner-border-sm formloading" role="status" aria-hidden="true"></span>
Simpan
</button>
</div>
@@ -125,7 +98,7 @@ templ BtnCloseFormUserGroup(LinkClose string, targetClose string, hxSwapClose st
hx-swap={ hxSwapClose }
type="button"
hx-on::after-request={ JsHideModal(modalID) }
class="close btnactcancel"
class="close btnaddact"
data-dismiss="modal"
aria-label="Close"
>
@@ -168,19 +141,16 @@ templ ActionFormUserGroupDelete(LinkClose string, targetClose string, hxSwapClos
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"
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnaddact"
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"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact"
>
<span class="htmx-indicator spinner-border spinner-border-sm formloading" role="status" aria-hidden="true"></span>
Yakin
</button>
</div>

View File

@@ -100,7 +100,7 @@ func UserGroupForm(data models.UserGroupFormComponent) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\".formloading\" hx-on::before-request=\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -143,45 +143,34 @@ func UserGroupForm(data models.UserGroupFormComponent) templ.Component {
func HandleFormBeforeRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormBeforeRequest_2922`,
Function: `function __templ_HandleFormBeforeRequest_2922(){console.log("handle disable btn add");
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
Name: `__templ_HandleFormBeforeRequest_1e3f`,
Function: `function __templ_HandleFormBeforeRequest_1e3f(){console.log("handle disable btn add");
const boxes = document.querySelectorAll('.btnaddact');
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');
for (let i = 0; i < boxes.length; i++) {
boxes[i].setAttribute('disabled', 'true');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_2922`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_2922`),
Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_1e3f`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_1e3f`),
}
}
func HandleFormAfterRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormAfterRequest_956b`,
Function: `function __templ_HandleFormAfterRequest_956b(){console.log("handle enable btn add");
Name: `__templ_HandleFormAfterRequest_ee07`,
Function: `function __templ_HandleFormAfterRequest_ee07(){console.log("handle enable btn add");
const btnactcancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
const boxes = document.querySelectorAll('.btnaddact');
for (let i = 0; i < btnactcancel.length; i++) {
btnactcancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].removeAttribute('disabled');
for (let i = 0; i < boxes.length; i++) {
boxes[i].removeAttribute('disabled');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormAfterRequest_956b`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_956b`),
Call: templ.SafeScript(`__templ_HandleFormAfterRequest_ee07`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_ee07`),
}
}
@@ -213,7 +202,7 @@ func BodyFormUserGroup(inputId models.CustomTextFieldv2Prm,
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\mdusergroup\mdusergroupformmodal.templ`, Line: 66, Col: 22}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 54, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
@@ -270,23 +259,11 @@ func JsHideModal(modalID string) templ.ComponentScript {
func JsShowModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JsShowModal_b74d`,
Function: `function __templ_JsShowModal_b74d(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');
}
Name: `__templ_JsShowModal_3147`,
Function: `function __templ_JsShowModal_3147(modalID){$(modalID).modal('show')
}`,
Call: templ.SafeScript(`__templ_JsShowModal_b74d`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsShowModal_b74d`, modalID),
Call: templ.SafeScript(`__templ_JsShowModal_3147`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsShowModal_3147`, modalID),
}
}
@@ -327,7 +304,7 @@ func ActionFormUserGroup(LinkClose string, targetClose string, hxSwapClose strin
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\mdusergroup\mdusergroupformmodal.templ`, Line: 100, Col: 22}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 76, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
@@ -340,7 +317,7 @@ func ActionFormUserGroup(LinkClose string, targetClose string, hxSwapClose strin
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\mdusergroup\mdusergroupformmodal.templ`, Line: 101, Col: 26}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 77, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
@@ -353,13 +330,13 @@ func ActionFormUserGroup(LinkClose string, targetClose string, hxSwapClose strin
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\mdusergroup\mdusergroupformmodal.templ`, Line: 102, Col: 24}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 78, Col: 24}
}
_, 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>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnaddact\" data-dismiss=\"modal\">Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact\">Simpan\r</button></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -394,7 +371,7 @@ func BtnCloseFormUserGroup(LinkClose string, targetClose string, hxSwapClose str
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\mdusergroup\mdusergroupformmodal.templ`, Line: 123, Col: 21}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 96, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
@@ -407,7 +384,7 @@ func BtnCloseFormUserGroup(LinkClose string, targetClose string, hxSwapClose str
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\mdusergroup\mdusergroupformmodal.templ`, Line: 124, Col: 25}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 97, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
@@ -420,7 +397,7 @@ func BtnCloseFormUserGroup(LinkClose string, targetClose string, hxSwapClose str
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\mdusergroup\mdusergroupformmodal.templ`, Line: 125, Col: 23}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 98, Col: 23}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
@@ -435,7 +412,7 @@ func BtnCloseFormUserGroup(LinkClose string, targetClose string, hxSwapClose str
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>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"close btnaddact\" 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
}
@@ -475,7 +452,7 @@ func DeleteConfirmationBody(inputId models.CustomTextFieldv2Prm,
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 142, Col: 22}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 115, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
@@ -497,7 +474,7 @@ func DeleteConfirmationBody(inputId models.CustomTextFieldv2Prm,
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(message)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 143, Col: 14}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 116, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
@@ -515,7 +492,7 @@ func DeleteConfirmationBody(inputId models.CustomTextFieldv2Prm,
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 148, Col: 68}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 121, Col: 68}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
@@ -538,7 +515,7 @@ func DeleteConfirmationBody(inputId models.CustomTextFieldv2Prm,
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 154, Col: 10}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 127, Col: 10}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
@@ -605,7 +582,7 @@ func ActionFormUserGroupDelete(LinkClose string, targetClose string, hxSwapClose
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 168, Col: 22}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 141, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
if templ_7745c5c3_Err != nil {
@@ -618,7 +595,7 @@ func ActionFormUserGroupDelete(LinkClose string, targetClose string, hxSwapClose
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 169, Col: 26}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 142, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
if templ_7745c5c3_Err != nil {
@@ -631,13 +608,13 @@ func ActionFormUserGroupDelete(LinkClose string, targetClose string, hxSwapClose
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 170, Col: 24}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 143, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" 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>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnaddact\" data-dismiss=\"modal\">Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact\">Yakin\r</button></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -80,50 +80,26 @@ templ TableAction(
) {
<div class="row px-5 d-flex justify-content-around">
<a
id="btneditug"
type="button"
class="btnactionug 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"
class="btneditug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2"
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
id="btndeleteug"
type="button"
class=" btnactionug 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"
class=" btndeleteug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2"
hx-get={ hxGetDelete + "?id=" + strconv.Itoa(id) }
hx-target={ hxTargetDelete }
hx-swap={ hxSwapDelete }
hx-include={ hxIncludeDelete }
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('btnactionug');
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('btnactionug');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.remove('disabled');
}
console.log(id)
}

View File

@@ -188,22 +188,14 @@ func TableAction(
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\">")
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=\"btnactionug 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=\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row px-5 d-flex justify-content-around\"><a id=\"btneditug\" type=\"button\" class=\"btneditug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetEdit + "?id=" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 85, Col: 49}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 86, Col: 49}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
@@ -216,7 +208,7 @@ func TableAction(
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 86, Col: 27}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 87, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
@@ -229,7 +221,7 @@ func TableAction(
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 87, Col: 23}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 88, Col: 23}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
@@ -242,87 +234,35 @@ func TableAction(
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 88, Col: 29}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 89, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">Edit\r</a> <a id=\"btndeleteug\" type=\"button\" class=\" btndeleteug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs("#spnredt" + strconv.Itoa(id))
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetDelete + "?id=" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 89, Col: 47}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 97, Col: 51}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 templ.ComponentScript = HandleBeforeRequestRow(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("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
_, 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("\"><span id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs("spnredt" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 93, 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("\" 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=\" btnactionug 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_Var15 string
templ_7745c5c3_Var15, 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\mdusergroup\mdusergrouptable.templ`, Line: 99, Col: 51}
}
_, 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(hxTargetDelete)
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 100, Col: 29}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 98, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -330,12 +270,12 @@ func TableAction(
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapDelete)
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 101, Col: 25}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 99, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -343,60 +283,16 @@ func TableAction(
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeDelete)
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 102, Col: 31}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 100, Col: 31}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
_, 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-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs("#spnrdel" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 103, Col: 47}
}
_, 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-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var20.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_Var21 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
_, 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("\"><span id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var22 string
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs("spnrdel" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 107, Col: 42}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" 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("\">Hapus\r</a></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -406,33 +302,3 @@ func TableAction(
return templ_7745c5c3_Err
})
}
func HandleBeforeRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleBeforeRequestRow_ee28`,
Function: `function __templ_HandleBeforeRequestRow_ee28(id){var cusid_ele = document.getElementsByClassName('btnactionug');
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_ee28`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleBeforeRequestRow_ee28`, id),
}
}
func HandleAfterRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleAfterRequestRow_2a96`,
Function: `function __templ_HandleAfterRequestRow_2a96(id){var cusid_ele = document.getElementsByClassName('btnactionug');
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_2a96`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleAfterRequestRow_2a96`, id),
}
}