Compare commits
9 Commits
masteruser
...
masteruser
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
983f77757f | ||
|
|
35b1daf2c5 | ||
|
|
9f6785a59e | ||
|
|
d8278b6886 | ||
|
|
4f1a9adb53 | ||
|
|
1e336517f5 | ||
|
|
37f07715ff | ||
|
|
ee42ee0a82 | ||
|
|
c66e8f5720 |
@@ -92,6 +92,7 @@
|
||||
hx-on::reponse-error="cobaerror()"
|
||||
hx-on::send-error="cobaerror()"
|
||||
id="kt_form_1"
|
||||
hx-include="#cobaid, #test"
|
||||
>
|
||||
<div id="change">
|
||||
<div class="form-group">
|
||||
@@ -131,7 +132,23 @@
|
||||
submit
|
||||
</button>
|
||||
</form>
|
||||
<input
|
||||
id="cobaid"
|
||||
name="cobaid"
|
||||
type="hidden"
|
||||
placeholder="coba"
|
||||
value="1"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
<input
|
||||
id="test"
|
||||
name="paginat"
|
||||
type="hidden"
|
||||
placeholder="coba"
|
||||
value="2"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
/>
|
||||
|
||||
<div id="testttt" class="p-6" hx-swap-oob="#testttt">
|
||||
;adkj;djf;
|
||||
@@ -144,6 +161,21 @@
|
||||
>
|
||||
Show live toast
|
||||
</button>
|
||||
<input
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
type="text"
|
||||
name="search"
|
||||
id="searchsas5b2f51246d4698262a5b7c241dd59884"
|
||||
placeholder="Cari Kode/Nama"
|
||||
hx-get="http://google.com"
|
||||
hx-trigger="input changed delay:500ms, search"
|
||||
hx-target="#cobakeyup"
|
||||
hx-indicator=""
|
||||
value=""
|
||||
hx-include="#cobaid"
|
||||
hx-swap="outerHTML"
|
||||
autocomplete="off"
|
||||
/>
|
||||
|
||||
<div
|
||||
class="position-fixed bottom-0 right-0 p-3"
|
||||
@@ -175,6 +207,43 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="cobakeyup"></div>
|
||||
<div class="card card-custom">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<h3 class="card-label">Card Blocking</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="overlay-wrapper">
|
||||
<div class="form-group">
|
||||
<label>Address Line 1</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control form-control-solid form-control-lg"
|
||||
name="address1"
|
||||
placeholder="Address Line 1"
|
||||
/>
|
||||
<span class="form-text text-muted">Please enter your Address.</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Address Line 2</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control form-control-solid form-control-lg"
|
||||
name="address1"
|
||||
placeholder="Address Line 1"
|
||||
/>
|
||||
<span class="form-text text-muted"
|
||||
>Please enter your Address 2.</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overlay-layer bg-dark-o-10">
|
||||
<div class="spinner spinner-primary"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--begin::Global Config(global config for global JS scripts)-->
|
||||
<script src="asset-corporate-portal/js/ktappsetting.js"></script>
|
||||
|
||||
@@ -59,6 +59,8 @@ SEARCH GROUP CSS KEYWORD "###"
|
||||
--dangerbg: #f7c9c9;
|
||||
--toscabg: #c9f7f5;
|
||||
--fieldbg: #f5f8fa;
|
||||
--labelkartukontrolSudahbg: #e8fff3;
|
||||
--labelkartukontrolBelumbg: #fff8dd;
|
||||
/* END BACKGROUND */
|
||||
/* TEXT COLOR */
|
||||
--text-black: #0e1e28;
|
||||
@@ -67,6 +69,8 @@ SEARCH GROUP CSS KEYWORD "###"
|
||||
--text-header-table: #b5b5c3;
|
||||
--header-table-bg: #f3f6f9;
|
||||
--active-state: #637381;
|
||||
--textcolorlabelkartukontrolSudah: #50cd89;
|
||||
--textcolorlabelkartukontrolBelum: #f1bc00;
|
||||
/* END TEXT COLOR */
|
||||
--light: #f3f6f9;
|
||||
--dark: #181c32;
|
||||
@@ -616,7 +620,7 @@ a.text-white:focus {
|
||||
}
|
||||
.btn-outline-secondary.disabled,
|
||||
.btn-outline-secondary:disabled {
|
||||
color: var(--secondary) !important;
|
||||
color: var(--text-black) !important;
|
||||
background-color: transparent;
|
||||
}
|
||||
.btn-outline-secondary:not(:disabled):not(.disabled):active,
|
||||
@@ -5195,11 +5199,100 @@ a.text-hover-tosca:hover .svg-icon svg:hover g [fill],
|
||||
position: fixed;
|
||||
top: 0vh;
|
||||
right: 0vh;
|
||||
z-index: 9998;
|
||||
z-index: 99999999999 !important;
|
||||
width: 350px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* ### TOAST FONT SIZE */
|
||||
.toast {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
/* ### KARTU KONTROL CSS */
|
||||
.kartukontrol-sudah-label {
|
||||
background-color: var(--labelkartukontrolSudahbg); /*figma*/
|
||||
color: var(--textcolorlabelkartukontrolSudah); /*figma*/
|
||||
padding: 0.15rem 0.75rem;
|
||||
border-radius: 0.42rem;
|
||||
}
|
||||
|
||||
.kartukontrol-pending-label {
|
||||
background-color: var(--labelkartukontrolBelumbg); /*figma*/
|
||||
color: var(--textcolorlabelkartukontrolBelum); /*figma*/
|
||||
padding: 0.15rem 0.75rem;
|
||||
border-radius: 0.42rem;
|
||||
}
|
||||
|
||||
/* ### OVERLAY */
|
||||
.overlay-loading {
|
||||
position: relative !important;
|
||||
}
|
||||
.overlay-loading .overlay-layer {
|
||||
position: absolute !important ;
|
||||
top: 0 !important;
|
||||
bottom: 0 !important;
|
||||
left: 0 !important;
|
||||
right: 0 !important;
|
||||
display: -webkit-box !important;
|
||||
display: -ms-flexbox !important;
|
||||
display: flex !important;
|
||||
-webkit-box-pack: center !important;
|
||||
-ms-flex-pack: center !important;
|
||||
justify-content: center !important;
|
||||
-webkit-box-align: center !important;
|
||||
-ms-flex-align: center !important;
|
||||
align-items: center !important;
|
||||
background-color: rgba(0, 0, 0, 0.05) !important;
|
||||
-webkit-transition: all 0.3s ease !important;
|
||||
transition: all 0.3s ease !important;
|
||||
opacity: 0 !important;
|
||||
}
|
||||
.overlay-loading.overlay-block .overlay-layer,
|
||||
.overlay-layer {
|
||||
-webkit-transition: all 0.3s ease !important;
|
||||
transition: all 0.3s ease !important;
|
||||
opacity: 1 !important;
|
||||
}
|
||||
.overlay-loading.overlay-block {
|
||||
cursor: wait !important;
|
||||
}
|
||||
|
||||
/* ### PROGRESS BAR HOVER TEXT */
|
||||
/* ## PRIMARY */
|
||||
.progress-bar {
|
||||
height: 4px !important;
|
||||
background-color: var(--primary) !important;
|
||||
width: 100% !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.progress-bar-value {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
background-color: var(--primarybg) !important;
|
||||
animation: indeterminateAnimation 1s infinite linear !important;
|
||||
transform-origin: 0% 50% !important;
|
||||
}
|
||||
|
||||
@keyframes indeterminateAnimation {
|
||||
0% {
|
||||
transform: translateX(0) scaleX(0);
|
||||
}
|
||||
40% {
|
||||
transform: translateX(0) scaleX(0.4);
|
||||
}
|
||||
100% {
|
||||
transform: translateX(100%) scaleX(0.5);
|
||||
}
|
||||
}
|
||||
/* ## SECONDARY */
|
||||
|
||||
/* ## SUCCESS */
|
||||
/* ## INFO */
|
||||
/* ## WARNING */
|
||||
/* ## DANGER */
|
||||
|
||||
/* ### BUTTON HOVER TEXT */
|
||||
/* ### */
|
||||
/* ## PRIMARY */
|
||||
|
||||
@@ -2109,7 +2109,40 @@ License: You must have a valid license purchased only from themeforest(the above
|
||||
<!--end:: Footer-->
|
||||
</div>
|
||||
<!--end:: Wrapper-->
|
||||
<button type="button" class="btn btn-primary" id="liveToastBtn">
|
||||
Show live toast
|
||||
</button>
|
||||
|
||||
<div
|
||||
class="position-fixed bottom-0 right-0 p-3"
|
||||
style="z-index: 5; right: 0; bottom: 0;"
|
||||
>
|
||||
<div
|
||||
id="liveToast"
|
||||
class="toast hide"
|
||||
role="alert"
|
||||
aria-live="assertive"
|
||||
aria-atomic="true"
|
||||
data-delay="2000"
|
||||
>
|
||||
<div class="toast-header">
|
||||
<img src="..." class="rounded mr-2" alt="..." />
|
||||
<strong class="mr-auto">Bootstrap</strong>
|
||||
<small>11 mins ago</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">
|
||||
Hello, world! This is a toast message.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var HOST_URL =
|
||||
"https://preview.keenthemes.com/metronic/theme/html/tools/preview";
|
||||
|
||||
@@ -1,6 +1,47 @@
|
||||
package customdropdown;
|
||||
|
||||
templ MainCustomDropdown(name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string, listItem templ.Component) {
|
||||
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-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 }
|
||||
|
||||
@@ -10,7 +10,9 @@ import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
func MainCustomDropdown(name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string, listItem templ.Component) templ.Component {
|
||||
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 {
|
||||
@@ -28,9 +30,9 @@ func MainCustomDropdown(name string, id string, hxTarget string, hxGet string, h
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(name)
|
||||
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: 6, Col: 14}
|
||||
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 {
|
||||
@@ -41,9 +43,9 @@ func MainCustomDropdown(name string, id string, hxTarget string, hxGet string, h
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(id)
|
||||
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: 10, Col: 10}
|
||||
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 {
|
||||
@@ -54,9 +56,9 @@ func MainCustomDropdown(name string, id string, hxTarget string, hxGet string, h
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
|
||||
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: 11, Col: 17}
|
||||
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 {
|
||||
@@ -67,9 +69,9 @@ func MainCustomDropdown(name string, id string, hxTarget string, hxGet string, h
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
|
||||
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: 12, Col: 23}
|
||||
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 {
|
||||
@@ -80,9 +82,9 @@ func MainCustomDropdown(name string, id string, hxTarget string, hxGet string, h
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
|
||||
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: 13, Col: 29}
|
||||
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 {
|
||||
@@ -93,9 +95,9 @@ func MainCustomDropdown(name string, id string, hxTarget string, hxGet string, h
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
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: 14, Col: 25}
|
||||
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 {
|
||||
@@ -106,9 +108,9 @@ func MainCustomDropdown(name string, id string, hxTarget string, hxGet string, h
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
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: 15, Col: 25}
|
||||
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 {
|
||||
@@ -122,6 +124,213 @@ func MainCustomDropdown(name string, id string, hxTarget string, hxGet string, h
|
||||
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-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: 34, 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: 39, 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: 47, 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: 51, 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: 52, 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: 53, 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: 54, 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: 55, 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: 56, 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
|
||||
|
||||
@@ -4,7 +4,14 @@ import "cpone/models"
|
||||
|
||||
templ CustomTextFieldv2(inp models.CustomTextFieldv2Prm) {
|
||||
<div class="form-group">
|
||||
<label class="text-black" style="font-family: Poppins; font-weight: 600;">{ inp.Label } </label>
|
||||
<label
|
||||
if inp.Type == "hidden" {
|
||||
class="text-black d-none"
|
||||
} else {
|
||||
class="text-black"
|
||||
}
|
||||
style="font-family: Poppins; font-weight: 600;"
|
||||
>{ inp.Label } </label>
|
||||
<input
|
||||
id={ inp.Name }
|
||||
name={ inp.Name }
|
||||
@@ -14,7 +21,7 @@ templ CustomTextFieldv2(inp models.CustomTextFieldv2Prm) {
|
||||
if inp.ErrorMsg =="" {
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
} else {
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 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">
|
||||
|
||||
@@ -25,14 +25,29 @@ func CustomTextFieldv2(inp models.CustomTextFieldv2Prm) templ.Component {
|
||||
templ_7745c5c3_Var1 = 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;\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"form-group\"><label")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if inp.Type == "hidden" {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"text-black d-none\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"text-black\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" 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\customtextfield\customtextfieldv2.templ`, Line: 7, Col: 87}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2.templ`, Line: 14, Col: 14}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -45,7 +60,7 @@ func CustomTextFieldv2(inp models.CustomTextFieldv2Prm) templ.Component {
|
||||
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\customtextfield\customtextfieldv2.templ`, Line: 9, Col: 16}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2.templ`, Line: 16, Col: 16}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -58,7 +73,7 @@ func CustomTextFieldv2(inp models.CustomTextFieldv2Prm) templ.Component {
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2.templ`, Line: 10, Col: 18}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2.templ`, Line: 17, Col: 18}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -71,7 +86,7 @@ func CustomTextFieldv2(inp models.CustomTextFieldv2Prm) templ.Component {
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Type)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2.templ`, Line: 11, Col: 18}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2.templ`, Line: 18, Col: 18}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -84,7 +99,7 @@ func CustomTextFieldv2(inp models.CustomTextFieldv2Prm) templ.Component {
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Placeholder)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2.templ`, Line: 12, Col: 32}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2.templ`, Line: 19, Col: 32}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -97,7 +112,7 @@ func CustomTextFieldv2(inp models.CustomTextFieldv2Prm) templ.Component {
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Value)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2.templ`, Line: 13, Col: 20}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2.templ`, Line: 20, Col: 20}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -113,7 +128,7 @@ func CustomTextFieldv2(inp models.CustomTextFieldv2Prm) templ.Component {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"form-control bg-field border-0 h-auto py-6 px-6 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
|
||||
}
|
||||
@@ -125,7 +140,7 @@ func CustomTextFieldv2(inp models.CustomTextFieldv2Prm) templ.Component {
|
||||
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\customtextfield\customtextfieldv2.templ`, Line: 21, Col: 17}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2.templ`, Line: 28, Col: 17}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
||||
68
component/customtextfield/customtextfieldv2password.templ
Normal file
68
component/customtextfield/customtextfieldv2password.templ
Normal file
@@ -0,0 +1,68 @@
|
||||
package customtextfield
|
||||
|
||||
import "cpone/models"
|
||||
|
||||
templ CustomTextFieldPasswordv2(inp models.CustomTextFieldv2Prm) {
|
||||
<div class="form-group">
|
||||
<label
|
||||
if inp.Type == "hidden" {
|
||||
class="text-black d-none"
|
||||
} else {
|
||||
class="text-black"
|
||||
}
|
||||
style="font-family: Poppins; font-weight: 600;"
|
||||
>{ inp.Label } </label>
|
||||
<div class="input-group">
|
||||
<input
|
||||
id={ inp.Name }
|
||||
name={ inp.Name }
|
||||
type={ inp.Type }
|
||||
placeholder={ inp.Placeholder }
|
||||
value={ inp.Value }
|
||||
if inp.ErrorMsg =="" {
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
} else {
|
||||
class="form-control bg-field border-1 h-auto py-6 px-6 rounded-lg is-invalid"
|
||||
}
|
||||
/>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-secondary" type="button" id={ "toggle-" + inp.Name }>
|
||||
<i class="fa-solid fa-eye" id={ "icon-" + inp.Name }></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="invalid-feedback text-danger mt-3 ml-2">
|
||||
{ inp.ErrorMsg }
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const toggleButton = document.getElementById('toggle-' + inp.Name);
|
||||
const inputField = document.getElementById(inp.Name);
|
||||
const icon = document.getElementById('icon-' + inp.Name);
|
||||
|
||||
toggleButton.addEventListener('click', function () {
|
||||
if (inputField.type === 'password') {
|
||||
inputField.type = 'text';
|
||||
icon.classList.remove('fa-eye');
|
||||
icon.classList.add('fa-eye-slash');
|
||||
} else {
|
||||
inputField.type = 'password';
|
||||
icon.classList.remove('fa-eye-slash');
|
||||
icon.classList.add('fa-eye');
|
||||
}
|
||||
});
|
||||
|
||||
// Initial state setup based on fieldType
|
||||
if (fieldType === 'password') {
|
||||
inputField.type = 'password';
|
||||
icon.classList.add('fa-eye');
|
||||
icon.classList.remove('fa-eye-slash');
|
||||
} else {
|
||||
inputField.type = 'text';
|
||||
icon.classList.add('fa-eye-slash');
|
||||
icon.classList.remove('fa-eye');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
}
|
||||
184
component/customtextfield/customtextfieldv2password_templ.go
Normal file
184
component/customtextfield/customtextfieldv2password_templ.go
Normal file
@@ -0,0 +1,184 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package customtextfield
|
||||
|
||||
//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 CustomTextFieldPasswordv2(inp models.CustomTextFieldv2Prm) 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-group\"><label")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if inp.Type == "hidden" {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"text-black d-none\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"text-black\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" 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\customtextfield\customtextfieldv2password.templ`, Line: 14, Col: 14}
|
||||
}
|
||||
_, 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=\"input-group\"><input id=\"")
|
||||
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\customtextfield\customtextfieldv2password.templ`, Line: 17, Col: 17}
|
||||
}
|
||||
_, 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("\" name=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2password.templ`, Line: 18, Col: 19}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Type)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2password.templ`, Line: 19, Col: 19}
|
||||
}
|
||||
_, 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("\" placeholder=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Placeholder)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2password.templ`, Line: 20, 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("\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Value)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2password.templ`, Line: 21, Col: 21}
|
||||
}
|
||||
_, 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
|
||||
}
|
||||
if inp.ErrorMsg == "" {
|
||||
_, 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 h-auto py-6 px-6 rounded-lg is-invalid\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("><div class=\"input-group-append\"><button class=\"btn btn-secondary\" type=\"button\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs("toggle-" + inp.Name)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2password.templ`, Line: 29, Col: 77}
|
||||
}
|
||||
_, 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("\"><i class=\"fa-solid fa-eye\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs("icon-" + inp.Name)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2password.templ`, Line: 30, Col: 55}
|
||||
}
|
||||
_, 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("\"></i></button></div></div><div class=\"invalid-feedback text-danger mt-3 ml-2\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfield\customtextfieldv2password.templ`, Line: 35, Col: 17}
|
||||
}
|
||||
_, 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("</div></div><script>\r\n document.addEventListener('DOMContentLoaded', function () {\r\n const toggleButton = document.getElementById('toggle-' + inp.Name);\r\n const inputField = document.getElementById(inp.Name);\r\n const icon = document.getElementById('icon-' + inp.Name);\r\n\r\n toggleButton.addEventListener('click', function () {\r\n if (inputField.type === 'password') {\r\n inputField.type = 'text';\r\n icon.classList.remove('fa-eye');\r\n icon.classList.add('fa-eye-slash');\r\n } else {\r\n inputField.type = 'password';\r\n icon.classList.remove('fa-eye-slash');\r\n icon.classList.add('fa-eye');\r\n }\r\n });\r\n\r\n // Initial state setup based on fieldType\r\n if (fieldType === 'password') {\r\n inputField.type = 'password';\r\n icon.classList.add('fa-eye');\r\n icon.classList.remove('fa-eye-slash');\r\n } else {\r\n inputField.type = 'text';\r\n icon.classList.add('fa-eye-slash');\r\n icon.classList.remove('fa-eye');\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
|
||||
})
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package customtextfieldautocomplete
|
||||
|
||||
templ MainCustomAutoCompleteV1(value string) {
|
||||
<div id="initial" class="form-group">
|
||||
<input
|
||||
class="form-control bg-field"
|
||||
type="text"
|
||||
autocomplete="off"
|
||||
placeholder="Search Data..."
|
||||
id="searchAutocomplete"
|
||||
name="searchAutocomplete"
|
||||
hx-get="/client/autocomplete"
|
||||
hx-trigger="input changed delay:500ms, search"
|
||||
hx-target="#hasilAutoComplete"
|
||||
hx-indicator="#indicator"
|
||||
value={ value }
|
||||
/>
|
||||
<div id="hasilAutoComplete">
|
||||
<div id="indicator" class="position-absolute d-flex justify-content-center spinner-border htmx-indicator" style="z-index: 99;" role="status">
|
||||
<span class="sr-only">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ListCustomAutoCompleteHideV1() {
|
||||
<div id="hasilAutoComplete"></div>
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package customtextfieldautocomplete
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
func MainCustomAutoCompleteV1(value 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=\"initial\" class=\"form-group\"><input class=\"form-control bg-field\" type=\"text\" autocomplete=\"off\" placeholder=\"Search Data...\" id=\"searchAutocomplete\" name=\"searchAutocomplete\" hx-get=\"/client/autocomplete\" hx-trigger=\"input changed delay:500ms, search\" hx-target=\"#hasilAutoComplete\" hx-indicator=\"#indicator\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(value)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldautocomplete\customautocompletev1.templ`, Line: 16, Col: 16}
|
||||
}
|
||||
_, 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("\"><div id=\"hasilAutoComplete\"><div id=\"indicator\" class=\"position-absolute d-flex justify-content-center spinner-border htmx-indicator\" style=\"z-index: 99;\" role=\"status\"><span class=\"sr-only\">Loading...</span></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 ListCustomAutoCompleteHideV1() 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=\"hasilAutoComplete\"></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
|
||||
})
|
||||
}
|
||||
@@ -32,8 +32,7 @@ templ MainCustomTextFieldSearchV1(
|
||||
hxTarget,
|
||||
hxIndicator,
|
||||
value,
|
||||
hxExt,
|
||||
hxInclude string) {
|
||||
hxExt string) {
|
||||
<input
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
type={ inpType }
|
||||
@@ -46,7 +45,41 @@ templ MainCustomTextFieldSearchV1(
|
||||
hx-indicator={ hxIndicator }
|
||||
value={ value }
|
||||
hx-ext={ hxExt }
|
||||
hx-include={ hxInclude }
|
||||
autocomplete="off"
|
||||
/>
|
||||
}
|
||||
|
||||
templ MainCustomTextFieldSearchV2(
|
||||
inpId,
|
||||
inpName,
|
||||
inpPlaceHolder,
|
||||
inpType,
|
||||
hxGet,
|
||||
hxTrigger,
|
||||
hxTarget,
|
||||
hxIndicator,
|
||||
value,
|
||||
hxSwap string,
|
||||
hxInclude string) {
|
||||
<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 }
|
||||
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>
|
||||
}
|
||||
|
||||
@@ -155,8 +155,7 @@ func MainCustomTextFieldSearchV1(
|
||||
hxTarget,
|
||||
hxIndicator,
|
||||
value,
|
||||
hxExt,
|
||||
hxInclude string) templ.Component {
|
||||
hxExt 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 {
|
||||
@@ -176,7 +175,7 @@ func MainCustomTextFieldSearchV1(
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(inpType)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 39, Col: 16}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 38, Col: 16}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -189,7 +188,7 @@ func MainCustomTextFieldSearchV1(
|
||||
var templ_7745c5c3_Var12 string
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(inpName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 40, Col: 16}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 39, Col: 16}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -202,7 +201,7 @@ func MainCustomTextFieldSearchV1(
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(inpId)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 41, Col: 12}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 40, Col: 12}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -215,7 +214,7 @@ func MainCustomTextFieldSearchV1(
|
||||
var templ_7745c5c3_Var14 string
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(inpPlaceHolder)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 42, Col: 30}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 41, Col: 30}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -228,7 +227,7 @@ func MainCustomTextFieldSearchV1(
|
||||
var templ_7745c5c3_Var15 string
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 43, Col: 16}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 42, Col: 16}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -241,7 +240,7 @@ func MainCustomTextFieldSearchV1(
|
||||
var templ_7745c5c3_Var16 string
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 44, Col: 24}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 43, Col: 24}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -254,7 +253,7 @@ func MainCustomTextFieldSearchV1(
|
||||
var templ_7745c5c3_Var17 string
|
||||
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 45, Col: 22}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 44, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -267,7 +266,7 @@ func MainCustomTextFieldSearchV1(
|
||||
var templ_7745c5c3_Var18 string
|
||||
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 46, Col: 28}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 45, Col: 28}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -280,7 +279,7 @@ func MainCustomTextFieldSearchV1(
|
||||
var templ_7745c5c3_Var19 string
|
||||
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(value)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 47, Col: 15}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 46, Col: 15}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -293,25 +292,12 @@ func MainCustomTextFieldSearchV1(
|
||||
var templ_7745c5c3_Var20 string
|
||||
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(hxExt)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 48, Col: 16}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 47, Col: 16}
|
||||
}
|
||||
_, 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\customtextfieldsearch\customtextfieldsearch.templ`, Line: 49, Col: 24}
|
||||
}
|
||||
_, 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("\" autocomplete=\"off\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
@@ -322,3 +308,181 @@ func MainCustomTextFieldSearchV1(
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func MainCustomTextFieldSearchV2(
|
||||
inpId,
|
||||
inpName,
|
||||
inpPlaceHolder,
|
||||
inpType,
|
||||
hxGet,
|
||||
hxTrigger,
|
||||
hxTarget,
|
||||
hxIndicator,
|
||||
value,
|
||||
hxSwap string,
|
||||
hxInclude string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var21 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var21 == nil {
|
||||
templ_7745c5c3_Var21 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, 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_Var22 string
|
||||
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(inpType)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 66, Col: 16}
|
||||
}
|
||||
_, 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("\" name=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var23 string
|
||||
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(inpName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 67, Col: 16}
|
||||
}
|
||||
_, 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("\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var24 string
|
||||
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(inpId)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 68, Col: 12}
|
||||
}
|
||||
_, 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("\" placeholder=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var25 string
|
||||
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(inpPlaceHolder)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 69, Col: 30}
|
||||
}
|
||||
_, 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\customtextfieldsearch\customtextfieldsearch.templ`, Line: 70, 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-trigger=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var27 string
|
||||
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 71, Col: 24}
|
||||
}
|
||||
_, 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\customtextfieldsearch\customtextfieldsearch.templ`, Line: 72, 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-indicator=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var29 string
|
||||
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 73, Col: 28}
|
||||
}
|
||||
_, 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("\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var30 string
|
||||
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(value)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 74, Col: 15}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var31 string
|
||||
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 75, Col: 24}
|
||||
}
|
||||
_, 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(hxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 76, Col: 18}
|
||||
}
|
||||
_, 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("\" 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
|
||||
})
|
||||
}
|
||||
|
||||
@@ -28,14 +28,14 @@ templ ModalConfirmation(
|
||||
<p>{ message }</p>
|
||||
<div class="card rounded-lg">
|
||||
<div class="card-body d-flex flex-row">
|
||||
<div class="d-flex flex-column ">
|
||||
<div class="d-flex flex-column">
|
||||
for _, v := range datHeader {
|
||||
<div class="mb-3 text-disabled font-weight-bold mr-5">{ v }</div>
|
||||
<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-3 font-weight-bold">
|
||||
<div class="mb-1 mt-1 font-weight-bold">
|
||||
{ v }
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -77,19 +77,19 @@ func ModalConfirmation(
|
||||
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 \">")
|
||||
_, 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-3 text-disabled font-weight-bold mr-5\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 text-disabled font-weight-bold mr-5\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\modal\modal_confirmation.templ`, Line: 33, Col: 66}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\modal\modal_confirmation.templ`, Line: 33, Col: 71}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -105,7 +105,7 @@ func ModalConfirmation(
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for _, v := range dataText {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-3 font-weight-bold\">")
|
||||
_, 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
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package navbar
|
||||
|
||||
import (
|
||||
"cpone/component/sidebarmaster"
|
||||
services "cpone/services/dev"
|
||||
|
||||
"cpone/models"
|
||||
)
|
||||
|
||||
@@ -40,7 +40,7 @@ templ Navbar(dataUser models.User) {
|
||||
</div>
|
||||
}
|
||||
|
||||
templ NavbarMenu(datamenu []services.MasterMenu) {
|
||||
templ NavbarMenu(datamenu []models.Menu) {
|
||||
<div class="aside-menu-wrapper flex-column-fluid" id="kt_aside_menu_wrapper">
|
||||
<!--begin::Menu Container-->
|
||||
<div
|
||||
|
||||
@@ -12,8 +12,8 @@ import "bytes"
|
||||
|
||||
import (
|
||||
"cpone/component/sidebarmaster"
|
||||
|
||||
"cpone/models"
|
||||
services "cpone/services/dev"
|
||||
)
|
||||
|
||||
func Navbar(dataUser models.User) templ.Component {
|
||||
@@ -53,7 +53,7 @@ func Navbar(dataUser models.User) templ.Component {
|
||||
})
|
||||
}
|
||||
|
||||
func NavbarMenu(datamenu []services.MasterMenu) templ.Component {
|
||||
func NavbarMenu(datamenu []models.Menu) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
|
||||
52
component/pagination/paginationv2.templ
Normal file
52
component/pagination/paginationv2.templ
Normal file
@@ -0,0 +1,52 @@
|
||||
package pagination
|
||||
|
||||
import "strconv"
|
||||
import "cpone/component/customtextfield"
|
||||
import "cpone/models"
|
||||
|
||||
templ PaginationV2(length int,
|
||||
currentPage int,
|
||||
link string,
|
||||
paginationID string,
|
||||
hxInclude string,
|
||||
hxTarget string,
|
||||
hxSwap string,
|
||||
hxIndicator string,
|
||||
hxSwapOob string) {
|
||||
// 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" 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-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"
|
||||
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>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{
|
||||
ID: "currpage" + paginationID,
|
||||
Name: "currpage" + paginationID,
|
||||
Type: "hidden",
|
||||
Value: strconv.Itoa(currentPage)})
|
||||
</div>
|
||||
}
|
||||
258
component/pagination/paginationv2_templ.go
Normal file
258
component/pagination/paginationv2_templ.go
Normal file
@@ -0,0 +1,258 @@
|
||||
// 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 PaginationV2(length int,
|
||||
currentPage int,
|
||||
link string,
|
||||
paginationID string,
|
||||
hxInclude string,
|
||||
hxTarget string,
|
||||
hxSwap string,
|
||||
hxIndicator string,
|
||||
hxSwapOob 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 class=\"d-flex justify-content-between align-items-center flex-wrap\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(paginationID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 18, Col: 91}
|
||||
}
|
||||
_, 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=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapOob)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 18, Col: 117}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><div 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_7745c5c3_Buffer.WriteString("<a hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, 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: 23, Col: 55}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"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_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 25, 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("\" hx-indicator=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 26, Col: 32}
|
||||
}
|
||||
_, 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=\"click\" 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: `component\pagination\paginationv2.templ`, Line: 28, 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-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv2.templ`, Line: 29, Col: 28}
|
||||
}
|
||||
_, 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-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: 31, Col: 25}
|
||||
}
|
||||
_, 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("</a>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
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: 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\" 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: 36, Col: 22}
|
||||
}
|
||||
_, 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(hxIndicator)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
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 {
|
||||
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_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: 39, Col: 26}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var14 string
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
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("\" 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: 42, Col: 25}
|
||||
}
|
||||
_, 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("</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
|
||||
})
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package sidebarmaster
|
||||
|
||||
import (
|
||||
services "cpone/services/dev"
|
||||
"cpone/models"
|
||||
)
|
||||
|
||||
templ MenuDashboard(ParentMenuName string, ParentMenuUrl string) {
|
||||
@@ -50,7 +50,7 @@ templ ListMenuChildren(ChildrenMenuURL string, ChildrenMenuName string) {
|
||||
</li>
|
||||
}
|
||||
|
||||
templ ListMenuNavbar(ParentMenuName string, datamenuchildren []services.ChildrenMenu) {
|
||||
templ ListMenuNavbar(ParentMenuName string, datamenuchildren []models.ChildrenMenu) {
|
||||
<li class="menu-item menu-item-submenu" aria-haspopup="true" data-menu-toggle="hover">
|
||||
<a
|
||||
href="javascript:;"
|
||||
|
||||
@@ -11,7 +11,7 @@ import "io"
|
||||
import "bytes"
|
||||
|
||||
import (
|
||||
services "cpone/services/dev"
|
||||
"cpone/models"
|
||||
)
|
||||
|
||||
func MenuDashboard(ParentMenuName string, ParentMenuUrl string) templ.Component {
|
||||
@@ -106,7 +106,7 @@ func ListMenuChildren(ChildrenMenuURL string, ChildrenMenuName string) templ.Com
|
||||
})
|
||||
}
|
||||
|
||||
func ListMenuNavbar(ParentMenuName string, datamenuchildren []services.ChildrenMenu) templ.Component {
|
||||
func ListMenuNavbar(ParentMenuName string, datamenuchildren []models.ChildrenMenu) 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 {
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
package tablecomponent
|
||||
|
||||
templ TableV2(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component, idunique string, inputanSearch templ.Component, dropdown templ.Component) {
|
||||
templ TableV2(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component, idunique string, inputanSearch templ.Component) {
|
||||
if len(thName) != len(thWidth) {
|
||||
<div>length array thname berbeda dengan array thwidth</div>
|
||||
} else {
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
@dropdown
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@inputanSearch
|
||||
</div>
|
||||
</div>
|
||||
@inputanSearch
|
||||
<div id={ idunique }>
|
||||
<div class="mt-7"></div>
|
||||
<table class="table table-hover table-borderless">
|
||||
@@ -34,6 +27,5 @@ templ TableV2(thName []string, thWidth []string, trComponent templ.Component, pa
|
||||
}
|
||||
|
||||
templ DivEmpty() {
|
||||
<div>
|
||||
</div>
|
||||
}
|
||||
<div></div>
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
func TableV2(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component, idunique string, inputanSearch templ.Component, dropdown templ.Component) templ.Component {
|
||||
func TableV2(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component, idunique string, inputanSearch 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 {
|
||||
@@ -29,30 +29,18 @@ func TableV2(thName []string, thWidth []string, trComponent templ.Component, pag
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row\"><div class=\"col-6\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = dropdown.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-6\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = inputanSearch.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div id=\"")
|
||||
_, 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(idunique)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev2.templ`, Line: 15, Col: 20}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev2.templ`, Line: 8, Col: 20}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -70,7 +58,7 @@ func TableV2(thName []string, thWidth []string, trComponent templ.Component, pag
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(thWidth[i])
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev2.templ`, Line: 21, Col: 41}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev2.templ`, Line: 14, Col: 41}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -83,7 +71,7 @@ func TableV2(thName []string, thWidth []string, trComponent templ.Component, pag
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(item)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev2.templ`, Line: 21, Col: 50}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev2.templ`, Line: 14, Col: 50}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
||||
27
component/table/tablev3.templ
Normal file
27
component/table/tablev3.templ
Normal file
@@ -0,0 +1,27 @@
|
||||
package tablecomponent
|
||||
|
||||
templ TableV3(thName []string, thWidth []string, trComponent templ.Component) {
|
||||
<div>
|
||||
if len(thName) != len(thWidth) {
|
||||
<div>length array thname berbeda dengan array thwidth</div>
|
||||
} else {
|
||||
<div class="mt-7"></div>
|
||||
<table class="table table-hover table-borderless">
|
||||
<thead>
|
||||
<tr class="rounded-lg bg-header-table">
|
||||
for i, item := range thName {
|
||||
<th scope="col" width={ thWidth[i] }>{ item }</th>
|
||||
}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@trComponent
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
templ DivEmptyV3() {
|
||||
<div></div>
|
||||
}
|
||||
118
component/table/tablev3_templ.go
Normal file
118
component/table/tablev3_templ.go
Normal file
@@ -0,0 +1,118 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package tablecomponent
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
func TableV3(thName []string, thWidth []string, trComponent 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>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if len(thName) != len(thWidth) {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>length array thname berbeda dengan array thwidth</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mt-7\"></div><table class=\"table table-hover table-borderless\"><thead><tr class=\"rounded-lg bg-header-table\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for i, item := range thName {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<th scope=\"col\" width=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(thWidth[i])
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 13, Col: 41}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(item)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 13, Col: 50}
|
||||
}
|
||||
_, 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("</th>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</tr></thead> <tbody>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = trComponent.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</tbody></table>")
|
||||
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 DivEmptyV3() 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></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
|
||||
})
|
||||
}
|
||||
86
component/toastbootstrap/customtoastv2.templ
Normal file
86
component/toastbootstrap/customtoastv2.templ
Normal file
@@ -0,0 +1,86 @@
|
||||
package customtoastv1
|
||||
|
||||
// kalau eror => bg nya danger
|
||||
// kalau sukses => bgnya success
|
||||
// kalau warning => bgnya warning
|
||||
|
||||
func toastBackground(typeToast string) string {
|
||||
return "bg-" + typeToast
|
||||
}
|
||||
|
||||
func toastBody(typeToastBody string) string {
|
||||
return "bg-" + typeToastBody + "-transparent"
|
||||
}
|
||||
|
||||
func toastIcon(typeToast string) string {
|
||||
var stringx string
|
||||
if typeToast == "success" {
|
||||
stringx = "solar:check-circle-broken"
|
||||
} else {
|
||||
if typeToast == "danger" {
|
||||
stringx = "solar:close-circle-broken"
|
||||
} else {
|
||||
if typeToast == "warning" {
|
||||
stringx = "solar:shield-warning-bold"
|
||||
} else {
|
||||
if typeToast == "information" {
|
||||
stringx = "solar:info-square-broken"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stringx
|
||||
}
|
||||
|
||||
templ CustomToastV2Show(title string, message string, typeToast string) {
|
||||
<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;"
|
||||
>
|
||||
<div class={ "toast-header", toastBackground(typeToast) , "text-white" }>
|
||||
<span
|
||||
class="iconify mr-2"
|
||||
data-icon={ toastIcon(typeToast) }
|
||||
></span>
|
||||
<strong class="mr-auto">{ title }</strong>
|
||||
<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",toastBody(typeToast) }>
|
||||
{ message }
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
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 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>
|
||||
}
|
||||
175
component/toastbootstrap/customtoastv2_templ.go
Normal file
175
component/toastbootstrap/customtoastv2_templ.go
Normal file
@@ -0,0 +1,175 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package customtoastv1
|
||||
|
||||
//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"
|
||||
|
||||
// kalau eror => bg nya danger
|
||||
// kalau sukses => bgnya success
|
||||
// kalau warning => bgnya warning
|
||||
|
||||
func toastBackground(typeToast string) string {
|
||||
return "bg-" + typeToast
|
||||
}
|
||||
|
||||
func toastBody(typeToastBody string) string {
|
||||
return "bg-" + typeToastBody + "-transparent"
|
||||
}
|
||||
|
||||
func toastIcon(typeToast string) string {
|
||||
var stringx string
|
||||
if typeToast == "success" {
|
||||
stringx = "solar:check-circle-broken"
|
||||
} else {
|
||||
if typeToast == "danger" {
|
||||
stringx = "solar:close-circle-broken"
|
||||
} else {
|
||||
if typeToast == "warning" {
|
||||
stringx = "solar:shield-warning-bold"
|
||||
} else {
|
||||
if typeToast == "information" {
|
||||
stringx = "solar:info-square-broken"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stringx
|
||||
}
|
||||
|
||||
func CustomToastV2Show(title string, message string, typeToast 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 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
|
||||
}
|
||||
var templ_7745c5c3_Var2 = []any{"toast-header", toastBackground(typeToast), "text-white"}
|
||||
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var2).String())
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\toastbootstrap\customtoastv2.templ`, Line: 1, Col: 0}
|
||||
}
|
||||
_, 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("\"><span class=\"iconify mr-2\" data-icon=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(toastIcon(typeToast))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\toastbootstrap\customtoastv2.templ`, Line: 52, Col: 36}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></span> <strong class=\"mr-auto\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(title)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\toastbootstrap\customtoastv2.templ`, Line: 54, 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("</strong> <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 = []any{"toast-body", toastBody(typeToast)}
|
||||
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var6).String())
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\toastbootstrap\customtoastv2.templ`, Line: 1, Col: 0}
|
||||
}
|
||||
_, 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(message)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\toastbootstrap\customtoastv2.templ`, Line: 60, Col: 12}
|
||||
}
|
||||
_, 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
|
||||
})
|
||||
}
|
||||
|
||||
func CustomToastV2Hide() 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 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> <small class=\"text-muted text-white\">just now</small> <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div><div class=\"toast-body bg-success-transparent\">This is a success toast.\r</div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
@@ -1,41 +1,37 @@
|
||||
package dev_handlers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"strconv"
|
||||
|
||||
breadcrumbadmin "cpone/component/breadcrumbadmin"
|
||||
"cpone/component/customdropdown"
|
||||
customtextfieldsearch "cpone/component/customtextfieldsearch"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
"cpone/component/pagination"
|
||||
tablecomponent "cpone/component/table"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
"cpone/models"
|
||||
globalservices "cpone/services"
|
||||
"cpone/utils"
|
||||
mastermenuuser "cpone/views/dev/mastermenuuser"
|
||||
mastermenuusergroup "cpone/views/dev/mastermenuusergroup"
|
||||
|
||||
services "cpone/services/dev"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
|
||||
breadcrumbadmin "cpone/component/breadcrumbadmin"
|
||||
customtextfieldsearch "cpone/component/customtextfieldsearch"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
)
|
||||
|
||||
type MasterMenuUserService interface {
|
||||
GetMasterMenus() ([]services.MasterMenu, error)
|
||||
GetUserGroup() ([]models.UserGroup, error)
|
||||
// GetUserGroup() ([]models.UserGroup, error)
|
||||
// GetUserGroupByID(id string) (models.UserGroup, error)
|
||||
// try
|
||||
GetListMasterUser(searchDropdown string) ([]models.MasterUser, error)
|
||||
GetListMasterUserGroup() ([]models.UserGroupV1, error)
|
||||
GetListBreadCrumb(title string) (models.BreadCrumbV1, error)
|
||||
|
||||
GetListMasterUserPagination(search string, searchDropdown string, currentPage int, rowPerPage int) ([]models.MasterUser, error)
|
||||
GetListMasterUserFilteredBySearch(search string, searchDropdown string) ([]models.MasterUser, error)
|
||||
GetListMasterUserGroupSearch() ([]models.UserGroupV1, error)
|
||||
// AddUserGroup(code string, name string) (models.UserGroupV1, error)
|
||||
// EditUserGroup(id string, code string, name string) (models.UserGroupV1, error)
|
||||
// DeleteUserGroup(id string) (models.UserGroupV1, error)
|
||||
GetListMasterUserV2(search string, usergroup string, currentPage int, rowPerPage int) ([]models.MasterUser, int, error)
|
||||
// GetUserGroupByIDV1(id string) (models.UserGroupV1, error)
|
||||
GetUserGroupData() ([]models.UserGroupV1, error)
|
||||
}
|
||||
|
||||
func NewMasterMenuUserHandler(us MasterMenuUserService) *MasterMenuUserHandler {
|
||||
@@ -48,54 +44,72 @@ type MasterMenuUserHandler struct {
|
||||
MasterMenuUserService MasterMenuUserService
|
||||
}
|
||||
|
||||
func (uh *MasterMenuUserHandler) View(c echo.Context, cmp templ.Component) error {
|
||||
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
|
||||
|
||||
return cmp.Render(c.Request().Context(), c.Response().Writer)
|
||||
}
|
||||
|
||||
func (lh *MasterMenuUserHandler) HandlerShowBreadCrumbV1(c echo.Context) error {
|
||||
// PAGINATION
|
||||
func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserPaginationV1(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
paramTitleBreadcrumbConvert := "Master User"
|
||||
|
||||
dataBreadCrumb, err := lh.MasterMenuUserService.GetListBreadCrumb(paramTitleBreadcrumbConvert)
|
||||
fmt.Println(dataBreadCrumb)
|
||||
fmt.Println(err)
|
||||
search := c.QueryParam("search")
|
||||
usergroup := c.QueryParam("usergroup")
|
||||
pageparam := c.QueryParam("page")
|
||||
tableID := c.QueryParam("tableID")
|
||||
searchID := c.QueryParam("searchID")
|
||||
|
||||
dropdownID := c.QueryParam("dropdownID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
dialogEditBodyID := c.QueryParam("dialogEditBodyID")
|
||||
// dialogEditID := c.QueryParam("dialogEditID")
|
||||
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
|
||||
// dialogDeleteID := c.QueryParam("dialogDeleteID")
|
||||
page, err := strconv.Atoi(pageparam)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR BREADCRUMB DEV",
|
||||
zap.Any("error", err),
|
||||
logger.Info("ERROR CONVERT PAGE PARAM",
|
||||
zap.Any("page", page),
|
||||
zap.Any("error ", err),
|
||||
)
|
||||
fmt.Println(dataBreadCrumb)
|
||||
return err
|
||||
}
|
||||
|
||||
// si := mastermenuusergroup.ListMasterUserGroupInitial(dataBreadCrumb)
|
||||
dataUserGroup, totalpage, err := lh.MasterMenuUserService.GetListMasterUserV2(search, usergroup, page, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET USER GROUP",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataUserGroup)
|
||||
return err
|
||||
}
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("LOAD BREADCRUMB DEV",
|
||||
zap.Any("data", dataBreadCrumb),
|
||||
)
|
||||
contentUserGroupComponent := mastermenuuser.TableUser(
|
||||
dataUserGroup, tableID, "/dev/usergroupshoweditform",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/usergroupshowdeleteform",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogDeleteBodyID, #dialogDeleteID, #dialogEditBodyID, #dialogEditID")
|
||||
|
||||
// si := breadcrumbadmin.MainBreadcrumbAdminV1(dataBreadCrumb)
|
||||
userGroupPaginationComponent := pagination.PaginationV2(totalpage,
|
||||
page,
|
||||
"/dev/userv1pagination",
|
||||
paginationID,
|
||||
// "#tableID, #searchID, #"+searchID+", #dropdownID, #"+dropdownID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID, [name='search'], [name='usergroup']",
|
||||
"#tableID, #searchID, #"+searchID+", #dropdownID, #"+dropdownID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID, [name='search'], [name='usergroup']",
|
||||
"#"+paginationID, "outerHTML", "", "")
|
||||
|
||||
si := mastermenuusergroup.ShowMasterMenuUserGroupV1(
|
||||
"Master Menu",
|
||||
breadcrumbadmin.MainBreadcrumbAdminV1(dataBreadCrumb),
|
||||
mastermenuusergroup.CssMasterMenuUserGroupV1(),
|
||||
mastermenuusergroup.JsMasterMenuUserGroupV1(),
|
||||
)
|
||||
retval := []templ.Component{contentUserGroupComponent, userGroupPaginationComponent}
|
||||
|
||||
return lh.View(c, si)
|
||||
return utils.ViewMulti(c, retval)
|
||||
}
|
||||
|
||||
// try
|
||||
// LISTING FUNCTION INITIAL
|
||||
func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserV1(c echo.Context) error {
|
||||
// var toastComponent templ.Component
|
||||
contentIDHtmxExtension := utils.GenerateRandomID("htmxExtmgu")
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
dataMenu, err := lh.MasterMenuUserService.GetMasterMenus()
|
||||
//get sidebarmenu
|
||||
|
||||
dataMenu, err := globalservices.GetMenu()
|
||||
fmt.Println(dataMenu)
|
||||
fmt.Println(err)
|
||||
if err != nil {
|
||||
@@ -103,7 +117,8 @@ func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserV1(c echo.Context) err
|
||||
return err
|
||||
}
|
||||
|
||||
dataUser, err := services.GetUser()
|
||||
//get user login
|
||||
dataUser, err := globalservices.GetUserLogin()
|
||||
fmt.Println(dataUser)
|
||||
fmt.Println(err)
|
||||
if err != nil {
|
||||
@@ -111,48 +126,52 @@ func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserV1(c echo.Context) err
|
||||
return err
|
||||
}
|
||||
|
||||
rowPerPage := 2
|
||||
dataMasterUser, err := lh.MasterMenuUserService.GetListMasterUserPagination("", "1", 1, rowPerPage)
|
||||
fmt.Println(dataMasterUser)
|
||||
// dropdownUserGroupInitial :=
|
||||
|
||||
dataUserMasterInitialSelected, err := lh.MasterMenuUserService.GetUserGroupData()
|
||||
fmt.Println(dataUserMasterInitialSelected)
|
||||
fmt.Println(err)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR LIST USER MASTER DEV",
|
||||
logger.Info("ERROR LIST USER MASTER Selected DEV",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataMasterUser)
|
||||
fmt.Println(dataUserMasterInitialSelected)
|
||||
return err
|
||||
}
|
||||
|
||||
dataUserMasterAll, err := lh.MasterMenuUserService.GetListMasterUser("1")
|
||||
fmt.Println(dataUserMasterAll)
|
||||
fmt.Println(err)
|
||||
var initialSelectedUserGroup string = "0"
|
||||
if len(dataUserMasterInitialSelected) > 0 {
|
||||
initialSelectedUserGroup = strconv.Itoa(dataUserMasterInitialSelected[0].M_UserGroupID)
|
||||
}
|
||||
|
||||
dataUserGroup, totalpage, err := lh.MasterMenuUserService.GetListMasterUserV2("", initialSelectedUserGroup, 1, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR LIST USER MASTER ALL DEV",
|
||||
logger.Info("ERROR GET USER GROUP",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataUserMasterAll)
|
||||
fmt.Println(dataUserGroup)
|
||||
return err
|
||||
}
|
||||
|
||||
// si := mastermenuusergroup.ListMasterUserGroupInitial(dataMasterUser)
|
||||
// si := mastermenuusergroup.ListMasterUserGroupInitial(dataUserGroup)
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("LOAD USER GROUP DEV",
|
||||
zap.Any("data", dataMasterUser),
|
||||
zap.Any("data", dataUserGroup),
|
||||
)
|
||||
|
||||
// si := mastermenuusergroup.ListMasterUserGroupInitial(dataMasterUser)
|
||||
|
||||
// si := mastermenuusergroup.ShowMasterMenuUserGroupV1(
|
||||
// "Master Menu",
|
||||
// mastermenuusergroup.ListMasterUserGroupInitial(dataMasterUser),
|
||||
// mastermenuusergroup.CssMasterMenuUserGroupV1(),
|
||||
// mastermenuusergroup.JsMasterMenuUserGroupV1(),
|
||||
// )
|
||||
|
||||
contentID := utils.GenerateRandomID("tablebody")
|
||||
tableID := utils.GenerateRandomID("tablebody")
|
||||
paginationID := utils.GenerateRandomID("paginationid")
|
||||
searchID := utils.GenerateRandomID("searchid")
|
||||
dropdownID := utils.GenerateRandomID("dropdownid")
|
||||
dialogAddID := utils.GenerateRandomID("dialogaddID")
|
||||
dialogAddBodyID := utils.GenerateRandomID("dialogaddbodyID")
|
||||
dialogEditID := utils.GenerateRandomID("dialogEditID")
|
||||
dialogEditBodyID := utils.GenerateRandomID("dialogEditbodyID")
|
||||
dialogdeleteID := utils.GenerateRandomID("dialogdeleteID")
|
||||
dialogdeleteBodyID := utils.GenerateRandomID("dialogdeletebodyID")
|
||||
|
||||
paramTitleBreadcrumbConvert := "Master User"
|
||||
|
||||
@@ -168,25 +187,11 @@ func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserV1(c echo.Context) err
|
||||
return err
|
||||
}
|
||||
|
||||
// si := mastermenuusergroup.ListMasterUserGroupInitial(dataBreadCrumb)
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("LOAD BREADCRUMB DEV",
|
||||
zap.Any("data", dataBreadCrumb),
|
||||
)
|
||||
|
||||
dataUserGroupAll, err := lh.MasterMenuUserService.GetListMasterUserGroupSearch()
|
||||
fmt.Println(dataUserGroupAll)
|
||||
fmt.Println(err)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR LIST USER GROUP ALL DEV",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataUserGroupAll)
|
||||
return err
|
||||
}
|
||||
|
||||
// navbar menu
|
||||
navbarmenuComponent := navbarmenu.NavbarMenu(dataMenu)
|
||||
|
||||
@@ -196,45 +201,99 @@ func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserV1(c echo.Context) err
|
||||
// sidebar
|
||||
sidebaruserprofileComponent := sidebaruserprofile.Navbaruserprofile(dataUser)
|
||||
|
||||
// inputan search
|
||||
// inputansearchComponent := customtextfieldsearch.MainCustomTextFieldSearchV1("q", "Cari Nama Staff / Email", "text", "/dev/searchuserv1", "input changed delay:500ms, search", "#idbaru", "#indicator")
|
||||
// list item
|
||||
dataUserGroupAll, err := lh.MasterMenuUserService.GetListMasterUserGroup()
|
||||
fmt.Println(dataUserGroupAll)
|
||||
fmt.Println(err)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR LIST USER GROUP ALL DEV",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataUserGroupAll)
|
||||
return err
|
||||
}
|
||||
//Component modal add usergroup
|
||||
|
||||
contentIDSearch := utils.GenerateRandomID("qsearch")
|
||||
contentIDDropdown := utils.GenerateRandomID("qdropdown")
|
||||
totalPages := int(math.Ceil(float64(len(dataUserMasterAll)) / float64(rowPerPage)))
|
||||
link := "currentPage=1&page=" + strconv.Itoa(totalPages) + "&contentID=" + contentID
|
||||
modaladdcomponent := mastermenuuser.EmptyDiv1()
|
||||
|
||||
inputansearchComponent := customtextfieldsearch.MainCustomTextFieldSearchV1("#"+contentIDSearch, "q", "Cari Nama Staff / Email", "text", "/dev/searchuserv1?"+link, "input changed delay:500ms, search", "#"+contentID, "#indicator", "", contentIDHtmxExtension, "[name='usergroup']")
|
||||
//Component modal edit usergroup
|
||||
modalEditcomponent := mastermenuuser.EmptyDiv1()
|
||||
|
||||
//Component modal delete usergroup
|
||||
modalDeletecomponent := mastermenuuser.EmptyDiv1()
|
||||
|
||||
//table listing user group component
|
||||
contentUserGroupComponent := mastermenuuser.TableUser(
|
||||
dataUserGroup, tableID,
|
||||
"/dev/usergroupshoweditform",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/usergroupshowdeleteform",
|
||||
"#"+dialogdeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogDeleteBodyID, #dialogDeleteID, #dialogEditBodyID, #dialogEditID")
|
||||
|
||||
//filter user search component
|
||||
// customtextfieldsearch.MainCustomTextFieldSearchV1("#"+contentIDSearch, "q", "Cari Nama Staff / Email", "text", "/dev/searchuserv1?"+link, "input changed delay:500ms, search", "#"+contentID, "#indicator", "", contentIDHtmxExtension, "[name='usergroup']")
|
||||
|
||||
userFilterComp := customtextfieldsearch.MainCustomTextFieldSearchV2(
|
||||
searchID,
|
||||
"search",
|
||||
"Cari Nama Staff / Email",
|
||||
"text",
|
||||
"/dev/searchuserv1",
|
||||
"input changed delay:500ms, search",
|
||||
"#"+paginationID, "", "", "outerHTML",
|
||||
"#tableID, #paginationID, #searchID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID, #dropdownID, [name='usergroup']")
|
||||
|
||||
// filter user group dropdown
|
||||
listItemComponent := mastermenuuser.ItemDropdown(dataUserGroupAll)
|
||||
dropdownComponent := customdropdown.MainCustomDropdown("usergroup", "#"+contentIDDropdown, "#"+contentID, "/dev/searchuserv1?"+link, "#indicator", "change from:select[name='usergroup']", "[name='q']", listItemComponent)
|
||||
|
||||
// toast
|
||||
// contentIDToast := utils.GenerateRandomID("toastmgu")
|
||||
// toastComponent = customtoast.CustomToastV1("", contentIDHtmxExtension)
|
||||
|
||||
// table user group
|
||||
|
||||
searchQueryParam := "&q="
|
||||
tabelusergroupComponent := tablecomponent.TableV2(
|
||||
[]string{"EMAIL", "NAMA STAFF", "USER GROUP", "AKSI"},
|
||||
[]string{"20%", "40%", "20%", "20%"},
|
||||
mastermenuuser.TableRowMasterUserV1(dataMasterUser),
|
||||
pagination.PaginationV1(totalPages, 1, "/dev/userv1pagination", contentID, searchQueryParam),
|
||||
contentID,
|
||||
inputansearchComponent,
|
||||
dropdownComponent,
|
||||
dropdownUserGroupFilterComp := customdropdown.MainCustomDropdownV1(
|
||||
"usergroup",
|
||||
dropdownID,
|
||||
"#"+paginationID,
|
||||
"/dev/searchuserv1",
|
||||
"",
|
||||
"change from:select[name='usergroup'], input changed from:input[name='search']",
|
||||
"#tableID, #paginationID, #searchID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID, #dropdownID, [name='search']",
|
||||
listItemComponent,
|
||||
)
|
||||
|
||||
si := mastermenuusergroup.ShowMasterMenuUserGroupV1x(
|
||||
// pagination usergroup component
|
||||
userGroupPaginationComponent := pagination.PaginationV2(
|
||||
totalpage,
|
||||
1,
|
||||
"/dev/userv1pagination",
|
||||
paginationID,
|
||||
"#tableID, #searchID, #"+searchID+", #dropdownID, #"+dropdownID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID, [name='search'], [name='usergroup']",
|
||||
"#"+paginationID,
|
||||
"outerHTML", "", "",
|
||||
)
|
||||
|
||||
//Show user group screen
|
||||
si := mastermenuuser.ShowMasterMenuUserV1x(
|
||||
"Master Menu",
|
||||
mastermenuusergroup.ContentMasterMenuUserGroupV1(
|
||||
contentID,
|
||||
mastermenuuser.ContentMasterMenuUserV1(
|
||||
tableID,
|
||||
paginationID,
|
||||
searchID,
|
||||
dropdownID,
|
||||
dialogAddID,
|
||||
dialogAddBodyID,
|
||||
dialogEditID,
|
||||
dialogEditBodyID,
|
||||
dialogdeleteID,
|
||||
dialogdeleteBodyID,
|
||||
breadcrumbadmin.MainBreadcrumbAdminV1(dataBreadCrumb),
|
||||
tabelusergroupComponent,
|
||||
inputansearchComponent,
|
||||
// toastComponent,
|
||||
// contentIDToast,
|
||||
contentUserGroupComponent,
|
||||
userFilterComp,
|
||||
dropdownUserGroupFilterComp,
|
||||
userGroupPaginationComponent,
|
||||
modaladdcomponent,
|
||||
modalEditcomponent,
|
||||
modalDeletecomponent,
|
||||
),
|
||||
|
||||
mastermenuusergroup.CssMasterMenuUserGroupV1x(),
|
||||
@@ -247,228 +306,58 @@ func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserV1(c echo.Context) err
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
// SEARCH PROSES
|
||||
func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserSearchV1(c echo.Context) error {
|
||||
search := c.QueryParam("q")
|
||||
searchDropdownParam := c.QueryParam("usergroup")
|
||||
var searchDropdown string = ""
|
||||
if searchDropdownParam != "0" {
|
||||
searchDropdown = searchDropdownParam
|
||||
}
|
||||
search := c.QueryParam("search")
|
||||
usergroup := c.QueryParam("usergroup")
|
||||
searchID := c.QueryParam("searchID")
|
||||
dropdownID := c.QueryParam("dropdownID")
|
||||
tableID := c.QueryParam("tableID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
dialogEditBodyID := c.QueryParam("dialogEditBodyID")
|
||||
// dialogEditID := c.QueryParam("dialogEditID")
|
||||
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
|
||||
// dialogDeleteID := c.QueryParam("dialogDeleteID")
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
// dataUserMaster, err := lh.MasterMenuUserService.GetListMasterUserBySearch(search)
|
||||
rowPerPage := 2
|
||||
pageparam := c.QueryParam("page")
|
||||
page, err := strconv.Atoi(pageparam)
|
||||
dataUserGroup, totalpage, err := lh.MasterMenuUserService.GetListMasterUserV2(search, usergroup, 1, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR CONVERT PAGE PARAM",
|
||||
zap.Any("page", page),
|
||||
zap.Any("error ", err),
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
currentPageParam := c.QueryParam("currentPage")
|
||||
currentPage, err := strconv.Atoi(currentPageParam)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR CONVERT CURRENT PAGE PARAM",
|
||||
zap.Any("page", page),
|
||||
zap.Any("error ", err),
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
dataUserMaster, err := lh.MasterMenuUserService.GetListMasterUserPagination(search, searchDropdown, currentPage, rowPerPage)
|
||||
fmt.Println(dataUserMaster)
|
||||
fmt.Println(err)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR SEARCH USER MASTER DEV",
|
||||
logger.Info("ERROR GET USER GROUP",
|
||||
zap.Any("error", err),
|
||||
zap.Any("search param", search),
|
||||
)
|
||||
fmt.Println(dataUserMaster)
|
||||
fmt.Println(dataUserGroup)
|
||||
return err
|
||||
}
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("LOAD USER MASTER DEV BY SEARCH",
|
||||
zap.Any("data", dataUserMaster),
|
||||
// totalPages := int(math.Ceil(float64(len(dataUserGroupFiltered)) / float64(rowPerPage)))
|
||||
|
||||
contentUserGroupComponent := mastermenuuser.TableUser(
|
||||
dataUserGroup, tableID, "/dev/usergroupshoweditform",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/usergroupshowdeleteform",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogDeleteBodyID, #dialogDeleteID, #dialogEditBodyID, #dialogEditID")
|
||||
|
||||
userGroupPaginationComponent := pagination.PaginationV2(totalpage,
|
||||
1,
|
||||
"/dev/userv1pagination",
|
||||
paginationID,
|
||||
"#tableID, #searchID, #"+searchID+", #dropdownID, #"+dropdownID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID, [name='search'], [name='usergroup']",
|
||||
"#"+paginationID,
|
||||
"outerHTML",
|
||||
"",
|
||||
"",
|
||||
)
|
||||
|
||||
// data user filtered
|
||||
dataUserMasterFiltered, err := lh.MasterMenuUserService.GetListMasterUserFilteredBySearch(search, searchDropdown)
|
||||
fmt.Println(dataUserMasterFiltered)
|
||||
fmt.Println(err)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR SEARCH USER MASTER FILTERED BY SEARCH DEV",
|
||||
zap.Any("error", err),
|
||||
zap.Any("search param", search),
|
||||
)
|
||||
fmt.Println(dataUserMasterFiltered)
|
||||
return err
|
||||
}
|
||||
// swapTable :=
|
||||
// mastermenuusergroup.SwapTableUserGroup(userGroupPaginationComponent, contentUserGroupComponent)
|
||||
retval := []templ.Component{contentUserGroupComponent, userGroupPaginationComponent}
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("LOAD SEARCH USER MASTER FILTERED BY SEARCH DEV",
|
||||
zap.Any("data", dataUserMasterFiltered),
|
||||
)
|
||||
// si := mastermenuusergroup.ListMasterUserGroupInitial(dataUserMaster)
|
||||
|
||||
contentID := utils.GenerateRandomID("tablebody")
|
||||
|
||||
// tabelusergroupComponent := mastermenuusergroup.TableRowV1(dataUserMaster)
|
||||
totalPages := int(math.Ceil(float64(len(dataUserMasterFiltered)) / float64(rowPerPage)))
|
||||
searchQueryParam := "&q=" + search + "&usergroup=" + searchDropdown
|
||||
|
||||
// contentIDSearch := utils.GenerateRandomID("qsearch")
|
||||
// link := "currentPage=1&page=" + strconv.Itoa(totalPages) + "&contentID=" + contentID
|
||||
|
||||
// contentIDHtmxExtension := utils.GenerateRandomID("htmxExtmgu")
|
||||
// inputansearchComponent := customtextfieldsearch.MainCustomTextFieldSearchV1("#"+contentIDSearch, "q", "Cari Nama Staff / Email", "text", "/dev/searchuserv1?"+link, "input changed delay:500ms, search", "#"+contentID, "#indicator", search, contentIDHtmxExtension)
|
||||
|
||||
inputansearchComponent := tablecomponent.DivEmpty()
|
||||
tabelusergroupComponent := tablecomponent.TableV2(
|
||||
[]string{"EMAIL", "NAMA STAFF", "USER GROUP", "AKSI"},
|
||||
[]string{"20%", "40%", "20%", "20%"},
|
||||
mastermenuuser.TableRowMasterUserV1(dataUserMaster),
|
||||
pagination.PaginationV1(totalPages, 1, "/dev/userv1pagination", contentID, searchQueryParam),
|
||||
contentID,
|
||||
inputansearchComponent,
|
||||
tablecomponent.DivEmpty(),
|
||||
)
|
||||
|
||||
si := tabelusergroupComponent
|
||||
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserPaginationV1(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
search := c.QueryParam("q")
|
||||
searchDropdownParam := c.QueryParam("usergroup")
|
||||
var searchDropdown string = ""
|
||||
if searchDropdownParam != "0" {
|
||||
searchDropdown = searchDropdownParam
|
||||
}
|
||||
|
||||
pageparam := c.QueryParam("page")
|
||||
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
|
||||
}
|
||||
|
||||
dataUserMasterAll, err := lh.MasterMenuUserService.GetListMasterUser(searchDropdown)
|
||||
fmt.Println(dataUserMasterAll)
|
||||
fmt.Println(err)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR LIST USER MASTER ALL DEV",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataUserMasterAll)
|
||||
return err
|
||||
}
|
||||
|
||||
currentPageParam := c.QueryParam("currentPage")
|
||||
currentPage, err := strconv.Atoi(currentPageParam)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR CONVERT CURRENT PAGE PARAM",
|
||||
zap.Any("page", page),
|
||||
zap.Any("error ", err),
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
rowPerPage := 2
|
||||
dataUserMaster, err := lh.MasterMenuUserService.GetListMasterUserPagination(search, searchDropdown, currentPage, rowPerPage)
|
||||
fmt.Println(dataUserMaster)
|
||||
fmt.Println(err)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR SEARCH USER MASTER DEV",
|
||||
zap.Any("error", err),
|
||||
zap.Any("search param", search),
|
||||
)
|
||||
fmt.Println(dataUserMaster)
|
||||
return err
|
||||
}
|
||||
|
||||
// si := mastermenuusergroup.ListMasterUserGroupInitial(dataUserMaster)
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("LOAD USER MASTER DEV BY SEARCH",
|
||||
zap.Any("data", dataUserMaster),
|
||||
)
|
||||
|
||||
// data user filtered
|
||||
dataUserMasterFiltered, err := lh.MasterMenuUserService.GetListMasterUserFilteredBySearch(search, searchDropdown)
|
||||
fmt.Println(dataUserMasterFiltered)
|
||||
fmt.Println(err)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR SEARCH USER MASTER FILTERED BY SEARCH DEV",
|
||||
zap.Any("error", err),
|
||||
zap.Any("search param", search),
|
||||
)
|
||||
fmt.Println(dataUserMasterFiltered)
|
||||
return err
|
||||
}
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("LOAD SEARCH USER MASTER FILTERED BY SEARCH DEV",
|
||||
zap.Any("data", dataUserMasterFiltered),
|
||||
)
|
||||
|
||||
contentID := utils.GenerateRandomID("tablebody")
|
||||
|
||||
// table user group
|
||||
searchQueryParam := "&q=" + search + "&usergroup=" + searchDropdown
|
||||
totalPages := int(math.Ceil(float64(len(dataUserMasterFiltered)) / float64(rowPerPage)))
|
||||
// contentIDSearch := utils.GenerateRandomID("qsearch")
|
||||
// link := "currentPage=1&page=" + strconv.Itoa(totalPages) + "&contentID=" + contentID
|
||||
|
||||
// contentIDHtmxExtension := utils.GenerateRandomID("htmxExtmgu")
|
||||
// inputansearchComponent := customtextfieldsearch.MainCustomTextFieldSearchV1("#"+contentIDSearch, "q", "Cari Nama Staff / Email", "text", "/dev/searchuserv1?"+link, "input changed delay:500ms, search", "#"+contentID, "#indicator", search, contentIDHtmxExtension)
|
||||
|
||||
inputansearchComponent := tablecomponent.DivEmpty()
|
||||
tabelusergroupComponent := tablecomponent.TableV2(
|
||||
[]string{"EMAIL", "NAMA STAFF", "USER GROUP", "AKSI"},
|
||||
[]string{"20%", "40%", "20%", "20%"},
|
||||
mastermenuuser.TableRowMasterUserV1(dataUserMaster),
|
||||
pagination.PaginationV1(totalPages, currentPage, "/dev/userv1pagination", contentID, searchQueryParam),
|
||||
contentID,
|
||||
inputansearchComponent,
|
||||
tablecomponent.DivEmpty(),
|
||||
)
|
||||
|
||||
// tabelusergroupComponent := mastermenuusergroup.TableRowV1(dataUserMaster)
|
||||
|
||||
si := tabelusergroupComponent
|
||||
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
// versi 2
|
||||
func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserSearch(c echo.Context) error {
|
||||
idUserGroupSelected := c.Param("idUserGroup")
|
||||
|
||||
if idUserGroupSelected != "0" {
|
||||
|
||||
}
|
||||
|
||||
si := tablecomponent.DivEmpty()
|
||||
|
||||
return utils.View(c, si)
|
||||
return utils.ViewMulti(c, retval)
|
||||
// return utils.View(c, si)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
69
handlers/dev/xtemplmulti.handlers.go
Normal file
69
handlers/dev/xtemplmulti.handlers.go
Normal file
@@ -0,0 +1,69 @@
|
||||
package dev_handlers
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
"html/template"
|
||||
"strings"
|
||||
|
||||
xtemplmulti "cpone/views/dev/xtemplmulti"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type XTemplMultiService interface {
|
||||
}
|
||||
|
||||
func NewXTemplMultiHandler(us XTemplMultiService) *XTemplMultiHandler {
|
||||
return &XTemplMultiHandler{
|
||||
XTemplMultiService: us,
|
||||
}
|
||||
}
|
||||
|
||||
type XTemplMultiHandler struct {
|
||||
XTemplMultiService XTemplMultiService
|
||||
}
|
||||
|
||||
func (lh *MasterMenuUserGroupHandler) HandlerXTemplMulti(c echo.Context) error {
|
||||
var arrTempl []models.XtemplModel
|
||||
// toastComponent := customtoastv2.CustomToastV2Show("sukses", "halo", "warning")
|
||||
|
||||
newItem := models.XtemplModel{
|
||||
NameTempl: "Komponen 1",
|
||||
HtmlString: "<div style='background-color:red;'>Komponen 1<div>"}
|
||||
|
||||
newItem2 := models.XtemplModel{
|
||||
NameTempl: "Komponen 2",
|
||||
HtmlString: "<div style='background-color:purple;'>Komponen 2<div>"}
|
||||
|
||||
arrTempl = append(arrTempl, newItem, newItem2)
|
||||
|
||||
var stringx string
|
||||
|
||||
for _, item := range arrTempl {
|
||||
stringx += item.HtmlString
|
||||
}
|
||||
|
||||
tpl := template.Must(template.New("index").Parse(stringx))
|
||||
|
||||
var stringBuilder strings.Builder
|
||||
if err := tpl.Execute(&stringBuilder, arrTempl); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
newItemFix := models.XtemplModel{
|
||||
NameTempl: "Template Gabungan",
|
||||
HtmlString: stringBuilder.String(),
|
||||
}
|
||||
|
||||
arrTemplFix := []models.XtemplModel{newItemFix}
|
||||
|
||||
var templx []templ.Component
|
||||
si := xtemplmulti.MainXTemplMulti(arrTemplFix)
|
||||
templx = append(templx, si)
|
||||
templx = append(templx, si)
|
||||
|
||||
// return utils.View(c, si)
|
||||
return utils.ViewMulti(c, templx)
|
||||
}
|
||||
118
handlers/public/kartukontrol.handlers.go
Normal file
118
handlers/public/kartukontrol.handlers.go
Normal file
@@ -0,0 +1,118 @@
|
||||
package public_handlers
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
kartukontrol "cpone/views/public/kartukontrol"
|
||||
public_toast "cpone/views/public/toast"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type KartuKontrolService interface {
|
||||
GetkartuKontrolById(nomorRegistrasi string) ([]models.KartuKontrolModel, error)
|
||||
}
|
||||
|
||||
func NewKartuKontrolHandler(us KartuKontrolService) *KartuKontrolHandler {
|
||||
return &KartuKontrolHandler{
|
||||
KartuKontrolService: us,
|
||||
}
|
||||
}
|
||||
|
||||
type KartuKontrolHandler struct {
|
||||
KartuKontrolService KartuKontrolService
|
||||
}
|
||||
|
||||
func (lh *KartuKontrolHandler) HandlerHideToast(c echo.Context) error {
|
||||
toastComponent := public_toast.PublicToastV1KartuKontrolHide()
|
||||
|
||||
si := toastComponent
|
||||
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
func (lh *KartuKontrolHandler) HandlerShowKartuKontrol(c echo.Context) error {
|
||||
|
||||
var flagxError bool = true
|
||||
var msgx string = ""
|
||||
|
||||
nomorRegistrasi := c.Param("nomorRegistrasi")
|
||||
|
||||
urlSurveyMcu := "redirectsurveymcu"
|
||||
|
||||
// urlSurveyMcu := "redirectsurveymcu"
|
||||
|
||||
// nomorRegistrasi := "1"
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
|
||||
dataKartuKontrol, err := lh.KartuKontrolService.GetkartuKontrolById(nomorRegistrasi)
|
||||
|
||||
if err != nil {
|
||||
logger.Info("Error",
|
||||
zap.Any("Error", err),
|
||||
zap.Any("prm", nomorRegistrasi),
|
||||
)
|
||||
// return err
|
||||
if flagxError {
|
||||
msgx = "Error Get Kartu Kontrol"
|
||||
si := public_toast.PublicToastV1KartuKontrolShow("Error", msgx, "danger")
|
||||
return utils.View(c, si)
|
||||
}
|
||||
}
|
||||
logger.Info("SHOW DATA KARTU KONTROL handler",
|
||||
zap.Any("return", dataKartuKontrol),
|
||||
zap.Any("prm", nomorRegistrasi),
|
||||
)
|
||||
|
||||
flagxError = false
|
||||
var si templ.Component
|
||||
var isShowSurveyMcu bool = true
|
||||
|
||||
if isShowSurveyMcu {
|
||||
si = kartukontrol.ShowKartuKontrol("Kartu Kontrol", kartukontrol.MainContentKartuKontrolLayout(dataKartuKontrol, "/modalsurveykartukontrol", "load delay:3s", "modalWordingSurveyMcu", urlSurveyMcu, nomorRegistrasi), kartukontrol.CssKartuKontrol(), kartukontrol.JsKartuKontrol())
|
||||
} else {
|
||||
si = kartukontrol.ShowKartuKontrol("Kartu Kontrol",
|
||||
kartukontrol.MainContentKartuKontrolLayout(dataKartuKontrol, "", "", "modalWordingSurveyMcu", urlSurveyMcu, nomorRegistrasi), kartukontrol.CssKartuKontrol(), kartukontrol.JsKartuKontrol())
|
||||
}
|
||||
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
func (lh *KartuKontrolHandler) HandlerShowWordingModalSurveyMcu(c echo.Context) error {
|
||||
|
||||
stringUrlToSurveyMcu := c.QueryParam("urlSurveyMcu")
|
||||
|
||||
// var dataKartuKontrol []models.KartuKontrolModel
|
||||
si := kartukontrol.ShowKartuKontrol(
|
||||
"Kartu Kontrol",
|
||||
kartukontrol.ModalMcuWordingShow("modalWordingSurveyMcu", "Silahkan isi questioner untuk membantu peningkatan layanan kami. Terima kasih.", stringUrlToSurveyMcu), kartukontrol.CssKartuKontrol(), kartukontrol.JsKartuKontrol())
|
||||
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
func (lh *KartuKontrolHandler) HandlerRedirectToSurveyMcu(c echo.Context) error {
|
||||
|
||||
nomorRegistrasi := c.QueryParam("nomorRegistrasi")
|
||||
stringUrlToSurveyMcu := "/surveymcu/" + nomorRegistrasi
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
|
||||
if len(stringUrlToSurveyMcu) > 0 {
|
||||
// redirect ke kartu kontrol
|
||||
logger.Info("redirect SURVEY MCU",
|
||||
zap.Any("redirect SURVEY MCU", stringUrlToSurveyMcu),
|
||||
)
|
||||
c.Response().Header().Set("HX-Redirect", stringUrlToSurveyMcu)
|
||||
// return c.NoContent(http.StatusOK)
|
||||
}
|
||||
|
||||
si := kartukontrol.ShowKartuKontrol(
|
||||
"Kartu Kontrol",
|
||||
kartukontrol.ModalMcuWordingShow("modalWordingSurveyMcu", "Silahkan isi questioner untuk membantu peningkatan layanan kami. Terima kasih.", ""), kartukontrol.CssKartuKontrol(), kartukontrol.JsKartuKontrol())
|
||||
|
||||
return utils.View(c, si)
|
||||
}
|
||||
194
handlers/public/surveymcu.handlers.go
Normal file
194
handlers/public/surveymcu.handlers.go
Normal file
@@ -0,0 +1,194 @@
|
||||
package public_handlers
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
surveymcu "cpone/views/public/surveymcu"
|
||||
public_toast "cpone/views/public/toast"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type SurveyMcuService interface {
|
||||
GetSurveyMcuByNoreg(nomorRegistrasi string) ([]models.SurveyMcu, error)
|
||||
}
|
||||
|
||||
func NewSurveyMcuHandler(us SurveyMcuService) *SurveyMcuHandler {
|
||||
return &SurveyMcuHandler{
|
||||
SurveyMcuService: us,
|
||||
}
|
||||
}
|
||||
|
||||
type SurveyMcuHandler struct {
|
||||
SurveyMcuService SurveyMcuService
|
||||
}
|
||||
|
||||
func (lh *SurveyMcuHandler) HandlerShowSurveyMcu(c echo.Context) error {
|
||||
|
||||
var flagxError bool = true
|
||||
var msgx string = ""
|
||||
|
||||
nomorRegistrasi := c.Param("nomorRegistrasi")
|
||||
// nomorRegistrasi := "1"
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
|
||||
dataSurveyMcu, err := lh.SurveyMcuService.GetSurveyMcuByNoreg(nomorRegistrasi)
|
||||
|
||||
if err != nil {
|
||||
logger.Info("Error",
|
||||
zap.Any("Error", err),
|
||||
zap.Any("prm", nomorRegistrasi),
|
||||
)
|
||||
// return err
|
||||
if flagxError {
|
||||
msgx = "Error Get Survey MCU By No Reg"
|
||||
si := public_toast.PublicToastV1KartuKontrolShow("Error", msgx, "danger")
|
||||
return utils.View(c, si)
|
||||
}
|
||||
}
|
||||
|
||||
flagxError = false
|
||||
logger.Info("SHOW DATA SURVEY MCU handler",
|
||||
zap.Any("return", dataSurveyMcu),
|
||||
zap.Any("prm", nomorRegistrasi),
|
||||
)
|
||||
|
||||
stringUrl := "surveymcuproses/" + nomorRegistrasi
|
||||
var hxInclude string = ""
|
||||
var idClearMsg []models.IdClearErrorMessage
|
||||
|
||||
if len(dataSurveyMcu) > 0 {
|
||||
hxInclude = utils.ConcatHxIncludeSurveyMcu(dataSurveyMcu)
|
||||
}
|
||||
|
||||
si := surveymcu.ShowSurveyMcu("Survey Mcu",
|
||||
surveymcu.MainContentSurveyMcuLayout(dataSurveyMcu, stringUrl, surveymcu.ErrorMessageSurveyMcu("", "", idClearMsg, "alertSaranMcu", public_toast.PublicToastV1KartuKontrolHide()), hxInclude), surveymcu.CssSurveyMcu(), surveymcu.JsSurveyMcu())
|
||||
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
func (lh *SurveyMcuHandler) HandlerProcessSurveyMcu(c echo.Context) error {
|
||||
|
||||
var flagxError bool = true
|
||||
var msgx string = ""
|
||||
|
||||
nomorRegistrasi := c.Param("nomorRegistrasi")
|
||||
stringUrlBackToKartuKontrol := "/kartukontrol/" + nomorRegistrasi
|
||||
// nomorRegistrasi := "1"
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
|
||||
dataSurveyMcu, err := lh.SurveyMcuService.GetSurveyMcuByNoreg(nomorRegistrasi)
|
||||
|
||||
if err != nil {
|
||||
logger.Info("Error",
|
||||
zap.Any("Error", err),
|
||||
zap.Any("prm", nomorRegistrasi),
|
||||
)
|
||||
// return err
|
||||
if flagxError {
|
||||
msgx = "Error Get Survey MCU By No Reg"
|
||||
si := public_toast.PublicToastV1KartuKontrolShow("Error", msgx, "danger")
|
||||
return utils.View(c, si)
|
||||
}
|
||||
}
|
||||
|
||||
logger.Info("SHOW DATA SURVEY MCU handler",
|
||||
zap.Any("return", dataSurveyMcu),
|
||||
zap.Any("prm", nomorRegistrasi),
|
||||
)
|
||||
|
||||
// form := c.Request().PostForm
|
||||
|
||||
// stringUrl := "surveymcuproses/" + nomorRegistrasi
|
||||
|
||||
logger.Info("CEK POST handler",
|
||||
zap.Any("c.FormValue Saran", c.FormValue("saranmcu-11")),
|
||||
)
|
||||
|
||||
// proses validasi
|
||||
|
||||
var si templ.Component
|
||||
var idFormKosong string = ""
|
||||
var stringMessage string = ""
|
||||
var isFormEmpty bool = false
|
||||
var idClearMsg []models.IdClearErrorMessage
|
||||
var idSaranMcuAlert string = ""
|
||||
// var idSaranMcuClear string = ""
|
||||
|
||||
hasError := false
|
||||
|
||||
if len(dataSurveyMcu) > 0 {
|
||||
for _, v := range dataSurveyMcu {
|
||||
// radio button
|
||||
if len(v.DataListItemSurveyMcu) > 0 {
|
||||
for _, x := range v.DataListItemSurveyMcu {
|
||||
|
||||
if len(c.FormValue("radio-"+x.IDItemSurvey)) > 0 {
|
||||
idClearMsg = append(idClearMsg, models.IdClearErrorMessage{IdItem: x.IDItemSurvey})
|
||||
}
|
||||
|
||||
if "default-"+x.NameRadioButton == c.FormValue("default-"+x.NameRadioButton) && len(c.FormValue("radio-"+x.IDItemSurvey)) == 0 {
|
||||
stringMessage = "Pertanyaan ke-" + x.IDItemSurvey + " wajib diisi"
|
||||
idFormKosong = utils.GetIdSurveyMcu(x.IDItemSurvey)
|
||||
isFormEmpty = true
|
||||
hasError = true
|
||||
flagxError = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if hasError {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// saran mcu
|
||||
if !hasError && len(dataSurveyMcu) > 0 {
|
||||
for _, v := range dataSurveyMcu {
|
||||
if len(v.DataListItemSurveyMcuSaran) > 0 {
|
||||
for _, x := range v.DataListItemSurveyMcuSaran {
|
||||
if len(c.FormValue("saranmcu-"+x.IDItemSurveyMcuSaran)) > 0 {
|
||||
idClearMsg = append(idClearMsg, models.IdClearErrorMessage{IdItem: x.IDItemSurveyMcuSaran})
|
||||
}
|
||||
|
||||
if "default-"+x.NameSurveyMcuSaran == c.FormValue("default-"+x.NameSurveyMcuSaran) && len(c.FormValue("saranmcu-"+x.IDItemSurveyMcuSaran)) == 0 {
|
||||
stringMessage = "Saran Wajib Diisi"
|
||||
idFormKosong = utils.GetIdSurveyMcu(x.IDItemSurveyMcuSaran)
|
||||
isFormEmpty = true
|
||||
hasError = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if hasError {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if isFormEmpty {
|
||||
// if flagxError {
|
||||
// msgx = "Error Get Survey MCU By No Reg"
|
||||
// si := public_toast.PublicToastV1KartuKontrolShow("Error", msgx, "danger")
|
||||
// return utils.View(c, si)
|
||||
// }
|
||||
si = surveymcu.ErrorMessageSurveyMcu(stringMessage, idFormKosong, idClearMsg, idSaranMcuAlert, public_toast.PublicToastV1KartuKontrolShow("Warning", stringMessage, "warning"))
|
||||
} else {
|
||||
flagxError = false
|
||||
si = surveymcu.ErrorMessageSurveyMcu("", "", idClearMsg, "", public_toast.PublicToastV1KartuKontrolHide())
|
||||
logger.Info("redirect",
|
||||
zap.Any("redirect", stringUrlBackToKartuKontrol),
|
||||
)
|
||||
|
||||
// redirect ke kartu kontrol
|
||||
c.Response().Header().Set("HX-Redirect", stringUrlBackToKartuKontrol)
|
||||
}
|
||||
|
||||
return utils.View(c, si)
|
||||
}
|
||||
73
handlers/public/tools.handler.go
Normal file
73
handlers/public/tools.handler.go
Normal file
@@ -0,0 +1,73 @@
|
||||
package public_handlers
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
"cpone/views/dev/mastermenuusergroup"
|
||||
|
||||
tablecomponent "cpone/component/table"
|
||||
|
||||
public_toast "cpone/views/public/toast"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type ToolsService interface {
|
||||
}
|
||||
|
||||
func NewToolsHandler(us ToolsService) *ToolsHandler {
|
||||
return &ToolsHandler{
|
||||
ToolsService: us,
|
||||
}
|
||||
}
|
||||
|
||||
type ToolsHandler struct {
|
||||
ToolsService ToolsService
|
||||
}
|
||||
|
||||
func (lh *ToolsHandler) HandlerHideToast(c echo.Context) error {
|
||||
toastComponent := public_toast.PublicToastV1Hide()
|
||||
|
||||
si := toastComponent
|
||||
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
func (lh *ToolsHandler) HandlerShowToast(c echo.Context) error {
|
||||
|
||||
inputansearchComponent := tablecomponent.DivEmpty()
|
||||
// toastComponent := public_toast.PublicToastV1Show("Success", "Success Loaded", "success")
|
||||
pagination := tablecomponent.DivEmpty()
|
||||
|
||||
dummyData := []models.UserGroupV1{
|
||||
{
|
||||
Nomor: "1",
|
||||
M_UserGroupID: 1,
|
||||
M_UserGroupCode: "group1",
|
||||
M_UserGroupName: "Group 1",
|
||||
M_UserGroupCreated: "2024-05-16",
|
||||
M_UserGroupLastUpdated: "2024-05-16",
|
||||
M_UserGroupIsActive: "Active",
|
||||
},
|
||||
}
|
||||
|
||||
tabelusergroupComponent := tablecomponent.TableV2(
|
||||
[]string{"KODE", "USERGROUP", "AKSI"},
|
||||
[]string{"40%", "40%", "20%"},
|
||||
mastermenuusergroup.TableRowV1(dummyData, "", "", "", "", "", "", "", ""),
|
||||
pagination,
|
||||
"",
|
||||
inputansearchComponent,
|
||||
)
|
||||
|
||||
si := public_toast.ShowToast("",
|
||||
tabelusergroupComponent,
|
||||
tabelusergroupComponent,
|
||||
tabelusergroupComponent,
|
||||
tabelusergroupComponent,
|
||||
tabelusergroupComponent,
|
||||
tabelusergroupComponent,
|
||||
)
|
||||
|
||||
return utils.View(c, si)
|
||||
}
|
||||
@@ -46,8 +46,6 @@ func SetupRoutesLandingPage(app *echo.Echo, h *dev_handlers.LandingPageHandler,
|
||||
// autocomplete.GET("/autocomplete", mastermenuusergroupHandler.HandlerListAutoComplete)
|
||||
// autocomplete.GET("/autoCompleteLoadMore/:pageOf/:searchParam/:limit", mastermenuusergroupHandler.HandlerListAutoCompleteLoadMore)
|
||||
// autocomplete.GET("/autoCompleteSetValue/:setvalue", mastermenuusergroupHandler.HandlerListAutoCompleteAfterSelected)
|
||||
clientgroup.GET("/usergroup/edit", mastermenuusergroupHandler.ChangeFormEdit)
|
||||
clientgroup.GET("/usergroup/pagination", mastermenuusergroupHandler.HandleChangePage)
|
||||
|
||||
}
|
||||
func SetupRoutesPieChart(app *echo.Echo, h *dev_handlers.PiechartHandler) {
|
||||
@@ -70,6 +68,26 @@ func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) {
|
||||
public.GET("landingpage", lh.ShowLandingPage)
|
||||
loginHdr := public_handlers.NewLoginHandler(l)
|
||||
public.GET("login", loginHdr.HandlerShowLogin)
|
||||
|
||||
// kartu kontrol
|
||||
publicKartuKontrolServices := public_services.NewServicesKartuKontrol(appStore)
|
||||
publicKartuKontrolhandlers := public_handlers.NewKartuKontrolHandler(publicKartuKontrolServices)
|
||||
public.GET("kartukontrol/:nomorRegistrasi", publicKartuKontrolhandlers.HandlerShowKartuKontrol)
|
||||
public.GET("modalsurveykartukontrol", publicKartuKontrolhandlers.HandlerShowWordingModalSurveyMcu)
|
||||
|
||||
// survey mcu page (pertanyaan dan jawaban)
|
||||
publicSurveyMcuServices := public_services.NewServicesSurveyMcu(appStore)
|
||||
publicSurveyMcuhandlers := public_handlers.NewSurveyMcuHandler(publicSurveyMcuServices)
|
||||
public.GET("surveymcu/:nomorRegistrasi", publicSurveyMcuhandlers.HandlerShowSurveyMcu)
|
||||
|
||||
// hide toast
|
||||
public.GET("hidetoastkartukontrol", publicKartuKontrolhandlers.HandlerHideToast)
|
||||
|
||||
// surveymcuproses
|
||||
public.POST("surveymcuproses/:nomorRegistrasi", publicSurveyMcuhandlers.HandlerProcessSurveyMcu)
|
||||
|
||||
// redirect to survey mcu page
|
||||
public.GET("redirectsurveymcu", publicKartuKontrolhandlers.HandlerRedirectToSurveyMcu)
|
||||
}
|
||||
func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) {
|
||||
public := app.Group("/corp")
|
||||
@@ -187,29 +205,38 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
|
||||
//DEV USERGROUP
|
||||
devUGServices := dev_services.NewServicesMasterMenuUserGroup(appStore)
|
||||
devUGhandlers := dev_handlers.NewMasterMenuUserGroupHandler(devUGServices)
|
||||
dev.GET("/usergroup", devUGhandlers.HandlerShowMasterMenuUserGroup)
|
||||
dev.GET("/usergroup/pagination", devUGhandlers.HandleChangePage)
|
||||
// dev.GET("/usergroup", devUGhandlers.HandlerShowMasterMenuUserGroup)
|
||||
// dev.GET("/usergroup/pagination", devUGhandlers.HandleChangePage)
|
||||
dev.POST("/usergroup/add", devUGhandlers.AddUserGroup)
|
||||
dev.POST("/usergroup/edit", devUGhandlers.EditUserGroup)
|
||||
dev.GET("/usergroup/delete/:id", devUGhandlers.DeleteUserGroup)
|
||||
dev.POST("/usergroup/delete", devUGhandlers.DeleteUserGroup)
|
||||
|
||||
// try
|
||||
dev.GET("/usergroupv1", devUGhandlers.HandlerShowMasterMenuUserGroupV1)
|
||||
dev.GET("/breadcrumbv1", devUGhandlers.HandlerShowBreadCrumbV1)
|
||||
dev.GET("/searchusergroupv1", devUGhandlers.HandlerShowMasterMenuUserGroupSearchV1)
|
||||
dev.GET("/usergroupv1pagination", devUGhandlers.HandlerShowMasterMenuUserGroupPaginationV1)
|
||||
dev.POST("/usergrouphandlecloseform", devUGhandlers.HandleCloseForm)
|
||||
dev.POST("/usergrouphandlecloseformedit", devUGhandlers.HandleCloseFormEdit)
|
||||
dev.POST("/usergrouphandlecloseformdelete", devUGhandlers.HandleCloseFormDelete)
|
||||
dev.GET("/usergroupshoweditform", devUGhandlers.HandleEditForm)
|
||||
dev.GET("/usergroupshowdeleteform", devUGhandlers.HandleDeleteForm)
|
||||
|
||||
//ugcobanady
|
||||
dev.GET("/usergrouptryandy", devUGhandlers.HandlerShowMasterMenuUserGroupTryAndy)
|
||||
|
||||
dev.GET("/hidetoast", devUGhandlers.HandlerHideToast)
|
||||
|
||||
dev.GET("/xtemplmulti", devUGhandlers.HandlerXTemplMulti)
|
||||
|
||||
// clientgroup.GET("/usergroup/edit", mastermenuusergroupHandler.ChangeFormEdit)
|
||||
// clientgroup.GET("/usergroup/pagination", mastermenuusergroupHandler.HandleChangePage)
|
||||
|
||||
// master user
|
||||
devUserServices := dev_services.NewServicesMasterMenuUser(appStore)
|
||||
devUserhandlers := dev_handlers.NewMasterMenuUserHandler(devUserServices)
|
||||
dev.GET("/userv1", devUserhandlers.HandlerShowMasterMenuUserV1)
|
||||
dev.GET("/searchuserv1", devUserhandlers.HandlerShowMasterMenuUserSearchV1)
|
||||
dev.GET("/userv1pagination", devUserhandlers.HandlerShowMasterMenuUserPaginationV1)
|
||||
// dev.GET("/dropdownusergroupselected", )
|
||||
// dev master user
|
||||
devUSServices := dev_services.NewServicesMasterMenuUser(appStore)
|
||||
devUShandlers := dev_handlers.NewMasterMenuUserHandler(devUSServices)
|
||||
dev.GET("/userv1", devUShandlers.HandlerShowMasterMenuUserV1)
|
||||
dev.GET("/searchuserv1", devUShandlers.HandlerShowMasterMenuUserSearchV1)
|
||||
dev.GET("/userv1pagination", devUShandlers.HandlerShowMasterMenuUserPaginationV1)
|
||||
// dev.GET("/breadcrumbv1", devUShandlers)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package layout
|
||||
|
||||
// LAYOUT PLAYGROUND
|
||||
templ CorporateLayout(title string, css templ.Component, js templ.Component, navbarmenu templ.Component,
|
||||
templ CorporateLayout(title string, css templ.Component, js templ.Component, navbarmenu templ.Component,
|
||||
navbaruser templ.Component, sidebaruserprofile templ.Component) {
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
@@ -223,6 +223,30 @@ templ CorporateLayout(title string, css templ.Component, js templ.Component, nav
|
||||
<!--end::Header-->
|
||||
<!--begin::Content-->
|
||||
<div class="container-fluid">
|
||||
// toast
|
||||
<div class="toast-top-right" id="container-system-notification" style="position: absolute; top: 1vh; right: 0vw; z-index: 999;">
|
||||
<!-- toast success -->
|
||||
<div
|
||||
id="notification-001"
|
||||
class="toast fade hide"
|
||||
role="alert"
|
||||
aria-live="assertive"
|
||||
aria-atomic="true"
|
||||
>
|
||||
<div class="toast-header bg-success text-white">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--ep mr-2 icon-xl" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 1024 1024" data-icon="ep:success-filled"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"></path></svg>
|
||||
<strong class="mr-auto">Success</strong>
|
||||
<small class="text-muted text-white">just now</small>
|
||||
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body bg-success-transparent">
|
||||
This is a success toast.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
// end toast
|
||||
{ children... }
|
||||
</div>
|
||||
<!--end::Content-->
|
||||
|
||||
@@ -62,7 +62,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("<!--end::Header--><!--begin::Content--><div class=\"container-fluid\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--end::Header--><!--begin::Content--><div class=\"container-fluid\"><div class=\"toast-top-right\" id=\"container-system-notification\" style=\"position: absolute; top: 1vh; right: 0vw; z-index: 999;\"><!-- toast success --><div id=\"notification-001\" class=\"toast fade hide\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"><div class=\"toast-header bg-success text-white\"><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" role=\"img\" class=\"iconify iconify--ep mr-2 icon-xl\" width=\"1em\" height=\"1em\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 1024 1024\" data-icon=\"ep:success-filled\"><path fill=\"currentColor\" d=\"M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z\"></path></svg> <strong class=\"mr-auto\">Success</strong> <small class=\"text-muted text-white\">just now</small> <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div><div class=\"toast-body bg-success-transparent\">This is a success toast.\r</div></div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -12,4 +12,5 @@ type CustomTextFieldv2Prm struct {
|
||||
Type string `default:"text"`
|
||||
Value string `default:""`
|
||||
ErrorMsg string `default:""`
|
||||
ID string
|
||||
}
|
||||
|
||||
18
models/customdropdown.models.go
Normal file
18
models/customdropdown.models.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package models
|
||||
|
||||
// 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
|
||||
}
|
||||
33
models/kartukontrol.models.go
Normal file
33
models/kartukontrol.models.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package models
|
||||
|
||||
type KartuKontrolModel struct {
|
||||
KartuKontrolDataPasienList []DataPasien `json:"kartuKontrolDataPasien"`
|
||||
KartuKontrolDataPemeriksaanList []DataPemeriksaanList `json:"kartuKontrolDataPemeriksaanList"`
|
||||
KartuKontrolDataPemeriksaanPengambilanSample []DataPemeriksaanPengambilanSample `json:"kartuKontrolDataPemeriksaanPengambilanSample"`
|
||||
}
|
||||
|
||||
type DataPasien struct {
|
||||
NomorRegistrasi string `json:"nomorRegistrasi"`
|
||||
NomorLab string `json:"nomorLab"`
|
||||
NamaPasien string `json:"namaPasien"`
|
||||
TanggalLahir string `json:"tanggalLahir"`
|
||||
Umur string `json:"umur"`
|
||||
JenisKelamin string `json:"jenisKelamin"`
|
||||
NamaDivisi string `json:"namaDivisi"`
|
||||
NamaCompany string `json:"namaCompany"`
|
||||
}
|
||||
|
||||
type DataPemeriksaanList struct {
|
||||
NamaPemeriksaanList string `json:"namaPemeriksaanList"`
|
||||
}
|
||||
|
||||
type SampleTypeList struct {
|
||||
SampleTypeName string `json:"sampleTypeName"`
|
||||
SampleTypeDateTime string `json:"sampleTypeDateTime"`
|
||||
SampleTypeStatus string `json:"sampleTypeStatus"`
|
||||
}
|
||||
|
||||
type DataPemeriksaanPengambilanSample struct {
|
||||
NamaPemeriksaanPengambilanSample string `json:"namaPemeriksaanPengambilanSample"`
|
||||
SampleTypeListData []SampleTypeList `json:"sampleTypeListData"`
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package models
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
|
||||
type MasterUser struct {
|
||||
Nomor string `db:"nomor"`
|
||||
M_UserID int `db:"M_UserID"`
|
||||
@@ -21,3 +23,36 @@ type MasterUser struct {
|
||||
M_UserGroupCode string `db:"M_UserGroupCode"`
|
||||
M_UserGroupName string `db:"M_UserGroupName"`
|
||||
}
|
||||
|
||||
// form component
|
||||
type UserFormComponent struct {
|
||||
IDComponent string
|
||||
Link string
|
||||
HxTarget string
|
||||
HxSwap string
|
||||
HxInclude string
|
||||
ModalID string
|
||||
ModalTitle string
|
||||
InputEmail CustomTextFieldv2Prm
|
||||
InputPassword CustomTextFieldv2Prm
|
||||
InputNamaStaff CustomTextFieldv2Prm
|
||||
InputID CustomTextFieldv2Prm
|
||||
DropdownUserGroup CustomDropdownv1Prm
|
||||
DropdownReportGroup CustomDropdownv1Prm
|
||||
DialogBody templ.Component
|
||||
DialogAction templ.Component
|
||||
ButtonCLose templ.Component
|
||||
}
|
||||
|
||||
type UserFormConfirmation struct {
|
||||
IDComponent string
|
||||
Link string
|
||||
HxTarget string
|
||||
HxSwap string
|
||||
HxInclude string
|
||||
ModalID string
|
||||
ModalTitle string
|
||||
DialogBody templ.Component
|
||||
DialogAction templ.Component
|
||||
ButtonCLose templ.Component
|
||||
}
|
||||
|
||||
17
models/menu.models.go
Normal file
17
models/menu.models.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package models
|
||||
|
||||
type Menu struct {
|
||||
ID string `json:"id"`
|
||||
ParentMenuID string `json:"parent_menu_id"`
|
||||
ParentMenuName string `json:"parent_menu_name"`
|
||||
ParentUrl string `json:"parent_url"`
|
||||
ParentIcon string `json:"parent_icon"`
|
||||
Children []ChildrenMenu `json:"children"`
|
||||
}
|
||||
type ChildrenMenu struct {
|
||||
ChildrenParentID string `json:"children_parent_id"`
|
||||
ChildrenMenuID string `json:"children_menu_id"`
|
||||
ChildrenMenuName string `json:"children_menu_name"`
|
||||
ChildrenMenuURL string `json:"children_menu_url"`
|
||||
// Breadcrumb []Breadcrumb `json:"breadcrumb"`
|
||||
}
|
||||
24
models/surveymcu.models.go
Normal file
24
models/surveymcu.models.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
type SurveyMcu struct {
|
||||
DataListItemSurveyMcu []ItemSurveyMcu `json:"dataListItemSurveyMcu"`
|
||||
DataListItemSurveyMcuSaran []ItemSurveyMcuSaran `json:"datalistitemsurveymcusaran"`
|
||||
}
|
||||
|
||||
type ItemSurveyMcu struct {
|
||||
IDItemSurvey string `json:"iditemsurvey"`
|
||||
Nomor string `json:"nomor"`
|
||||
Pertanyaan string `json:"pertanyaan"`
|
||||
NameRadioButton string `json:"nameradiobutton"`
|
||||
ErrorMessage string `json:"errorMessage"`
|
||||
}
|
||||
|
||||
type ItemSurveyMcuSaran struct {
|
||||
IDItemSurveyMcuSaran string `json:"iditemsurveymcusaran"`
|
||||
NameSurveyMcuSaran string `json:"namesurveymcusaran"`
|
||||
ErrorMessageSurveyMcuSaran string `json:"errormessagesurveymcusaran"`
|
||||
}
|
||||
|
||||
type IdClearErrorMessage struct {
|
||||
IdItem string `json:"iditem"`
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package models
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
|
||||
type UserGroup struct {
|
||||
UserGroupID int `json:"user_group_id"`
|
||||
UserGroupKode string `json:"user_group_kode"`
|
||||
@@ -7,11 +9,43 @@ type UserGroup struct {
|
||||
}
|
||||
|
||||
type UserGroupV1 struct {
|
||||
Nomor string `db:"nomor"`
|
||||
M_UserGroupID int `db:"M_UserGroupID"`
|
||||
M_UserGroupCode string `db:"M_UserGroupCode"`
|
||||
M_UserGroupName string `db:"M_UserGroupName"`
|
||||
M_UserGroupCreated string `db:"M_UserGroupCreated"`
|
||||
M_UserGroupLastUpdated string `db:"M_UserGroupLastUpdated"`
|
||||
M_UserGroupIsActive string `db:"M_UserGroupIsActive"`
|
||||
Nomor string `db:"nomor"`
|
||||
M_UserGroupID int `db:"M_UserGroupID"`
|
||||
M_UserGroupCode string `db:"M_UserGroupCode"`
|
||||
M_UserGroupName string `db:"M_UserGroupName"`
|
||||
M_UserGroupCreated string `db:"M_UserGroupCreated"`
|
||||
M_UserGroupLastUpdated string `db:"M_UserGroupLastUpdated"`
|
||||
M_UserGroupIsActive string `db:"M_UserGroupIsActive"`
|
||||
M_UserGroupCreatedUserID string `db:"M_UserGroupCreatedUserID"`
|
||||
M_UserGroupLastUpdatedUserID string `db:"M_UserGroupLastUpdatedUserID"`
|
||||
M_UserGroupDeleted string `db:"M_UserGroupDeleted"`
|
||||
M_UserGroupDeletedUserID string `db:"M_UserGroupDeletedUserID"`
|
||||
}
|
||||
|
||||
type UserGroupFormComponent 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
|
||||
}
|
||||
type UserGroupFormConfirmation struct {
|
||||
IDComponent string
|
||||
Link string
|
||||
HxTarget string
|
||||
HxSwap string
|
||||
HxInclude string
|
||||
ModalID string
|
||||
ModalTitle string
|
||||
DialogBody templ.Component
|
||||
DialogAction templ.Component
|
||||
ButtonCLose templ.Component
|
||||
}
|
||||
|
||||
6
models/xtempl.models.go
Normal file
6
models/xtempl.models.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package models
|
||||
|
||||
type XtemplModel struct {
|
||||
NameTempl string `json:"nametempl"`
|
||||
HtmlString string `json:"htmlString"`
|
||||
}
|
||||
516
services/app.services.go
Normal file
516
services/app.services.go
Normal file
@@ -0,0 +1,516 @@
|
||||
package services
|
||||
|
||||
import "cpone/models"
|
||||
|
||||
//Func get menu sidebar
|
||||
func GetMenu() ([]models.Menu, error) {
|
||||
|
||||
// dummyBreadcrumb := []Breadcrumb{
|
||||
// {
|
||||
// Name: "Dashboard",
|
||||
// Url: "/client/dashboard",
|
||||
// },
|
||||
// {
|
||||
// Name: "Front Office",
|
||||
// Url: "/client/usermanagement",
|
||||
// },
|
||||
// }
|
||||
|
||||
dummyMenu := []models.Menu{
|
||||
// 1. Dashboard
|
||||
{
|
||||
ID: "1",
|
||||
ParentMenuID: "0",
|
||||
ParentMenuName: "Dashboard",
|
||||
ParentUrl: "/client/md/dashboard",
|
||||
ParentIcon: "",
|
||||
Children: []models.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: []models.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: []models.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: []models.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: []models.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 GetUserLogin() (models.User, error) {
|
||||
a := models.User{
|
||||
UserID: 1,
|
||||
Username: "andy",
|
||||
UserFullName: "Alfianto Andy P",
|
||||
UserPosition: "Software Developer",
|
||||
}
|
||||
return a, nil
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
"fmt"
|
||||
"math"
|
||||
"strings"
|
||||
|
||||
dbx "cpone/package/database"
|
||||
|
||||
@@ -589,6 +591,30 @@ func (su *ServicesMasterMenuUser) GetListBreadCrumb(title string) (models.BreadC
|
||||
}
|
||||
|
||||
// try
|
||||
func (su *ServicesMasterMenuUser) GetListMasterUserGroup() ([]models.UserGroupV1, error) {
|
||||
var userGroupList []models.UserGroupV1
|
||||
|
||||
query := `
|
||||
SELECT
|
||||
ROW_NUMBER() OVER () AS nomor,
|
||||
M_UserGroupID,
|
||||
M_UserGroupCode,
|
||||
M_UserGroupName,
|
||||
M_UserGroupCreated,
|
||||
M_UserGroupLastUpdated,
|
||||
M_UserGroupIsActive
|
||||
FROM m_usergroup
|
||||
WHERE M_UserGroupIsActive = 'Y'
|
||||
order by M_UserGroupID ASC
|
||||
`
|
||||
|
||||
if err := dbx.Handlex.Select(&userGroupList, query); err != nil {
|
||||
return nil, fmt.Errorf("error querying database: %v", err)
|
||||
}
|
||||
|
||||
return userGroupList, nil
|
||||
}
|
||||
|
||||
func (su *ServicesMasterMenuUser) GetListMasterUser(searchDropdown string) ([]models.MasterUser, error) {
|
||||
var userList []models.MasterUser
|
||||
|
||||
@@ -778,3 +804,180 @@ func (su *ServicesMasterMenuUser) GetListMasterUserGroupSearch() ([]models.UserG
|
||||
}
|
||||
|
||||
// versi 2
|
||||
func (su *ServicesMasterMenuUser) GetUserGroupData() ([]models.UserGroupV1, error) {
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
|
||||
var userList []models.UserGroupV1
|
||||
|
||||
queryList := `
|
||||
SELECT *
|
||||
FROM m_usergroup
|
||||
WHERE M_UserGroupIsActive = 'Y'
|
||||
order by M_UserGroupID ASC
|
||||
LIMIT 0, 1
|
||||
`
|
||||
|
||||
logger.Info("QUERY SEARCH INITIAL DATA USERGROUP",
|
||||
zap.String("query search", queryList),
|
||||
)
|
||||
|
||||
if err := dbx.Handlex.Select(&userList, queryList); err != nil {
|
||||
return nil, fmt.Errorf("error querying database initial USERGROUP: %v", err)
|
||||
}
|
||||
|
||||
return userList, nil
|
||||
}
|
||||
|
||||
func (su *ServicesMasterMenuUser) GetListMasterUserV2(search string, usergroup string, currentPage int, rowPerPage int) ([]models.MasterUser, int, error) {
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
|
||||
var userList []models.MasterUser
|
||||
var totalData int
|
||||
offset := (currentPage - 1) * rowPerPage
|
||||
var searchUserGroup string = ""
|
||||
if usergroup != "0" {
|
||||
searchUserGroup = usergroup
|
||||
}
|
||||
|
||||
prm := "%" + strings.TrimSpace(search) + "%"
|
||||
|
||||
// search dropdown dan inputan search
|
||||
if usergroup != "0" {
|
||||
querytotal := `
|
||||
SELECT COUNT(*)
|
||||
FROM m_user
|
||||
JOIN m_usergroup
|
||||
ON M_UserM_UserGroupID = M_UserGroupID
|
||||
AND M_UserIsActive = 'Y'
|
||||
AND M_UserGroupIsActive = 'Y'
|
||||
AND (M_UserFullName LIKE ? OR M_UserEmail LIKE ?)
|
||||
AND M_UserGroupID = ?
|
||||
JOIN r_reportgroup
|
||||
ON M_UserR_ReportGroupID = R_ReportGroupID
|
||||
AND R_ReportGroupIsActive = 'Y'
|
||||
`
|
||||
|
||||
logger.Info("QUERY SEARCH INITIAL TOTAL COUNT",
|
||||
zap.String("query search", querytotal),
|
||||
)
|
||||
|
||||
if err := dbx.Handlex.Get(&totalData, querytotal, prm, prm, searchUserGroup); err != nil {
|
||||
return nil, 0, fmt.Errorf("error querying database: %v", err)
|
||||
}
|
||||
query := `
|
||||
SELECT
|
||||
ROW_NUMBER() OVER () AS nomor,
|
||||
M_UserID,
|
||||
IFNULL(M_UserEmail, '') AS M_UserEmail,
|
||||
IFNULL(M_UserFullName, '') AS M_UserFullName,
|
||||
IFNULL(M_UserLastAccess, '') AS M_UserLastAccess,
|
||||
IFNULL(M_UserIsLoggedIn, '') AS M_UserIsLoggedIn,
|
||||
IFNULL(M_UserActiveToken, '') AS M_UserActiveToken,
|
||||
IFNULL(M_UserExpiredToken, '') AS M_UserExpiredToken,
|
||||
IFNULL(M_UserIsActive, '') AS M_UserIsActive,
|
||||
IFNULL(M_UserCreated, '') AS M_UserCreated,
|
||||
IFNULL(M_UserCreatedUserID, '') AS M_UserCreatedUserID,
|
||||
IFNULL(M_UserLastUpdated, '') AS M_UserLastUpdated,
|
||||
IFNULL(M_UserLastUpdatedUserID, '') AS M_UserLastUpdatedUserID,
|
||||
IFNULL(M_UserDeletedUserID, '') AS M_UserDeletedUserID,
|
||||
IFNULL(M_UserDeleted, '') AS M_UserDeleted,
|
||||
IFNULL(M_UserGroupCode, '') AS M_UserGroupCode,
|
||||
IFNULL(M_UserGroupName, '') AS M_UserGroupName,
|
||||
IFNULL(M_UserM_UserGroupID, '') AS M_UserM_UserGroupID,
|
||||
IFNULL(M_UserGroupID, '') AS M_UserGroupID,
|
||||
M_UserIsActive
|
||||
FROM m_user
|
||||
JOIN m_usergroup
|
||||
ON M_UserM_UserGroupID = M_UserGroupID
|
||||
AND M_UserIsActive = 'Y'
|
||||
AND M_UserGroupIsActive = 'Y'
|
||||
AND (M_UserFullName LIKE ? OR M_UserEmail LIKE ?)
|
||||
AND M_UserGroupID = ?
|
||||
JOIN r_reportgroup
|
||||
ON M_UserR_ReportGroupID = R_ReportGroupID
|
||||
AND R_ReportGroupIsActive = 'Y'
|
||||
order by M_UserID ASC
|
||||
LIMIT ? OFFSET ?
|
||||
`
|
||||
|
||||
logger.Info("QUERY SEARCH INITIAL",
|
||||
zap.String("query search", query),
|
||||
)
|
||||
|
||||
if err := dbx.Handlex.Select(&userList, query, prm, prm, searchUserGroup, rowPerPage, offset); err != nil {
|
||||
return nil, 0, fmt.Errorf("error querying database: %v", err)
|
||||
}
|
||||
} else {
|
||||
// search hanya inputan search
|
||||
querytotal := `
|
||||
SELECT COUNT(*)
|
||||
FROM m_user
|
||||
JOIN m_usergroup
|
||||
ON M_UserM_UserGroupID = M_UserGroupID
|
||||
AND M_UserIsActive = 'Y'
|
||||
AND M_UserGroupIsActive = 'Y'
|
||||
AND (M_UserFullName LIKE ? OR M_UserEmail LIKE ?)
|
||||
JOIN r_reportgroup
|
||||
ON M_UserR_ReportGroupID = R_ReportGroupID
|
||||
AND R_ReportGroupIsActive = 'Y'
|
||||
`
|
||||
|
||||
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,
|
||||
M_UserID,
|
||||
IFNULL(M_UserEmail, '') AS M_UserEmail,
|
||||
IFNULL(M_UserFullName, '') AS M_UserFullName,
|
||||
IFNULL(M_UserLastAccess, '') AS M_UserLastAccess,
|
||||
IFNULL(M_UserIsLoggedIn, '') AS M_UserIsLoggedIn,
|
||||
IFNULL(M_UserActiveToken, '') AS M_UserActiveToken,
|
||||
IFNULL(M_UserExpiredToken, '') AS M_UserExpiredToken,
|
||||
IFNULL(M_UserIsActive, '') AS M_UserIsActive,
|
||||
IFNULL(M_UserCreated, '') AS M_UserCreated,
|
||||
IFNULL(M_UserCreatedUserID, '') AS M_UserCreatedUserID,
|
||||
IFNULL(M_UserLastUpdated, '') AS M_UserLastUpdated,
|
||||
IFNULL(M_UserLastUpdatedUserID, '') AS M_UserLastUpdatedUserID,
|
||||
IFNULL(M_UserDeletedUserID, '') AS M_UserDeletedUserID,
|
||||
IFNULL(M_UserDeleted, '') AS M_UserDeleted,
|
||||
IFNULL(M_UserGroupCode, '') AS M_UserGroupCode,
|
||||
IFNULL(M_UserGroupName, '') AS M_UserGroupName,
|
||||
IFNULL(M_UserM_UserGroupID, '') AS M_UserM_UserGroupID,
|
||||
IFNULL(M_UserGroupID, '') AS M_UserGroupID,
|
||||
M_UserIsActive
|
||||
FROM m_user
|
||||
JOIN m_usergroup
|
||||
ON M_UserM_UserGroupID = M_UserGroupID
|
||||
AND M_UserIsActive = 'Y'
|
||||
AND M_UserGroupIsActive = 'Y'
|
||||
AND (M_UserFullName LIKE ? OR M_UserEmail LIKE ?)
|
||||
JOIN r_reportgroup
|
||||
ON M_UserR_ReportGroupID = R_ReportGroupID
|
||||
AND R_ReportGroupIsActive = 'Y'
|
||||
order by M_UserID ASC
|
||||
LIMIT ? OFFSET ?
|
||||
`
|
||||
|
||||
logger.Info("QUERY SEARCH INITIAL",
|
||||
zap.String("query search", query),
|
||||
)
|
||||
|
||||
if err := dbx.Handlex.Select(&userList, 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 userList, totalPage, nil
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ package dev_services
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
@@ -52,508 +54,6 @@ type AutoComplete struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
func (su *ServicesMasterMenuUserGroup) 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 *ServicesMasterMenuUserGroup) GetUserGroup() ([]models.UserGroup, error) {
|
||||
data := []models.UserGroup{
|
||||
{UserGroupID: 1, UserGroupKode: "A", UserGroupName: "UG1"},
|
||||
@@ -675,6 +175,7 @@ func (ug *ServicesMasterMenuUserGroup) GetUserGroupByIDV1(id string) (models.Use
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get data ug by id vs",
|
||||
zap.String("ID", id),
|
||||
zap.Error(err),
|
||||
)
|
||||
return data, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
@@ -733,13 +234,33 @@ func (ug *ServicesMasterMenuUserGroup) AddUserGroup(code string, name string) (m
|
||||
func (ug *ServicesMasterMenuUserGroup) EditUserGroup(id string, code string, name string) (models.UserGroupV1, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var data models.UserGroupV1
|
||||
var datacek []models.UserGroupV1
|
||||
|
||||
qryCek := `SELECT M_UserGroupCode FROM m_usergroup WHERE M_UserGroupCode = ? AND M_UserGroupIsActive = 'Y' AND M_UserGroupID <> ?`
|
||||
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 m_usergroup
|
||||
SET M_UserGroupCode = ?,
|
||||
M_UserGroupName= ?
|
||||
WHERE M_UserGroupID = ?;`
|
||||
// time.Sleep(5 * time.Second)
|
||||
rst := dbx.Handlex.MustExec(qry, code, name, id)
|
||||
_, err := rst.RowsAffected()
|
||||
_, err = rst.RowsAffected()
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error Update usergroup",
|
||||
@@ -789,127 +310,40 @@ func (ug *ServicesMasterMenuUserGroup) DeleteUserGroup(id string) (models.UserGr
|
||||
return data, nil
|
||||
}
|
||||
|
||||
func (su *ServicesMasterMenuUserGroup) GetListMasterUserGroupFilteredBySearch(search string) ([]models.UserGroupV1, error) {
|
||||
func (su *ServicesMasterMenuUserGroup) GetListMasterUserGroupV2(search string, currentPage int, rowPerPage int) ([]models.UserGroupV1, int, error) {
|
||||
var userGroupList []models.UserGroupV1
|
||||
|
||||
query := `
|
||||
SELECT
|
||||
ROW_NUMBER() OVER () AS nomor,
|
||||
M_UserGroupID,
|
||||
M_UserGroupCode,
|
||||
M_UserGroupName,
|
||||
M_UserGroupCreated,
|
||||
M_UserGroupLastUpdated,
|
||||
M_UserGroupIsActive
|
||||
FROM m_usergroup
|
||||
WHERE M_UserGroupIsActive = 'Y'
|
||||
`
|
||||
|
||||
// check jika parameter search nya tidak kosong
|
||||
if search != "" {
|
||||
query += fmt.Sprintf(" AND (M_UserGroupName LIKE '%%%s%%' OR M_UserGroupCode LIKE '%%%s%%')", search, search)
|
||||
} else {
|
||||
search = "%%"
|
||||
}
|
||||
|
||||
// query += " ORDER BY M_UserGroupID ASC"
|
||||
query += fmt.Sprintf(" ORDER BY M_UserGroupID ASC")
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
logger.Info("QUERY SEARCH ONlY FOR COUNT TOTAL PAGES PAGINATION",
|
||||
zap.String("query search", query),
|
||||
)
|
||||
|
||||
if err := dbx.Handlex.Select(&userGroupList, query); err != nil {
|
||||
return nil, fmt.Errorf("error querying database: %v", err)
|
||||
}
|
||||
|
||||
return userGroupList, nil
|
||||
}
|
||||
|
||||
func (su *ServicesMasterMenuUserGroup) GetListMasterUserGroupBySearch(search string) ([]models.UserGroupV1, error) {
|
||||
var userGroupList []models.UserGroupV1
|
||||
|
||||
query := `
|
||||
SELECT
|
||||
ROW_NUMBER() OVER () AS nomor,
|
||||
M_UserGroupID,
|
||||
M_UserGroupCode,
|
||||
M_UserGroupName,
|
||||
M_UserGroupCreated,
|
||||
M_UserGroupLastUpdated,
|
||||
M_UserGroupIsActive
|
||||
FROM m_usergroup
|
||||
WHERE M_UserGroupIsActive = 'Y'
|
||||
`
|
||||
|
||||
// fmt.Errorf(search)
|
||||
rowPerPage := 2
|
||||
offset := 0
|
||||
|
||||
// check jika parameter search nya tidak kosong
|
||||
if search != "" {
|
||||
query += fmt.Sprintf(" AND (M_UserGroupName LIKE '%%%s%%' OR M_UserGroupCode LIKE '%%%s%%')", search, search)
|
||||
} else {
|
||||
search = "%%"
|
||||
}
|
||||
|
||||
// query += " ORDER BY M_UserGroupID ASC"
|
||||
query += fmt.Sprintf(" ORDER BY M_UserGroupID ASC LIMIT %d OFFSET %d", rowPerPage, offset)
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
logger.Info("QUERY SEARCH ONlY AND SETTING LIMIT",
|
||||
zap.String("query search", query),
|
||||
)
|
||||
|
||||
if err := dbx.Handlex.Select(&userGroupList, query); err != nil {
|
||||
return nil, fmt.Errorf("error querying database: %v", err)
|
||||
}
|
||||
|
||||
return userGroupList, nil
|
||||
}
|
||||
|
||||
func (su *ServicesMasterMenuUserGroup) GetListMasterUserGroupPagination(search string, currentPage int, rowPerPage int) ([]models.UserGroupV1, error) {
|
||||
var userGroupList []models.UserGroupV1
|
||||
|
||||
query := `
|
||||
SELECT
|
||||
ROW_NUMBER() OVER () AS nomor,
|
||||
M_UserGroupID,
|
||||
M_UserGroupCode,
|
||||
M_UserGroupName,
|
||||
M_UserGroupCreated,
|
||||
M_UserGroupLastUpdated,
|
||||
M_UserGroupIsActive
|
||||
FROM m_usergroup
|
||||
WHERE M_UserGroupIsActive = 'Y'
|
||||
`
|
||||
|
||||
// rmaxPerPage := 2
|
||||
// rpage := (currentPage - 1) * rmaxPerPage
|
||||
|
||||
var totalData int
|
||||
offset := (currentPage - 1) * rowPerPage
|
||||
// offset := currentPage
|
||||
|
||||
if search != "" {
|
||||
query += fmt.Sprintf(" AND (M_UserGroupName LIKE '%%%s%%' OR M_UserGroupCode LIKE '%%%s%%')", search, search)
|
||||
} else {
|
||||
search = "%%"
|
||||
prm := "%" + strings.TrimSpace(search) + "%"
|
||||
querytotal := `
|
||||
SELECT COUNT(*)
|
||||
FROM m_usergroup
|
||||
WHERE M_UserGroupIsActive = 'Y'
|
||||
AND (M_UserGroupCode LIKE ? OR M_UserGroupName 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 () AS nomor,
|
||||
M_UserGroupID,
|
||||
M_UserGroupCode,
|
||||
M_UserGroupName,
|
||||
M_UserGroupCreated,
|
||||
M_UserGroupLastUpdated,
|
||||
M_UserGroupIsActive
|
||||
FROM m_usergroup
|
||||
WHERE M_UserGroupIsActive = 'Y'
|
||||
AND (M_UserGroupCode LIKE ? OR M_UserGroupName LIKE ?)
|
||||
order by M_UserGroupID ASC
|
||||
LIMIT ? OFFSET ?
|
||||
`
|
||||
|
||||
query += fmt.Sprintf(" ORDER BY M_UserGroupID ASC LIMIT %d OFFSET %d", rowPerPage, offset)
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
logger.Info("QUERY SEARCH WITH PAGINATION",
|
||||
zap.String("query search", query),
|
||||
)
|
||||
|
||||
if err := dbx.Handlex.Select(&userGroupList, query); err != nil {
|
||||
return nil, fmt.Errorf("error querying database: %v", err)
|
||||
if err := dbx.Handlex.Select(&userGroupList, 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 userGroupList, nil
|
||||
return userGroupList, totalPage, nil
|
||||
}
|
||||
|
||||
112
services/public/kartukontrol.services.go
Normal file
112
services/public/kartukontrol.services.go
Normal file
@@ -0,0 +1,112 @@
|
||||
package public_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func NewServicesKartuKontrol(uStore db.AppStore) *ServicesKartuKontrol {
|
||||
|
||||
return &ServicesKartuKontrol{
|
||||
KartuKontrolStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
type ServicesKartuKontrol struct {
|
||||
KartuKontrolStore db.AppStore
|
||||
}
|
||||
|
||||
func (su *ServicesKartuKontrol) GetkartuKontrolById(nomorRegistrasi string) ([]models.KartuKontrolModel, error) {
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
logger.Info("QUERY SEARCH GET KARTU KONTROL",
|
||||
zap.String("query search", ""),
|
||||
)
|
||||
|
||||
dataPasien := []models.DataPasien{
|
||||
{
|
||||
NomorRegistrasi: "00234",
|
||||
NomorLab: "LA90002",
|
||||
NamaPasien: "Hendra Setiawan",
|
||||
TanggalLahir: "2000-01-01",
|
||||
Umur: "24 tahun",
|
||||
JenisKelamin: "Laki-laki",
|
||||
NamaDivisi: "Development",
|
||||
NamaCompany: "PT. Sadhana Abiyasa Sampoerna",
|
||||
},
|
||||
}
|
||||
|
||||
dataPemeriksaanList := []models.DataPemeriksaanList{
|
||||
{NamaPemeriksaanList: "Hematologi Lengkap"},
|
||||
{NamaPemeriksaanList: "Urine Lengkap"},
|
||||
{NamaPemeriksaanList: "ACG"},
|
||||
{NamaPemeriksaanList: "Treadmill"},
|
||||
{NamaPemeriksaanList: "Pemeriksaan Fisik"},
|
||||
{NamaPemeriksaanList: "Hematologi Lengkap"},
|
||||
{NamaPemeriksaanList: "Urine Lengkap"},
|
||||
{NamaPemeriksaanList: "ACG"},
|
||||
{NamaPemeriksaanList: "Treadmill"},
|
||||
{NamaPemeriksaanList: "Pemeriksaan Fisik"},
|
||||
{NamaPemeriksaanList: "Hematologi Lengkap"},
|
||||
{NamaPemeriksaanList: "Urine Lengkap"},
|
||||
{NamaPemeriksaanList: "ACG"},
|
||||
{NamaPemeriksaanList: "Treadmill"},
|
||||
{NamaPemeriksaanList: "Pemeriksaan Fisik"},
|
||||
{NamaPemeriksaanList: "Hematologi Lengkap"},
|
||||
{NamaPemeriksaanList: "Urine Lengkap"},
|
||||
{NamaPemeriksaanList: "ACG"},
|
||||
{NamaPemeriksaanList: "Treadmill"},
|
||||
{NamaPemeriksaanList: "Pemeriksaan Fisik"},
|
||||
}
|
||||
|
||||
dataPemeriksaanPengambilanSample := []models.DataPemeriksaanPengambilanSample{
|
||||
{
|
||||
NamaPemeriksaanPengambilanSample: "Laboratorium",
|
||||
SampleTypeListData: []models.SampleTypeList{
|
||||
{
|
||||
SampleTypeName: "Darah",
|
||||
SampleTypeDateTime: "15-05-2024 10:00",
|
||||
SampleTypeStatus: "Sudah",
|
||||
},
|
||||
{
|
||||
SampleTypeName: "Urine",
|
||||
SampleTypeDateTime: "15-05-2024 10:00",
|
||||
SampleTypeStatus: "Sudah",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
NamaPemeriksaanPengambilanSample: "Rontgen",
|
||||
SampleTypeListData: []models.SampleTypeList{
|
||||
{
|
||||
SampleTypeName: "Thorax AP (PCR)",
|
||||
SampleTypeDateTime: "",
|
||||
SampleTypeStatus: "Sudah",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
NamaPemeriksaanPengambilanSample: "Elektromedis",
|
||||
SampleTypeListData: []models.SampleTypeList{
|
||||
{
|
||||
SampleTypeName: "ECG",
|
||||
SampleTypeStatus: "Belum",
|
||||
SampleTypeDateTime: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
kartuKontrol := []models.KartuKontrolModel{
|
||||
{
|
||||
KartuKontrolDataPasienList: dataPasien,
|
||||
KartuKontrolDataPemeriksaanList: dataPemeriksaanList,
|
||||
KartuKontrolDataPemeriksaanPengambilanSample: dataPemeriksaanPengambilanSample,
|
||||
},
|
||||
}
|
||||
|
||||
return kartuKontrol, nil
|
||||
}
|
||||
120
services/public/surveymcu.services.go
Normal file
120
services/public/surveymcu.services.go
Normal file
@@ -0,0 +1,120 @@
|
||||
package public_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func NewServicesSurveyMcu(uStore db.AppStore) *SurveyMcuService {
|
||||
|
||||
return &SurveyMcuService{
|
||||
SurveyMcuStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
type SurveyMcuService struct {
|
||||
SurveyMcuStore db.AppStore
|
||||
}
|
||||
|
||||
func (su *SurveyMcuService) GetSurveyMcuByNoreg(nomorRegistrasi string) ([]models.SurveyMcu, error) {
|
||||
|
||||
logger, _ := zap.NewProduction()
|
||||
defer logger.Sync()
|
||||
logger.Info("QUERY SEARCH GET SURVEY MCU BY NOMOR REGISTRASI",
|
||||
zap.String("query search", ""),
|
||||
)
|
||||
|
||||
// radio button
|
||||
dataItemSurveyMcu := []models.ItemSurveyMcu{
|
||||
{
|
||||
IDItemSurvey: "1",
|
||||
Nomor: "1",
|
||||
Pertanyaan: "Bagaimana Penilaian Sikap & Keramahan Petugas?",
|
||||
ErrorMessage: "",
|
||||
NameRadioButton: "radio-1",
|
||||
},
|
||||
{
|
||||
IDItemSurvey: "2",
|
||||
Nomor: "2",
|
||||
Pertanyaan: "Bagaimana Penilaian Penampilan Petugas?",
|
||||
ErrorMessage: "",
|
||||
NameRadioButton: "radio-2",
|
||||
},
|
||||
{
|
||||
IDItemSurvey: "3",
|
||||
Nomor: "3",
|
||||
Pertanyaan: "Bagaimana Penilaian Ketrampilan Petugas?",
|
||||
ErrorMessage: "",
|
||||
NameRadioButton: "radio-3",
|
||||
},
|
||||
{
|
||||
IDItemSurvey: "4",
|
||||
Nomor: "4",
|
||||
Pertanyaan: "Bagaimana Penilaian Pemberian Informasi Petugas?",
|
||||
ErrorMessage: "",
|
||||
NameRadioButton: "radio-4",
|
||||
},
|
||||
{
|
||||
IDItemSurvey: "5",
|
||||
Nomor: "5",
|
||||
Pertanyaan: "Bagaimana Penilaian Kelengkapan Alat?",
|
||||
ErrorMessage: "",
|
||||
NameRadioButton: "radio-5",
|
||||
},
|
||||
{
|
||||
IDItemSurvey: "6",
|
||||
Nomor: "6",
|
||||
Pertanyaan: "Bagaimana Penilaian Kelayakan Alat?",
|
||||
ErrorMessage: "",
|
||||
NameRadioButton: "radio-6",
|
||||
},
|
||||
{
|
||||
IDItemSurvey: "7",
|
||||
Nomor: "7",
|
||||
Pertanyaan: "Bagaimana Penilaian Kebersihan Ruangan?",
|
||||
ErrorMessage: "",
|
||||
NameRadioButton: "radio-7",
|
||||
},
|
||||
{
|
||||
IDItemSurvey: "8",
|
||||
Nomor: "8",
|
||||
Pertanyaan: "Bagaimana Penilaian Kebersihan Ruangan?",
|
||||
ErrorMessage: "",
|
||||
NameRadioButton: "radio-8",
|
||||
},
|
||||
{
|
||||
IDItemSurvey: "9",
|
||||
Nomor: "9",
|
||||
Pertanyaan: "Bagaimana Penilaian Alur Pelayanan?",
|
||||
ErrorMessage: "",
|
||||
NameRadioButton: "radio-9",
|
||||
},
|
||||
{
|
||||
IDItemSurvey: "10",
|
||||
Nomor: "10",
|
||||
Pertanyaan: "Bagaimana Penilaian Ketepatan Waktu?",
|
||||
ErrorMessage: "",
|
||||
NameRadioButton: "radio-10",
|
||||
},
|
||||
}
|
||||
|
||||
// saran
|
||||
dataItemSurveyMcuSaran := []models.ItemSurveyMcuSaran{
|
||||
{
|
||||
IDItemSurveyMcuSaran: "11",
|
||||
NameSurveyMcuSaran: "saranmcu-11",
|
||||
ErrorMessageSurveyMcuSaran: "",
|
||||
},
|
||||
}
|
||||
|
||||
surveymcu := []models.SurveyMcu{
|
||||
{
|
||||
DataListItemSurveyMcu: dataItemSurveyMcu,
|
||||
DataListItemSurveyMcuSaran: dataItemSurveyMcuSaran,
|
||||
},
|
||||
}
|
||||
|
||||
return surveymcu, nil
|
||||
}
|
||||
35
utils/surveymcu.utils.go
Normal file
35
utils/surveymcu.utils.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func GetIdSurveyMcu(id string) string {
|
||||
return id
|
||||
}
|
||||
|
||||
func ConcatHxIncludeSurveyMcu(dataSurveyMcu []models.SurveyMcu) string {
|
||||
var elements []string
|
||||
|
||||
if len(dataSurveyMcu) > 0 {
|
||||
for _, x := range dataSurveyMcu {
|
||||
// radio button
|
||||
if len(x.DataListItemSurveyMcu) > 0 {
|
||||
for _, v := range x.DataListItemSurveyMcu {
|
||||
elements = append(elements, "[name='radio-"+v.IDItemSurvey+"']", "[name='default-radio-"+v.IDItemSurvey+"']", "[name='id-radio']")
|
||||
}
|
||||
}
|
||||
|
||||
// saran
|
||||
if len(x.DataListItemSurveyMcuSaran) > 0 {
|
||||
for _, v := range x.DataListItemSurveyMcuSaran {
|
||||
elements = append(elements, "[name='saranmcu-"+v.IDItemSurveyMcuSaran+"']", "[name='default-saranmcu-"+v.IDItemSurveyMcuSaran+"']", "[name='id-saran']")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Gabungkan semua elemen dengan koma
|
||||
return strings.Join(elements, ", ")
|
||||
}
|
||||
@@ -1,10 +1,32 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"net/http"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func ViewMulti(c echo.Context, cmp []templ.Component) error {
|
||||
var stringHtml string = ""
|
||||
buf := new(bytes.Buffer)
|
||||
|
||||
var err error
|
||||
for _, x := range cmp {
|
||||
err = x.Render(c.Request().Context(), buf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
stringHtml += buf.String()
|
||||
}
|
||||
|
||||
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
|
||||
|
||||
return c.String(http.StatusOK, stringHtml)
|
||||
|
||||
}
|
||||
|
||||
func View(c echo.Context, cmp templ.Component) error {
|
||||
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
|
||||
|
||||
|
||||
@@ -5,11 +5,72 @@ import (
|
||||
"cpone/models"
|
||||
"cpone/component/modal"
|
||||
"strconv"
|
||||
"cpone/component/table"
|
||||
"cpone/component/customtextfield"
|
||||
)
|
||||
|
||||
// "cpone/component/sidebar_user_profile"
|
||||
templ ContentMasterMenuUserV1(contentID string, breadcrumb templ.Component, tablecontent templ.Component, inputanSearch templ.Component) {
|
||||
templ ContentMasterMenuUserV1(
|
||||
tableID string,
|
||||
paginationID string,
|
||||
searchID string,
|
||||
dropdownID string,
|
||||
dialogAddID string,
|
||||
dialogAddBodyID string,
|
||||
dialogEditID string,
|
||||
dialogEditBodyID string,
|
||||
dialogDeleteID string,
|
||||
dialogDeleteBodyID string,
|
||||
breadcrumb templ.Component,
|
||||
tablecontent templ.Component,
|
||||
filterUser templ.Component,
|
||||
filterUserGroup templ.Component,
|
||||
paginationUser 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: "dropdownID",
|
||||
Name: "dropdownID",
|
||||
Type: "hidden",
|
||||
Value: dropdownID})
|
||||
@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
|
||||
@@ -21,47 +82,59 @@ templ ContentMasterMenuUserV1(contentID string, breadcrumb templ.Component, tabl
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
data-toggle="modal"
|
||||
data-target="#dialogNew"
|
||||
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">Add New</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-block"
|
||||
data-toggle="modal"
|
||||
data-target={ "#" + dialogAddID }
|
||||
>Add New</button>
|
||||
</div>
|
||||
</div>
|
||||
// @filterUser
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
@filterUserGroup
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@filterUser
|
||||
</div>
|
||||
</div>
|
||||
// table content
|
||||
@tablecontent
|
||||
@paginationUser
|
||||
<div class="d-flex justify-content-center text-primary">
|
||||
<div class="htmx-indicator spinner-border" role="status" id="indicator">
|
||||
<div class="htmx-indicator spinner-border text-primary" role="status" id="indicator">
|
||||
<span class="sr-only"></span>
|
||||
</div>
|
||||
</div>
|
||||
@modalcomponent.Modal("dialogNew", "New - User", DialogNewBody("", ""), DialogNewAction(), BtnCloseNew())
|
||||
@modalcomponent.Modal("dialogEdit", "Edit - User", DialogEditBody("", ""), DialogEditAction(), BtnCloseNew())
|
||||
// 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())
|
||||
@JSkuMasterUserV1()
|
||||
</div>
|
||||
}
|
||||
|
||||
templ TableRowMasterUserV1(data []models.MasterUser) {
|
||||
// /usergroup/edit
|
||||
// <a
|
||||
// id="btneditug"
|
||||
// type="button"
|
||||
// class="btneditusgp col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2"
|
||||
// onclick="htmx.trigger('#btneditug', 'htmx:abort')"
|
||||
// hx-target="#modalbdyEdit"
|
||||
// hx-swap="innerHTML"
|
||||
// hx-get={ "/client/usergroup/edit?id=" + strconv.Itoa(v.UserGroupID) }
|
||||
// hx-on::before-request="ShowLoading()"
|
||||
// hx-on::after-request="ShowForm()"
|
||||
// data-toggle="modal"
|
||||
// data-target="#dialogEdit"
|
||||
// >
|
||||
// Edit
|
||||
// </a>
|
||||
templ TableRowMasterUserV1(data []models.MasterUser,
|
||||
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>
|
||||
<td colspan="3" class="text-center">Data Tidak Ditemukan</td>
|
||||
</tr>
|
||||
}
|
||||
for _, v := range data {
|
||||
@@ -70,38 +143,55 @@ templ TableRowMasterUserV1(data []models.MasterUser) {
|
||||
<td>{ v.M_UserFullName }</td>
|
||||
<td>{ v.M_UserGroupName }</td>
|
||||
<td>
|
||||
<div class="row px-5 d-flex justify-content-around">
|
||||
<a
|
||||
id="btneditug"
|
||||
type="button"
|
||||
class="btneditusgp col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2"
|
||||
data-toggle="modal"
|
||||
data-target={ "#dialogEdit" + strconv.Itoa(v.M_UserID) }
|
||||
>
|
||||
Edit
|
||||
</a>
|
||||
<a
|
||||
type="button"
|
||||
class="col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2"
|
||||
data-toggle="modal"
|
||||
data-target={ "#dialogDelete" + strconv.Itoa(v.M_UserID) }
|
||||
>Hapus</a>
|
||||
@modalcomponent.Modal("dialogEdit"+strconv.Itoa(v.M_UserID),
|
||||
"Edit - User",
|
||||
DialogEditBody(v.M_UserGroupCode, v.M_UserGroupName),
|
||||
DialogEditAction(),
|
||||
BtnCloseNew())
|
||||
@modalcomponent.ModalConfirmation(
|
||||
"dialogDelete"+strconv.Itoa(v.M_UserID),
|
||||
"Konfirmasi",
|
||||
"Apakah anda yakin menghapus user berikut ?", BtnCloseDeleteMasterUserV1(),
|
||||
[]string{"Email", "Nama Staff", "User Group"}, []string{v.M_UserEmail, v.M_UserFullName, v.M_UserGroupName}, DialogDeleteMasterUserActionV1())
|
||||
</div>
|
||||
@TableAction(v.M_UserID, 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 DialogDeleteMasterUserActionV1() {
|
||||
<div>
|
||||
<button
|
||||
@@ -153,25 +243,6 @@ templ JSkuMasterUserV1() {
|
||||
</script>
|
||||
}
|
||||
|
||||
templ PaginationMasterUserV1() {
|
||||
<div class="d-flex justify-content-between align-items-center flex-wrap">
|
||||
<div class="d-flex flex-wrap py-2 mr-3">
|
||||
<a href="#" class="btn btn-icon btn-sm btn-light mr-2 my-1"><i class="ki ki-bold-double-arrow-back icon-xs"></i></a>
|
||||
<a href="#" class="btn btn-icon btn-sm btn-light mr-2 my-1"><i class="ki ki-bold-arrow-back icon-xs"></i></a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">...</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">23</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light btn-hover-primary active mr-2 my-1">24</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">25</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">26</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">27</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">28</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">...</a>
|
||||
<a href="#" class="btn btn-icon btn-sm btn-light mr-2 my-1"><i class="ki ki-bold-arrow-next icon-xs"></i></a>
|
||||
<a href="#" class="btn btn-icon btn-sm btn-light mr-2 my-1"><i class="ki ki-bold-double-arrow-next icon-xs"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ CssMasterMenuUserV1x() {
|
||||
<link
|
||||
rel="stylesheet"
|
||||
@@ -205,9 +276,6 @@ templ CssMasterMenuUserV1x() {
|
||||
</style>
|
||||
}
|
||||
|
||||
templ JsMasterMenuUserV1x() {
|
||||
}
|
||||
|
||||
// for item dropdown
|
||||
templ ItemDropdown(dataDropdown []models.UserGroupV1) {
|
||||
if len(dataDropdown) == 0 {
|
||||
@@ -219,6 +287,11 @@ templ ItemDropdown(dataDropdown []models.UserGroupV1) {
|
||||
}
|
||||
}
|
||||
|
||||
// for empty div
|
||||
templ EmptyDiv1() {
|
||||
<div></div>
|
||||
}
|
||||
|
||||
templ ShowMasterMenuUserV1x(title string, cmp templ.Component, css templ.Component, js templ.Component,
|
||||
navbarmenu templ.Component,
|
||||
navbaruser templ.Component,
|
||||
@@ -227,3 +300,95 @@ templ ShowMasterMenuUserV1x(title string, cmp templ.Component, css templ.Compone
|
||||
@cmp
|
||||
}
|
||||
}
|
||||
|
||||
// table
|
||||
templ TableUser(data []models.MasterUser, 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{"EMAIL", "NAMA STAFF", "USERGROUP", "AKSI"},
|
||||
[]string{"30%", "30%", "20%", "20%"},
|
||||
TableRowMasterUserV1(data, hxGetEdit, hxTargetEdit, hxSwapEdit, hxIncludeEdit, hxGetDelete, hxTargetDelete, hxSwapDelete, hxIncludeDelete))
|
||||
</div>
|
||||
}
|
||||
|
||||
templ SwapTableUser(pagination templ.Component, table templ.Component) {
|
||||
@pagination
|
||||
@table
|
||||
}
|
||||
|
||||
templ UserForm(data models.UserFormComponent) {
|
||||
<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
@@ -3,26 +3,63 @@ package mastermenuuser
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/component/customtextfield"
|
||||
"cpone/component/customdropdown"
|
||||
)
|
||||
|
||||
templ DialogNewBody(code string, name string) {
|
||||
<div id="modalbdy">
|
||||
templ DialogNewBodyV1(
|
||||
inputId models.CustomTextFieldv2Prm,
|
||||
inputUsername models.CustomTextFieldv2Prm,
|
||||
inputPassword models.CustomTextFieldv2Prm,
|
||||
inputUserfullname models.CustomTextFieldv2Prm,
|
||||
inputDropdownUserGroup models.CustomDropdownv1Prm,
|
||||
listItemUserGroup templ.Component,
|
||||
inputDropdownReportGroup models.CustomDropdownv1Prm,
|
||||
listItemReportGroup templ.Component,
|
||||
componentID string,
|
||||
hxOnLoad templ.ComponentScript) {
|
||||
<div id={ componentID } hx-on::load={ hxOnLoad }>
|
||||
@customtextfield.CustomTextFieldv2(
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Kode user group",
|
||||
Name: "usergroupcode",
|
||||
Placeholder: "Kode user Group",
|
||||
Type: "text",
|
||||
Value: code,
|
||||
})
|
||||
inputId)
|
||||
@customtextfield.CustomTextFieldv2(
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Nama User Group",
|
||||
Name: "usergroupname",
|
||||
Placeholder: "Nama User Group",
|
||||
Type: "text",
|
||||
Value: name,
|
||||
})
|
||||
inputUsername)
|
||||
@customtextfield.CustomTextFieldv2(
|
||||
inputPassword)
|
||||
@customtextfield.CustomTextFieldv2(
|
||||
inputUserfullname)
|
||||
@customdropdown.MainCustomDropdownInput(
|
||||
inputDropdownUserGroup, listItemUserGroup)
|
||||
@customdropdown.MainCustomDropdownInput(
|
||||
inputDropdownReportGroup, listItemReportGroup)
|
||||
</div>
|
||||
}
|
||||
|
||||
script HandleJSModalAddUG(modalID string) {
|
||||
$(modalID).modal('hide')
|
||||
}
|
||||
|
||||
script HandleJSModalAddUGShow(modalID string) {
|
||||
$(modalID).modal('show')
|
||||
}
|
||||
|
||||
templ DialogNewActionV1(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
|
||||
<div>
|
||||
<button
|
||||
hx-on::after-request={ HandleJSModalAddUG(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>
|
||||
}
|
||||
|
||||
@@ -36,7 +73,7 @@ templ DialogNewAction() {
|
||||
Batal
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
type="submit"
|
||||
class="btn btn-primary btn-shadow font-weight-bold rounded-lg"
|
||||
>
|
||||
Save changes
|
||||
@@ -54,3 +91,18 @@ templ BtnCloseNew() {
|
||||
<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={ HandleJSModalAddUG(modalID) }
|
||||
class="close btnaddact"
|
||||
data-dismiss="modal"
|
||||
aria-label="Close"
|
||||
>
|
||||
<i aria-hidden="true" class="ki ki-close"></i>
|
||||
</button>
|
||||
}
|
||||
|
||||
@@ -11,11 +11,22 @@ import "io"
|
||||
import "bytes"
|
||||
|
||||
import (
|
||||
"cpone/component/customdropdown"
|
||||
"cpone/component/customtextfield"
|
||||
"cpone/models"
|
||||
)
|
||||
|
||||
func DialogNewBody(code string, name string) templ.Component {
|
||||
func DialogNewBodyV1(
|
||||
inputId models.CustomTextFieldv2Prm,
|
||||
inputUsername models.CustomTextFieldv2Prm,
|
||||
inputPassword models.CustomTextFieldv2Prm,
|
||||
inputUserfullname models.CustomTextFieldv2Prm,
|
||||
inputDropdownUserGroup models.CustomDropdownv1Prm,
|
||||
listItemUserGroup templ.Component,
|
||||
inputDropdownReportGroup models.CustomDropdownv1Prm,
|
||||
listItemReportGroup 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 {
|
||||
@@ -28,29 +39,63 @@ func DialogNewBody(code string, name string) templ.Component {
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"modalbdy\">")
|
||||
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\mastermenuuser\modaladduser.templ`, Line: 20, 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(
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Kode user group",
|
||||
Name: "usergroupcode",
|
||||
Placeholder: "Kode user Group",
|
||||
Type: "text",
|
||||
Value: code,
|
||||
}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
inputId).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Nama User Group",
|
||||
Name: "usergroupname",
|
||||
Placeholder: "Nama User Group",
|
||||
Type: "text",
|
||||
Value: name,
|
||||
}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
inputUsername).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(
|
||||
inputPassword).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(
|
||||
inputUserfullname).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customdropdown.MainCustomDropdownInput(
|
||||
inputDropdownUserGroup, listItemUserGroup).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customdropdown.MainCustomDropdownInput(
|
||||
inputDropdownReportGroup, listItemReportGroup).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -65,6 +110,106 @@ func DialogNewBody(code string, name string) templ.Component {
|
||||
})
|
||||
}
|
||||
|
||||
func HandleJSModalAddUG(modalID string) templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_HandleJSModalAddUG_da6c`,
|
||||
Function: `function __templ_HandleJSModalAddUG_da6c(modalID){$(modalID).modal('hide')
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_HandleJSModalAddUG_da6c`, modalID),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleJSModalAddUG_da6c`, modalID),
|
||||
}
|
||||
}
|
||||
|
||||
func HandleJSModalAddUGShow(modalID string) templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_HandleJSModalAddUGShow_3147`,
|
||||
Function: `function __templ_HandleJSModalAddUGShow_3147(modalID){$(modalID).modal('show')
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_HandleJSModalAddUGShow_3147`, modalID),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleJSModalAddUGShow_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, HandleJSModalAddUG(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 = HandleJSModalAddUG(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\mastermenuuser\modaladduser.templ`, Line: 48, 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\mastermenuuser\modaladduser.templ`, Line: 49, 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\mastermenuuser\modaladduser.templ`, Line: 50, 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)
|
||||
@@ -73,12 +218,12 @@ func DialogNewAction() templ.Component {
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var2 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var2 == nil {
|
||||
templ_7745c5c3_Var2 = templ.NopComponent
|
||||
templ_7745c5c3_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=\"button\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg\">Save changes\r</button></div>")
|
||||
_, 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
|
||||
}
|
||||
@@ -97,9 +242,9 @@ func BtnCloseNew() templ.Component {
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var3 == nil {
|
||||
templ_7745c5c3_Var3 = templ.NopComponent
|
||||
templ_7745c5c3_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>")
|
||||
@@ -112,3 +257,79 @@ func BtnCloseNew() templ.Component {
|
||||
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, HandleJSModalAddUG(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\mastermenuuser\modaladduser.templ`, Line: 97, 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\mastermenuuser\modaladduser.templ`, Line: 98, 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\mastermenuuser\modaladduser.templ`, Line: 99, 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 = HandleJSModalAddUG(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
|
||||
})
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ templ ContentMasterMenuUserGroup(ugData []models.UserGroup, contentID string) {
|
||||
<span class="sr-only"></span>
|
||||
</div>
|
||||
</div>
|
||||
@modalcomponent.Modal("dialogNew", "New - User Group", DialogNewBody("", ""), DialogNewAction(), BtnCloseNew())
|
||||
@modalcomponent.Modal("dialogNew", "New - User Group", DialogNewBody("", "", "", "", ""), DialogNewAction(), BtnCloseNew())
|
||||
@modalcomponent.Modal("dialogEdit", "Edit - User Group", DialogEditBody("", ""), DialogEditAction(), BtnCloseNew())
|
||||
@JSku()
|
||||
</div>
|
||||
|
||||
@@ -66,7 +66,7 @@ func ContentMasterMenuUserGroup(ugData []models.UserGroup, contentID string) tem
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = modalcomponent.Modal("dialogNew", "New - User Group", DialogNewBody("", ""), DialogNewAction(), BtnCloseNew()).Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = modalcomponent.Modal("dialogNew", "New - User Group", DialogNewBody("", "", "", "", ""), DialogNewAction(), BtnCloseNew()).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -5,11 +5,66 @@ import (
|
||||
"cpone/models"
|
||||
"cpone/component/modal"
|
||||
"strconv"
|
||||
"cpone/component/table"
|
||||
"cpone/component/customtextfield"
|
||||
)
|
||||
|
||||
// "cpone/component/sidebar_user_profile"
|
||||
templ ContentMasterMenuUserGroupV1(contentID string, breadcrumb templ.Component, tablecontent templ.Component, inputanSearch templ.Component) {
|
||||
templ ContentMasterMenuUserGroupV1(
|
||||
tableID string,
|
||||
paginationID string,
|
||||
searchID string,
|
||||
dialogAddID string,
|
||||
dialogAddBodyID string,
|
||||
dialogEditID string,
|
||||
dialogEditBodyID string,
|
||||
dialogDeleteID string,
|
||||
dialogDeleteBodyID string,
|
||||
breadcrumb templ.Component,
|
||||
tablecontent templ.Component,
|
||||
filterUserGroup templ.Component,
|
||||
paginationUserGroup 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
|
||||
@@ -21,44 +76,48 @@ templ ContentMasterMenuUserGroupV1(contentID string, breadcrumb templ.Component,
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
data-toggle="modal"
|
||||
data-target="#dialogNew"
|
||||
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">Add New</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-block"
|
||||
data-toggle="modal"
|
||||
data-target={ "#" + dialogAddID }
|
||||
>Add New</button>
|
||||
</div>
|
||||
</div>
|
||||
@filterUserGroup
|
||||
// table content
|
||||
@tablecontent
|
||||
@paginationUserGroup
|
||||
<div class="d-flex justify-content-center text-primary">
|
||||
<div class="htmx-indicator spinner-border" role="status" id="indicator">
|
||||
<div class="htmx-indicator spinner-border text-primary" role="status" id="indicator">
|
||||
<span class="sr-only"></span>
|
||||
</div>
|
||||
</div>
|
||||
@modalcomponent.Modal("dialogNew", "New - User Group", DialogNewBody("", ""), DialogNewAction(), BtnCloseNew())
|
||||
@modalcomponent.Modal("dialogEdit", "Edit - User Group", DialogEditBody("", ""), DialogEditAction(), BtnCloseNew())
|
||||
// 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())
|
||||
@JSku()
|
||||
</div>
|
||||
}
|
||||
|
||||
templ TableRowV1(data []models.UserGroupV1) {
|
||||
// /usergroup/edit
|
||||
// <a
|
||||
// id="btneditug"
|
||||
// type="button"
|
||||
// class="btneditusgp col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2"
|
||||
// onclick="htmx.trigger('#btneditug', 'htmx:abort')"
|
||||
// hx-target="#modalbdyEdit"
|
||||
// hx-swap="innerHTML"
|
||||
// hx-get={ "/client/usergroup/edit?id=" + strconv.Itoa(v.UserGroupID) }
|
||||
// hx-on::before-request="ShowLoading()"
|
||||
// hx-on::after-request="ShowForm()"
|
||||
// data-toggle="modal"
|
||||
// data-target="#dialogEdit"
|
||||
// >
|
||||
// Edit
|
||||
// </a>
|
||||
templ TableRowV1(data []models.UserGroupV1,
|
||||
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>
|
||||
@@ -69,38 +128,55 @@ templ TableRowV1(data []models.UserGroupV1) {
|
||||
<td>{ v.M_UserGroupCode }</td>
|
||||
<td>{ v.M_UserGroupName }</td>
|
||||
<td>
|
||||
<div class="row px-5 d-flex justify-content-around">
|
||||
<a
|
||||
id="btneditug"
|
||||
type="button"
|
||||
class="btneditusgp col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2"
|
||||
data-toggle="modal"
|
||||
data-target={ "#dialogEdit" + strconv.Itoa(v.M_UserGroupID) }
|
||||
>
|
||||
Edit
|
||||
</a>
|
||||
<a
|
||||
type="button"
|
||||
class="col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2"
|
||||
data-toggle="modal"
|
||||
data-target={ "#dialogDelete" + strconv.Itoa(v.M_UserGroupID) }
|
||||
>Hapus</a>
|
||||
@modalcomponent.Modal("dialogEdit"+strconv.Itoa(v.M_UserGroupID),
|
||||
"Edit - User Group",
|
||||
DialogEditBody(v.M_UserGroupCode, v.M_UserGroupName),
|
||||
DialogEditAction(),
|
||||
BtnCloseNew())
|
||||
@modalcomponent.ModalConfirmation(
|
||||
"dialogDelete"+strconv.Itoa(v.M_UserGroupID),
|
||||
"Konfirmasi",
|
||||
"Apakah anda yakin menghapus user group berikut ?", BtnCloseDelete(),
|
||||
[]string{"Kode", "User Group"}, []string{v.M_UserGroupCode, v.M_UserGroupName}, DialogDeleteAction())
|
||||
</div>
|
||||
@TableAction(v.M_UserGroupID, 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 DialogDeleteActionV1() {
|
||||
<div>
|
||||
<button
|
||||
@@ -152,25 +228,6 @@ templ JSkuV1() {
|
||||
</script>
|
||||
}
|
||||
|
||||
templ PaginationV1() {
|
||||
<div class="d-flex justify-content-between align-items-center flex-wrap">
|
||||
<div class="d-flex flex-wrap py-2 mr-3">
|
||||
<a href="#" class="btn btn-icon btn-sm btn-light mr-2 my-1"><i class="ki ki-bold-double-arrow-back icon-xs"></i></a>
|
||||
<a href="#" class="btn btn-icon btn-sm btn-light mr-2 my-1"><i class="ki ki-bold-arrow-back icon-xs"></i></a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">...</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">23</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light btn-hover-primary active mr-2 my-1">24</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">25</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">26</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">27</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">28</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">...</a>
|
||||
<a href="#" class="btn btn-icon btn-sm btn-light mr-2 my-1"><i class="ki ki-bold-arrow-next icon-xs"></i></a>
|
||||
<a href="#" class="btn btn-icon btn-sm btn-light mr-2 my-1"><i class="ki ki-bold-double-arrow-next icon-xs"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ CssMasterMenuUserGroupV1x() {
|
||||
<link
|
||||
rel="stylesheet"
|
||||
@@ -216,3 +273,94 @@ templ ShowMasterMenuUserGroupV1x(title string, cmp templ.Component, css templ.Co
|
||||
@cmp
|
||||
}
|
||||
}
|
||||
|
||||
templ TableUserGroup(data []models.UserGroupV1, 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", "USERGROUP", "AKSI"},
|
||||
[]string{"40%", "40%", "20%"},
|
||||
TableRowV1(data, hxGetEdit, hxTargetEdit, hxSwapEdit, hxIncludeEdit, hxGetDelete, hxTargetDelete, hxSwapDelete, hxIncludeDelete))
|
||||
</div>
|
||||
}
|
||||
|
||||
templ SwapTableUserGroup(pagination templ.Component, table templ.Component) {
|
||||
@pagination
|
||||
@table
|
||||
}
|
||||
|
||||
templ UserGroupForm(data models.UserGroupFormComponent) {
|
||||
<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>
|
||||
}
|
||||
|
||||
@@ -11,14 +11,33 @@ import "io"
|
||||
import "bytes"
|
||||
|
||||
import (
|
||||
"cpone/component/customtextfield"
|
||||
"cpone/component/modal"
|
||||
"cpone/component/table"
|
||||
"cpone/layout"
|
||||
"cpone/models"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// "cpone/component/sidebar_user_profile"
|
||||
func ContentMasterMenuUserGroupV1(contentID string, breadcrumb templ.Component, tablecontent templ.Component, inputanSearch templ.Component) templ.Component {
|
||||
func ContentMasterMenuUserGroupV1(
|
||||
tableID string,
|
||||
paginationID string,
|
||||
searchID string,
|
||||
dialogAddID string,
|
||||
dialogAddBodyID string,
|
||||
dialogEditID string,
|
||||
dialogEditBodyID string,
|
||||
dialogDeleteID string,
|
||||
dialogDeleteBodyID string,
|
||||
breadcrumb templ.Component,
|
||||
tablecontent templ.Component,
|
||||
filterUserGroup templ.Component,
|
||||
paginationUserGroup 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 {
|
||||
@@ -31,7 +50,74 @@ func ContentMasterMenuUserGroupV1(contentID string, breadcrumb templ.Component,
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"container-fluid\"><div class=\"row align-items-center mb-10\"><div class=\"col-md-10 col-sm-12 p-0 \">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"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
|
||||
}
|
||||
@@ -39,7 +125,37 @@ func ContentMasterMenuUserGroupV1(contentID string, breadcrumb templ.Component,
|
||||
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=\"#dialogNew\">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\">Add New</button></div></div>")
|
||||
_, 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\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 79, 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\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 88, 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 = filterUserGroup.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -47,15 +163,23 @@ func ContentMasterMenuUserGroupV1(contentID string, breadcrumb templ.Component,
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex justify-content-center text-primary\"><div class=\"htmx-indicator spinner-border\" role=\"status\" id=\"indicator\"><span class=\"sr-only\"></span></div></div>")
|
||||
templ_7745c5c3_Err = paginationUserGroup.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = modalcomponent.Modal("dialogNew", "New - User Group", DialogNewBody("", ""), DialogNewAction(), BtnCloseNew()).Render(ctx, templ_7745c5c3_Buffer)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<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>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = modalcomponent.Modal("dialogEdit", "Edit - User Group", DialogEditBody("", ""), DialogEditAction(), BtnCloseNew()).Render(ctx, templ_7745c5c3_Buffer)
|
||||
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
|
||||
}
|
||||
@@ -74,7 +198,15 @@ func ContentMasterMenuUserGroupV1(contentID string, breadcrumb templ.Component,
|
||||
})
|
||||
}
|
||||
|
||||
func TableRowV1(data []models.UserGroupV1) templ.Component {
|
||||
func TableRowV1(data []models.UserGroupV1,
|
||||
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 {
|
||||
@@ -82,9 +214,9 @@ func TableRowV1(data []models.UserGroupV1) templ.Component {
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var2 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var2 == nil {
|
||||
templ_7745c5c3_Var2 = templ.NopComponent
|
||||
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var4 == nil {
|
||||
templ_7745c5c3_Var4 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
if len(data) == 0 {
|
||||
@@ -98,12 +230,12 @@ func TableRowV1(data []models.UserGroupV1) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_UserGroupCode)
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_UserGroupCode)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 69, Col: 26}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 128, Col: 26}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -111,62 +243,24 @@ func TableRowV1(data []models.UserGroupV1) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_UserGroupName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 70, Col: 26}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td><div class=\"row px-5 d-flex justify-content-around\"><a id=\"btneditug\" type=\"button\" class=\"btneditusgp col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2\" data-toggle=\"modal\" data-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs("#dialogEdit" + strconv.Itoa(v.M_UserGroupID))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 78, Col: 65}
|
||||
}
|
||||
_, 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("\">Edit\r</a> <a type=\"button\" class=\"col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2\" data-toggle=\"modal\" data-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("#dialogDelete" + strconv.Itoa(v.M_UserGroupID))
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_UserGroupName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 86, Col: 67}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 129, Col: 26}
|
||||
}
|
||||
_, 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("\">Hapus</a>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = modalcomponent.Modal("dialogEdit"+strconv.Itoa(v.M_UserGroupID),
|
||||
"Edit - User Group",
|
||||
DialogEditBody(v.M_UserGroupCode, v.M_UserGroupName),
|
||||
DialogEditAction(),
|
||||
BtnCloseNew()).Render(ctx, templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = TableAction(v.M_UserGroupID, 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 = modalcomponent.ModalConfirmation(
|
||||
"dialogDelete"+strconv.Itoa(v.M_UserGroupID),
|
||||
"Konfirmasi",
|
||||
"Apakah anda yakin menghapus user group berikut ?", BtnCloseDelete(),
|
||||
[]string{"Kode", "User Group"}, []string{v.M_UserGroupCode, v.M_UserGroupName}, DialogDeleteAction()).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></td></tr>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td></tr>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -178,6 +272,144 @@ func TableRowV1(data []models.UserGroupV1) templ.Component {
|
||||
})
|
||||
}
|
||||
|
||||
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\"><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_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\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 153, 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\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 154, 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\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 155, 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\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 156, 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("\">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_Var12 string
|
||||
templ_7745c5c3_Var12, 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\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 167, Col: 51}
|
||||
}
|
||||
_, 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(hxTargetDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 168, Col: 29}
|
||||
}
|
||||
_, 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(hxSwapDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 169, Col: 25}
|
||||
}
|
||||
_, 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-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var15 string
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 170, Col: 31}
|
||||
}
|
||||
_, 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("\">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 DialogDeleteActionV1() 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)
|
||||
@@ -186,9 +418,9 @@ func DialogDeleteActionV1() templ.Component {
|
||||
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
|
||||
templ_7745c5c3_Var16 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var16 == nil {
|
||||
templ_7745c5c3_Var16 = 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=\"button\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg\">Yakin\r</button></div>")
|
||||
@@ -210,9 +442,9 @@ func BtnCloseDeleteV1() templ.Component {
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var8 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var8 == nil {
|
||||
templ_7745c5c3_Var8 = templ.NopComponent
|
||||
templ_7745c5c3_Var17 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var17 == nil {
|
||||
templ_7745c5c3_Var17 = 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>")
|
||||
@@ -234,9 +466,9 @@ func JSkuV1() templ.Component {
|
||||
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
|
||||
templ_7745c5c3_Var18 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var18 == nil {
|
||||
templ_7745c5c3_Var18 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script>\r\n\t\t function ShowLoading(evt) {\r\n document\r\n .getElementById(\"modalLoadEdit\")\r\n .setAttribute(\"style\", \"display:block !important;\");\r\n document\r\n .getElementById(\"modalbdyEdit\")\r\n .setAttribute(\"style\", \"display:none !important;\");\r\n\t\t console.log(evt);\r\n }\r\n function ShowForm() {\r\n document\r\n .getElementById(\"modalLoadEdit\")\r\n .setAttribute(\"style\", \"display:none !important;\");\r\n document\r\n .getElementById(\"modalbdyEdit\")\r\n .setAttribute(\"style\", \"display:block !important;;\");\r\n }\r\n\t</script>")
|
||||
@@ -250,30 +482,6 @@ func JSkuV1() templ.Component {
|
||||
})
|
||||
}
|
||||
|
||||
func PaginationV1() 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=\"d-flex justify-content-between align-items-center flex-wrap\"><div class=\"d-flex flex-wrap py-2 mr-3\"><a href=\"#\" class=\"btn btn-icon btn-sm btn-light mr-2 my-1\"><i class=\"ki ki-bold-double-arrow-back icon-xs\"></i></a> <a href=\"#\" class=\"btn btn-icon btn-sm btn-light mr-2 my-1\"><i class=\"ki ki-bold-arrow-back icon-xs\"></i></a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">...</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">23</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light btn-hover-primary active mr-2 my-1\">24</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">25</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">26</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">27</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">28</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">...</a> <a href=\"#\" class=\"btn btn-icon btn-sm btn-light mr-2 my-1\"><i class=\"ki ki-bold-arrow-next icon-xs\"></i></a> <a href=\"#\" class=\"btn btn-icon btn-sm btn-light mr-2 my-1\"><i class=\"ki ki-bold-double-arrow-next icon-xs\"></i></a></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 CssMasterMenuUserGroupV1x() 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)
|
||||
@@ -282,9 +490,9 @@ func CssMasterMenuUserGroupV1x() templ.Component {
|
||||
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
|
||||
templ_7745c5c3_Var19 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var19 == nil {
|
||||
templ_7745c5c3_Var19 = 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 \r\n</style>")
|
||||
@@ -306,9 +514,9 @@ func JsMasterMenuUserGroupV1x() templ.Component {
|
||||
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
|
||||
templ_7745c5c3_Var20 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var20 == nil {
|
||||
templ_7745c5c3_Var20 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
@@ -329,12 +537,12 @@ func ShowMasterMenuUserGroupV1x(title string, cmp templ.Component, css templ.Com
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var13 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var13 == nil {
|
||||
templ_7745c5c3_Var13 = templ.NopComponent
|
||||
templ_7745c5c3_Var21 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var21 == nil {
|
||||
templ_7745c5c3_Var21 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Var14 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Var22 := 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()
|
||||
@@ -349,7 +557,372 @@ func ShowMasterMenuUserGroupV1x(title string, cmp templ.Component, css templ.Com
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
templ_7745c5c3_Err = layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var14), templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var22), 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 TableUserGroup(data []models.UserGroupV1, 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_Var23 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var23 == nil {
|
||||
templ_7745c5c3_Var23 = 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_Var24 string
|
||||
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(tableID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 286, Col: 18}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap-oob=\"true\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"KODE", "USERGROUP", "AKSI"},
|
||||
[]string{"40%", "40%", "20%"},
|
||||
TableRowV1(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 SwapTableUserGroup(pagination templ.Component, table 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_Var25 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var25 == nil {
|
||||
templ_7745c5c3_Var25 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Err = pagination.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = table.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 UserGroupForm(data models.UserGroupFormComponent) 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_Var26 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var26 == nil {
|
||||
templ_7745c5c3_Var26 = 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_Var27 string
|
||||
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(data.IDComponent)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 301, Col: 24}
|
||||
}
|
||||
_, 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-post=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var28 string
|
||||
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(data.Link)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 302, 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("\" class=\"form\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var29 string
|
||||
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(data.HxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 304, Col: 28}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var30 string
|
||||
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(data.HxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 305, Col: 24}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var31 string
|
||||
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(data.HxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 306, Col: 30}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var32 templ.ComponentScript = HandleFormBeforeRequest()
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var32.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_Var33 templ.ComponentScript = HandleFormAfterRequest()
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var33.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_1e3f`,
|
||||
Function: `function __templ_HandleFormBeforeRequest_1e3f(){console.log("handle disable btn add");
|
||||
const boxes = document.querySelectorAll('.btnaddact');
|
||||
|
||||
for (let i = 0; i < boxes.length; i++) {
|
||||
boxes[i].setAttribute('disabled', 'true');
|
||||
|
||||
}
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_1e3f`),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_1e3f`),
|
||||
}
|
||||
}
|
||||
|
||||
func HandleFormAfterRequest() templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_HandleFormAfterRequest_ee07`,
|
||||
Function: `function __templ_HandleFormAfterRequest_ee07(){console.log("handle enable btn add");
|
||||
|
||||
const boxes = document.querySelectorAll('.btnaddact');
|
||||
|
||||
for (let i = 0; i < boxes.length; i++) {
|
||||
boxes[i].removeAttribute('disabled');
|
||||
|
||||
}
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_HandleFormAfterRequest_ee07`),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_ee07`),
|
||||
}
|
||||
}
|
||||
|
||||
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_Var34 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var34 == nil {
|
||||
templ_7745c5c3_Var34 = 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_Var35 string
|
||||
templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 346, Col: 22}
|
||||
}
|
||||
_, 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("\" hx-on::load=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var36 templ.ComponentScript = hxOnLoad
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var36.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_Var37 string
|
||||
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(message)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 347, Col: 14}
|
||||
}
|
||||
_, 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("</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_Var38 string
|
||||
templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs(v)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 352, Col: 68}
|
||||
}
|
||||
_, 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("</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_Var39 string
|
||||
templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(v)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\mastermenuusergroupv1.templ`, Line: 358, Col: 10}
|
||||
}
|
||||
_, 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("</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
|
||||
}
|
||||
|
||||
@@ -5,8 +5,17 @@ import (
|
||||
"cpone/component/customtextfield"
|
||||
)
|
||||
|
||||
templ DialogNewBody(code string, name string) {
|
||||
templ DialogNewBody(code string, name string, id string, codeErrorMsg string, nameErrorMsg string) {
|
||||
<div id="modalbdy">
|
||||
@customtextfield.CustomTextFieldv2(
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "id user group",
|
||||
Name: "usergroupid",
|
||||
Placeholder: "id user Group",
|
||||
Type: "hidden",
|
||||
Value: code,
|
||||
ErrorMsg: codeErrorMsg,
|
||||
})
|
||||
@customtextfield.CustomTextFieldv2(
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Kode user group",
|
||||
@@ -14,6 +23,7 @@ templ DialogNewBody(code string, name string) {
|
||||
Placeholder: "Kode user Group",
|
||||
Type: "text",
|
||||
Value: code,
|
||||
ErrorMsg: codeErrorMsg,
|
||||
})
|
||||
@customtextfield.CustomTextFieldv2(
|
||||
models.CustomTextFieldv2Prm{
|
||||
@@ -22,10 +32,56 @@ templ DialogNewBody(code string, name string) {
|
||||
Placeholder: "Nama User Group",
|
||||
Type: "text",
|
||||
Value: name,
|
||||
ErrorMsg: nameErrorMsg,
|
||||
})
|
||||
</div>
|
||||
}
|
||||
|
||||
templ DialogNewBodyV1(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 HandleJSModalAddUG(modalID string) {
|
||||
$(modalID).modal('hide')
|
||||
}
|
||||
|
||||
script HandleJSModalAddUGShow(modalID string) {
|
||||
$(modalID).modal('show')
|
||||
}
|
||||
|
||||
templ DialogNewActionV1(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
|
||||
<div>
|
||||
<button
|
||||
hx-on::after-request={ HandleJSModalAddUG(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
|
||||
@@ -36,7 +92,7 @@ templ DialogNewAction() {
|
||||
Batal
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
type="submit"
|
||||
class="btn btn-primary btn-shadow font-weight-bold rounded-lg"
|
||||
>
|
||||
Save changes
|
||||
@@ -54,3 +110,18 @@ templ BtnCloseNew() {
|
||||
<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={ HandleJSModalAddUG(modalID) }
|
||||
class="close btnaddact"
|
||||
data-dismiss="modal"
|
||||
aria-label="Close"
|
||||
>
|
||||
<i aria-hidden="true" class="ki ki-close"></i>
|
||||
</button>
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
"cpone/models"
|
||||
)
|
||||
|
||||
func DialogNewBody(code string, name string) templ.Component {
|
||||
func DialogNewBody(code string, name string, id string, codeErrorMsg string, nameErrorMsg 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 {
|
||||
@@ -32,6 +32,18 @@ func DialogNewBody(code string, name string) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "id user group",
|
||||
Name: "usergroupid",
|
||||
Placeholder: "id user Group",
|
||||
Type: "hidden",
|
||||
Value: code,
|
||||
ErrorMsg: codeErrorMsg,
|
||||
}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Kode user group",
|
||||
@@ -39,6 +51,7 @@ func DialogNewBody(code string, name string) templ.Component {
|
||||
Placeholder: "Kode user Group",
|
||||
Type: "text",
|
||||
Value: code,
|
||||
ErrorMsg: codeErrorMsg,
|
||||
}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
@@ -50,6 +63,7 @@ func DialogNewBody(code string, name string) templ.Component {
|
||||
Placeholder: "Nama User Group",
|
||||
Type: "text",
|
||||
Value: name,
|
||||
ErrorMsg: nameErrorMsg,
|
||||
}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
@@ -65,6 +79,179 @@ func DialogNewBody(code string, name string) templ.Component {
|
||||
})
|
||||
}
|
||||
|
||||
func DialogNewBodyV1(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_Var2 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var2 == nil {
|
||||
templ_7745c5c3_Var2 = 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_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\modaladdusergroup.templ`, Line: 45, 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("\" hx-on::load=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 templ.ComponentScript = hxOnLoad
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var4.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 HandleJSModalAddUG(modalID string) templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_HandleJSModalAddUG_da6c`,
|
||||
Function: `function __templ_HandleJSModalAddUG_da6c(modalID){$(modalID).modal('hide')
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_HandleJSModalAddUG_da6c`, modalID),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleJSModalAddUG_da6c`, modalID),
|
||||
}
|
||||
}
|
||||
|
||||
func HandleJSModalAddUGShow(modalID string) templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_HandleJSModalAddUGShow_3147`,
|
||||
Function: `function __templ_HandleJSModalAddUGShow_3147(modalID){$(modalID).modal('show')
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_HandleJSModalAddUGShow_3147`, modalID),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleJSModalAddUGShow_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_Var5 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var5 == nil {
|
||||
templ_7745c5c3_Var5 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleJSModalAddUG(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_Var6 templ.ComponentScript = HandleJSModalAddUG(modalID)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\modaladdusergroup.templ`, Line: 67, Col: 22}
|
||||
}
|
||||
_, 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(targetClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\modaladdusergroup.templ`, Line: 68, Col: 26}
|
||||
}
|
||||
_, 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(hxSwapClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\modaladdusergroup.templ`, Line: 69, Col: 24}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"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)
|
||||
@@ -73,12 +260,12 @@ func DialogNewAction() templ.Component {
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var2 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var2 == nil {
|
||||
templ_7745c5c3_Var2 = templ.NopComponent
|
||||
templ_7745c5c3_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><button type=\"button\" 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>")
|
||||
_, 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
|
||||
}
|
||||
@@ -97,9 +284,9 @@ func BtnCloseNew() templ.Component {
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var3 == nil {
|
||||
templ_7745c5c3_Var3 = templ.NopComponent
|
||||
templ_7745c5c3_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("<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><i aria-hidden=\"true\" class=\"ki ki-close\"></i></button>")
|
||||
@@ -112,3 +299,79 @@ func BtnCloseNew() templ.Component {
|
||||
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_Var12 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var12 == nil {
|
||||
templ_7745c5c3_Var12 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleJSModalAddUG(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_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\modaladdusergroup.templ`, Line: 116, Col: 21}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var14 string
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\modaladdusergroup.templ`, Line: 117, Col: 25}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var15 string
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mastermenuusergroup\modaladdusergroup.templ`, Line: 118, Col: 23}
|
||||
}
|
||||
_, 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("\" type=\"button\" hx-on::after-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var16 templ.ComponentScript = HandleJSModalAddUG(modalID)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16.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
|
||||
})
|
||||
}
|
||||
|
||||
@@ -152,25 +152,6 @@ templ JSkuV1() {
|
||||
</script>
|
||||
}
|
||||
|
||||
templ PaginationV1() {
|
||||
<div class="d-flex justify-content-between align-items-center flex-wrap">
|
||||
<div class="d-flex flex-wrap py-2 mr-3">
|
||||
<a href="#" class="btn btn-icon btn-sm btn-light mr-2 my-1"><i class="ki ki-bold-double-arrow-back icon-xs"></i></a>
|
||||
<a href="#" class="btn btn-icon btn-sm btn-light mr-2 my-1"><i class="ki ki-bold-arrow-back icon-xs"></i></a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">...</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">23</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light btn-hover-primary active mr-2 my-1">24</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">25</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">26</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">27</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">28</a>
|
||||
<a href="#" class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1">...</a>
|
||||
<a href="#" class="btn btn-icon btn-sm btn-light mr-2 my-1"><i class="ki ki-bold-arrow-next icon-xs"></i></a>
|
||||
<a href="#" class="btn btn-icon btn-sm btn-light mr-2 my-1"><i class="ki ki-bold-double-arrow-next icon-xs"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ CssMasterMenuUserGroupV1x() {
|
||||
<link
|
||||
rel="stylesheet"
|
||||
|
||||
@@ -252,7 +252,7 @@ func JSkuV1() templ.Component {
|
||||
})
|
||||
}
|
||||
|
||||
func PaginationV1() templ.Component {
|
||||
func CssMasterMenuUserGroupV1x() 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 {
|
||||
@@ -265,30 +265,6 @@ func PaginationV1() templ.Component {
|
||||
templ_7745c5c3_Var10 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex justify-content-between align-items-center flex-wrap\"><div class=\"d-flex flex-wrap py-2 mr-3\"><a href=\"#\" class=\"btn btn-icon btn-sm btn-light mr-2 my-1\"><i class=\"ki ki-bold-double-arrow-back icon-xs\"></i></a> <a href=\"#\" class=\"btn btn-icon btn-sm btn-light mr-2 my-1\"><i class=\"ki ki-bold-arrow-back icon-xs\"></i></a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">...</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">23</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light btn-hover-primary active mr-2 my-1\">24</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">25</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">26</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">27</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">28</a> <a href=\"#\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\">...</a> <a href=\"#\" class=\"btn btn-icon btn-sm btn-light mr-2 my-1\"><i class=\"ki ki-bold-arrow-next icon-xs\"></i></a> <a href=\"#\" class=\"btn btn-icon btn-sm btn-light mr-2 my-1\"><i class=\"ki ki-bold-double-arrow-next icon-xs\"></i></a></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 CssMasterMenuUserGroupV1x() 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("<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 \r\n</style>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
@@ -308,9 +284,9 @@ func JsMasterMenuUserGroupV1x() templ.Component {
|
||||
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
|
||||
templ_7745c5c3_Var11 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var11 == nil {
|
||||
templ_7745c5c3_Var11 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
@@ -331,12 +307,12 @@ func ShowMasterMenuUserGroupV1x(title string, cmp templ.Component, css templ.Com
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var13 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var13 == nil {
|
||||
templ_7745c5c3_Var13 = templ.NopComponent
|
||||
templ_7745c5c3_Var12 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var12 == nil {
|
||||
templ_7745c5c3_Var12 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Var14 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
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()
|
||||
@@ -351,7 +327,7 @@ func ShowMasterMenuUserGroupV1x(title string, cmp templ.Component, css templ.Com
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
templ_7745c5c3_Err = layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var14), templ_7745c5c3_Buffer)
|
||||
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
|
||||
}
|
||||
|
||||
35
views/dev/xtemplmulti/xtemplmulti.templ
Normal file
35
views/dev/xtemplmulti/xtemplmulti.templ
Normal file
@@ -0,0 +1,35 @@
|
||||
package xtemplmulti
|
||||
|
||||
import "cpone/models"
|
||||
|
||||
func stringToTemplComp(textAll string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, w io.Writer) error {
|
||||
_, err := io.WriteString(w, textAll)
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
||||
templ MainXTemplMulti(arrString []models.XtemplModel) {
|
||||
<div id="dataMhs" style="margin-bottom: 20px">
|
||||
<table>
|
||||
<tr>
|
||||
<td>Jarot</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="dataGuru" style="margin-bottom: 20px">
|
||||
<table>
|
||||
<tr>
|
||||
<td>Desy</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
for _, v := range arrString {
|
||||
{ v.NameTempl }
|
||||
{ v.HtmlString }
|
||||
|
||||
@stringToTemplComp(v.HtmlString)
|
||||
}
|
||||
|
||||
}
|
||||
72
views/dev/xtemplmulti/xtemplmulti_templ.go
Normal file
72
views/dev/xtemplmulti/xtemplmulti_templ.go
Normal file
@@ -0,0 +1,72 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package xtemplmulti
|
||||
|
||||
//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 stringToTemplComp(textAll string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, w io.Writer) error {
|
||||
_, err := io.WriteString(w, textAll)
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
||||
func MainXTemplMulti(arrString []models.XtemplModel) 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=\"dataMhs\" style=\"margin-bottom: 20px\"><table><tr><td>Jarot</td></tr></table></div><div id=\"dataGuru\" style=\"margin-bottom: 20px\"><table><tr><td>Desy</td></tr></table></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for _, v := range arrString {
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(v.NameTempl)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\xtemplmulti\xtemplmulti.templ`, Line: 29, 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(" ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(v.HtmlString)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\xtemplmulti\xtemplmulti.templ`, Line: 30, 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 = stringToTemplComp(v.HtmlString).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
|
||||
})
|
||||
}
|
||||
267
views/public/kartukontrol/kartukontrol.templ
Normal file
267
views/public/kartukontrol/kartukontrol.templ
Normal file
@@ -0,0 +1,267 @@
|
||||
package public_kartukontrol
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/layout"
|
||||
)
|
||||
|
||||
templ MainContentKartuKontrolLayout(dataKartuKontrol []models.KartuKontrolModel, hxGet string, hxTrigger string, idModal string, urlSurveyMcu string, nomorRegistrasi string) {
|
||||
// toast
|
||||
<div class="toast-top-right" id="container-system-notification-x01" style="position: fixed; top: 1vh; right: 0vw; z-index: 999;">
|
||||
<!-- toast success -->
|
||||
<div
|
||||
id="notification-kartukontrol-001"
|
||||
class="toast fade hide"
|
||||
role="alert"
|
||||
aria-live="assertive"
|
||||
aria-atomic="true"
|
||||
>
|
||||
<div class="toast-header bg-success text-white">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--ep mr-2 icon-xl" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 1024 1024" data-icon="ep:success-filled"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"></path></svg>
|
||||
<strong class="mr-auto">Success</strong>
|
||||
<small class="text-muted text-white">just now</small>
|
||||
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body bg-success-transparent">
|
||||
This is a success toast.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
// end toast
|
||||
<div class="content-fluid bg-white">
|
||||
<div class="card-control py-19 px-9">
|
||||
if len(dataKartuKontrol) > 0 {
|
||||
@ContentDataPasienList(dataKartuKontrol[0].KartuKontrolDataPasienList)
|
||||
@ContentPemeriksaanLayout(dataKartuKontrol[0].KartuKontrolDataPemeriksaanList, dataKartuKontrol[0].KartuKontrolDataPemeriksaanPengambilanSample)
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@ModalMcuWordingProcessShow(hxTrigger, hxGet, idModal, urlSurveyMcu, nomorRegistrasi)
|
||||
}
|
||||
|
||||
templ ContentDataPasienList(dataPasienList []models.DataPasien) {
|
||||
<!-- begin::Data Pasien -->
|
||||
<div class="left pt-6 pl-7" style="position: relative">
|
||||
<div class="foto top-right mt-7 mr-6"></div>
|
||||
<div class="card-label">
|
||||
<h4>Data Pasien</h4>
|
||||
</div>
|
||||
<div class="pt-4">
|
||||
<h5 class="text-primary">No Registrasi</h5>
|
||||
<h5>{ dataPasienList[0].NomorRegistrasi }</h5>
|
||||
</div>
|
||||
<div class="pt-4">
|
||||
<h5 class="text-primary">Nomor Lab</h5>
|
||||
<h5>{ dataPasienList[0].NomorLab }</h5>
|
||||
</div>
|
||||
<div class="pt-4">
|
||||
<h5 class="text-primary">Nama Pasien</h5>
|
||||
<h5>{ dataPasienList[0].NamaPasien }</h5>
|
||||
</div>
|
||||
<div class="pt-4">
|
||||
<h5 class="text-primary">Tanggal Lahir / Umur</h5>
|
||||
<h5>{ dataPasienList[0].TanggalLahir } / { dataPasienList[0].Umur }</h5>
|
||||
</div>
|
||||
<div class="pt-4">
|
||||
<h5 class="text-primary">Jenis Kelamin</h5>
|
||||
<h5>{ dataPasienList[0].JenisKelamin }</h5>
|
||||
</div>
|
||||
<div class="pt-4">
|
||||
<h5 class="text-primary">Divisi</h5>
|
||||
<h5>{ dataPasienList[0].NamaDivisi }</h5>
|
||||
</div>
|
||||
<div class="pt-4">
|
||||
<h5 class="text-primary">Company</h5>
|
||||
<h5>{ dataPasienList[0].NamaCompany }</h5>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end::Data Pasien -->
|
||||
}
|
||||
|
||||
templ ContentPemeriksaanLayout(dataPemeriksaanList []models.DataPemeriksaanList, dataPemeriksaanPengambilanSample []models.DataPemeriksaanPengambilanSample) {
|
||||
<div class="card shadow-sm py-2 mt-29">
|
||||
@ContentPemeriksaanList(dataPemeriksaanList)
|
||||
</div>
|
||||
@ContentPengambilanSampleList(dataPemeriksaanPengambilanSample)
|
||||
}
|
||||
|
||||
templ ContentPemeriksaanList(dataPemeriksaan []models.DataPemeriksaanList) {
|
||||
<div class="card-body px-3 py-2">
|
||||
<h5 class="card-title">Daftar Pemeriksaan</h5>
|
||||
if len(dataPemeriksaan) > 0 {
|
||||
<ul class="list-group text-grey ml-7 mt-1">
|
||||
for _, v := range dataPemeriksaan {
|
||||
<li><h6>{ v.NamaPemeriksaanList }</h6></li>
|
||||
}
|
||||
</ul>
|
||||
} else {
|
||||
<h6>Belum Ada Daftar Pemeriksaan</h6>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ContentPengambilanSampleList(dataPemeriksaanPengambilanSample []models.DataPemeriksaanPengambilanSample) {
|
||||
<div class="card shadow-sm py-2 mt-6">
|
||||
<div class="card-body px-3 py-2">
|
||||
<!-- begin::Pemeriksaan/Pengambilan Sample -->
|
||||
<h5 class="card-title">Pemeriksaan / Pengambilan Sample</h5>
|
||||
if len(dataPemeriksaanPengambilanSample) > 0 {
|
||||
for _, v := range dataPemeriksaanPengambilanSample {
|
||||
<div class="text-grey mb-3">
|
||||
<h5>{ v.NamaPemeriksaanPengambilanSample }</h5>
|
||||
if len(v.SampleTypeListData) > 0 {
|
||||
<ul class="list-group ml-7 mt-1">
|
||||
for _, k := range v.SampleTypeListData {
|
||||
<li class="justify-content-center align-items-center mb-3">
|
||||
<div class="row">
|
||||
<div class="col-9 d-flex">
|
||||
<h6>{ k.SampleTypeName }</h6>
|
||||
if len(k.SampleTypeDateTime) > 0 {
|
||||
<span class="smallf pl-5 vertical">{ k.SampleTypeDateTime }</span>
|
||||
}
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<span class="label label-inline font-weight-bold kartukontrol-sudah-label mr-2 shadow-sm">{ k.SampleTypeStatus }</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
} else {
|
||||
<h6>Belum Ada Data Pengambilan Sample</h6>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
} else {
|
||||
<h6>Belum Ada Data Pemeriksaan & Pengambilan Sample</h6>
|
||||
}
|
||||
<!-- end::Pemeriksaan/Pengambilan Sample -->
|
||||
</div>
|
||||
</div>
|
||||
<div style="height: 14vh;"></div>
|
||||
}
|
||||
|
||||
templ ModalMcuWordingProcessShow(hxTrigger string, hxGet string, idModal string, urlSurveyMcu string, nomorRegistrasi string) {
|
||||
<input type="hidden" name="nomorRegistrasi" value={ nomorRegistrasi }/>
|
||||
<input type="hidden" name="urlSurveyMcu" value={ urlSurveyMcu }/>
|
||||
<div hx-trigger={ hxTrigger } hx-get={ hxGet } hx-include="[name='urlSurveyMcu'], [name='nomorRegistrasi']"></div>
|
||||
<div id={ idModal }></div>
|
||||
}
|
||||
|
||||
templ ModalMcuWordingShow(idModal string, messageWording string, urlSurvey string) {
|
||||
<!-- modal wording start -->
|
||||
<div
|
||||
class="modal fade show modalcover"
|
||||
id={ idModal }
|
||||
hx-swap-oob="true"
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
data-backdrop="static"
|
||||
aria-hidden="true"
|
||||
style="display: block;"
|
||||
>
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content rounded-lg">
|
||||
<div class="modal-header border-bottom-0">
|
||||
<h1 class="text-black font-weight-bolder">Perhatian</h1>
|
||||
</div>
|
||||
<div class="modal-body border-bottom-0">
|
||||
<div id="spinnerDiv" class="d-flex justify-content-center align-items-center">
|
||||
<div id="spinnerLoading" class="spinner-border text-primary" role="status">
|
||||
<span class="sr-only">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
<h6 id="modal-text" class="text-black" style="display: none;">
|
||||
{ messageWording }
|
||||
</h6>
|
||||
</div>
|
||||
<div class="modal-footer border-top-0">
|
||||
<button
|
||||
id="redirectToSurveyMcu"
|
||||
type="submit"
|
||||
class="btn btn-primary btn-shadow font-weight-bold rounded-lg"
|
||||
style="display:none"
|
||||
hx-get={ urlSurvey }
|
||||
hx-swap="none"
|
||||
hx-include="[name='urlSurveyMcu'], [name='nomorRegistrasi']"
|
||||
>
|
||||
OK
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
// show spinner
|
||||
setTimeout(function() {
|
||||
document.getElementById('spinnerDiv').style.display = 'none';
|
||||
document.getElementById('spinnerLoading').style.display = 'none';
|
||||
document.getElementById('modal-text').style.display = 'block';
|
||||
document.getElementById('redirectToSurveyMcu').style.display = 'block';
|
||||
}, 2000); // 2000 milidetik atau 2 detik
|
||||
</script>
|
||||
}
|
||||
|
||||
templ CssKartuKontrol() {
|
||||
<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: var(--white)
|
||||
}
|
||||
.card-control {
|
||||
width: 390px;
|
||||
height: 1212px;
|
||||
background-image: url("asset-corporate-portal/media/kartukontrol/bg-kartuKontrol.svg");
|
||||
background-size: 390px 1212px;
|
||||
background-repeat: no-repeat;
|
||||
margin: auto;
|
||||
}
|
||||
.foto {
|
||||
width: 70px;
|
||||
height: 79px;
|
||||
background-image: url("assets/media/svg/avatars/001-boy.svg");
|
||||
background-size: 70px 79px;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.top-right {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
h5 {
|
||||
font-size: 14px;
|
||||
}
|
||||
h6 {
|
||||
font-size: 12px;
|
||||
}
|
||||
.smallf {
|
||||
font-size: 10px;
|
||||
}
|
||||
.modalcover {
|
||||
background-color: #00000073;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
templ JsKartuKontrol() {
|
||||
}
|
||||
|
||||
templ ShowKartuKontrol(title string, cmp templ.Component, css templ.Component, js templ.Component) {
|
||||
@layout.PlaygroundLayout(title, css, js) {
|
||||
@cmp
|
||||
}
|
||||
}
|
||||
651
views/public/kartukontrol/kartukontrol_templ.go
Normal file
651
views/public/kartukontrol/kartukontrol_templ.go
Normal file
@@ -0,0 +1,651 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package public_kartukontrol
|
||||
|
||||
//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"
|
||||
"cpone/models"
|
||||
)
|
||||
|
||||
func MainContentKartuKontrolLayout(dataKartuKontrol []models.KartuKontrolModel, hxGet string, hxTrigger string, idModal string, urlSurveyMcu string, nomorRegistrasi 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 class=\"toast-top-right\" id=\"container-system-notification-x01\" style=\"position: fixed; top: 1vh; right: 0vw; z-index: 999;\"><!-- toast success --><div id=\"notification-kartukontrol-001\" class=\"toast fade hide\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"><div class=\"toast-header bg-success text-white\"><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" role=\"img\" class=\"iconify iconify--ep mr-2 icon-xl\" width=\"1em\" height=\"1em\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 1024 1024\" data-icon=\"ep:success-filled\"><path fill=\"currentColor\" d=\"M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z\"></path></svg> <strong class=\"mr-auto\">Success</strong> <small class=\"text-muted text-white\">just now</small> <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div><div class=\"toast-body bg-success-transparent\">This is a success toast.\r</div></div></div><div class=\"content-fluid bg-white\"><div class=\"card-control py-19 px-9\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if len(dataKartuKontrol) > 0 {
|
||||
templ_7745c5c3_Err = ContentDataPasienList(dataKartuKontrol[0].KartuKontrolDataPasienList).Render(ctx, templ_7745c5c3_Buffer)
|
||||
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 = ContentPemeriksaanLayout(dataKartuKontrol[0].KartuKontrolDataPemeriksaanList, dataKartuKontrol[0].KartuKontrolDataPemeriksaanPengambilanSample).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ModalMcuWordingProcessShow(hxTrigger, hxGet, idModal, urlSurveyMcu, nomorRegistrasi).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 ContentDataPasienList(dataPasienList []models.DataPasien) 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("<!-- begin::Data Pasien --><div class=\"left pt-6 pl-7\" style=\"position: relative\"><div class=\"foto top-right mt-7 mr-6\"></div><div class=\"card-label\"><h4>Data Pasien</h4></div><div class=\"pt-4\"><h5 class=\"text-primary\">No Registrasi</h5><h5>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].NomorRegistrasi)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 53, Col: 42}
|
||||
}
|
||||
_, 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("</h5></div><div class=\"pt-4\"><h5 class=\"text-primary\">Nomor Lab</h5><h5>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].NomorLab)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 57, Col: 35}
|
||||
}
|
||||
_, 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("</h5></div><div class=\"pt-4\"><h5 class=\"text-primary\">Nama Pasien</h5><h5>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].NamaPasien)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 61, Col: 37}
|
||||
}
|
||||
_, 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("</h5></div><div class=\"pt-4\"><h5 class=\"text-primary\">Tanggal Lahir / Umur</h5><h5>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].TanggalLahir)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 65, Col: 39}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" / ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].Umur)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 65, Col: 68}
|
||||
}
|
||||
_, 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("</h5></div><div class=\"pt-4\"><h5 class=\"text-primary\">Jenis Kelamin</h5><h5>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].JenisKelamin)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 69, Col: 39}
|
||||
}
|
||||
_, 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("</h5></div><div class=\"pt-4\"><h5 class=\"text-primary\">Divisi</h5><h5>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].NamaDivisi)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 73, Col: 37}
|
||||
}
|
||||
_, 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("</h5></div><div class=\"pt-4\"><h5 class=\"text-primary\">Company</h5><h5>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(dataPasienList[0].NamaCompany)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 77, Col: 38}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h5></div></div><!-- end::Data Pasien -->")
|
||||
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 ContentPemeriksaanLayout(dataPemeriksaanList []models.DataPemeriksaanList, dataPemeriksaanPengambilanSample []models.DataPemeriksaanPengambilanSample) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var11 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var11 == nil {
|
||||
templ_7745c5c3_Var11 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"card shadow-sm py-2 mt-29\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ContentPemeriksaanList(dataPemeriksaanList).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ContentPengambilanSampleList(dataPemeriksaanPengambilanSample).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 ContentPemeriksaanList(dataPemeriksaan []models.DataPemeriksaanList) 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 class=\"card-body px-3 py-2\"><h5 class=\"card-title\">Daftar Pemeriksaan</h5>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if len(dataPemeriksaan) > 0 {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<ul class=\"list-group text-grey ml-7 mt-1\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for _, v := range dataPemeriksaan {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<li><h6>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(v.NamaPemeriksaanList)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 96, Col: 36}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h6></li>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</ul>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<h6>Belum Ada Daftar Pemeriksaan</h6>")
|
||||
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 ContentPengambilanSampleList(dataPemeriksaanPengambilanSample []models.DataPemeriksaanPengambilanSample) 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=\"card shadow-sm py-2 mt-6\"><div class=\"card-body px-3 py-2\"><!-- begin::Pemeriksaan/Pengambilan Sample --><h5 class=\"card-title\">Pemeriksaan / Pengambilan Sample</h5>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if len(dataPemeriksaanPengambilanSample) > 0 {
|
||||
for _, v := range dataPemeriksaanPengambilanSample {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"text-grey mb-3\"><h5>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var15 string
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(v.NamaPemeriksaanPengambilanSample)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 113, Col: 46}
|
||||
}
|
||||
_, 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("</h5>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if len(v.SampleTypeListData) > 0 {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<ul class=\"list-group ml-7 mt-1\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for _, k := range v.SampleTypeListData {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<li class=\"justify-content-center align-items-center mb-3\"><div class=\"row\"><div class=\"col-9 d-flex\"><h6>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var16 string
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(k.SampleTypeName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 120, Col: 34}
|
||||
}
|
||||
_, 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("</h6>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if len(k.SampleTypeDateTime) > 0 {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<span class=\"smallf pl-5 vertical\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var17 string
|
||||
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(k.SampleTypeDateTime)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 122, Col: 70}
|
||||
}
|
||||
_, 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("</span>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"col-3\"><span class=\"label label-inline font-weight-bold kartukontrol-sudah-label mr-2 shadow-sm\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var18 string
|
||||
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(k.SampleTypeStatus)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 126, Col: 122}
|
||||
}
|
||||
_, 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("</span></div></div></li>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</ul>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<h6>Belum Ada Data Pengambilan Sample</h6>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<h6>Belum Ada Data Pemeriksaan & Pengambilan Sample</h6>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- end::Pemeriksaan/Pengambilan Sample --></div></div><div style=\"height: 14vh;\"></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 ModalMcuWordingProcessShow(hxTrigger string, hxGet string, idModal string, urlSurveyMcu string, nomorRegistrasi string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var19 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var19 == nil {
|
||||
templ_7745c5c3_Var19 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input type=\"hidden\" name=\"nomorRegistrasi\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var20 string
|
||||
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(nomorRegistrasi)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 147, Col: 68}
|
||||
}
|
||||
_, 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("\"> <input type=\"hidden\" name=\"urlSurveyMcu\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var21 string
|
||||
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(urlSurveyMcu)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 148, Col: 62}
|
||||
}
|
||||
_, 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("\"><div hx-trigger=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var22 string
|
||||
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 149, Col: 28}
|
||||
}
|
||||
_, 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("\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var23 string
|
||||
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 149, Col: 45}
|
||||
}
|
||||
_, 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-include=\"[name='urlSurveyMcu'], [name='nomorRegistrasi']\"></div><div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var24 string
|
||||
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(idModal)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 150, Col: 18}
|
||||
}
|
||||
_, 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("\"></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 ModalMcuWordingShow(idModal string, messageWording string, urlSurvey 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_Var25 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var25 == nil {
|
||||
templ_7745c5c3_Var25 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- modal wording start --><div class=\"modal fade show modalcover\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var26 string
|
||||
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(idModal)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 157, Col: 14}
|
||||
}
|
||||
_, 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-oob=\"true\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\" aria-hidden=\"true\" style=\"display: block;\"><div class=\"modal-dialog modal-dialog-centered\" role=\"document\"><div class=\"modal-content rounded-lg\"><div class=\"modal-header border-bottom-0\"><h1 class=\"text-black font-weight-bolder\">Perhatian</h1></div><div class=\"modal-body border-bottom-0\"><div id=\"spinnerDiv\" class=\"d-flex justify-content-center align-items-center\"><div id=\"spinnerLoading\" class=\"spinner-border text-primary\" role=\"status\"><span class=\"sr-only\">Loading...</span></div></div><h6 id=\"modal-text\" class=\"text-black\" style=\"display: none;\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var27 string
|
||||
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(messageWording)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 177, Col: 22}
|
||||
}
|
||||
_, 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("</h6></div><div class=\"modal-footer border-top-0\"><button id=\"redirectToSurveyMcu\" type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg\" style=\"display:none\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var28 string
|
||||
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(urlSurvey)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\kartukontrol\kartukontrol.templ`, Line: 186, Col: 24}
|
||||
}
|
||||
_, 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-swap=\"none\" hx-include=\"[name='urlSurveyMcu'], [name='nomorRegistrasi']\">OK\r</button></div></div></div></div><script>\r\n\r\n\t// show spinner\r\n\tsetTimeout(function() {\r\n\t\tdocument.getElementById('spinnerDiv').style.display = 'none';\r\n\t\tdocument.getElementById('spinnerLoading').style.display = 'none';\r\n\t\tdocument.getElementById('modal-text').style.display = 'block';\r\n\t\tdocument.getElementById('redirectToSurveyMcu').style.display = 'block';\r\n\t}, 2000); // 2000 milidetik atau 2 detik\r\n\t</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 CssKartuKontrol() 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_Var29 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var29 == nil {
|
||||
templ_7745c5c3_Var29 = 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: var(--white)\r\n }\r\n\t\t.card-control {\r\n\t\t\twidth: 390px;\r\n\t\t\theight: 1212px;\r\n\t\t\tbackground-image: url(\"asset-corporate-portal/media/kartukontrol/bg-kartuKontrol.svg\");\r\n\t\t\tbackground-size: 390px 1212px;\r\n\t\t\tbackground-repeat: no-repeat;\r\n margin: auto;\r\n\t\t}\r\n\t\t.foto {\r\n\t\t\twidth: 70px;\r\n\t\t\theight: 79px;\r\n\t\t\tbackground-image: url(\"assets/media/svg/avatars/001-boy.svg\");\r\n\t\t\tbackground-size: 70px 79px;\r\n\t\t\tbackground-repeat: no-repeat;\r\n\t\t}\r\n\t\t.top-right {\r\n\t\t\tposition: absolute;\r\n\t\t\ttop: 0;\r\n\t\t\tright: 0;\r\n\t\t}\r\n\t\th5 {\r\n\t\t\tfont-size: 14px;\r\n\t\t}\r\n\t\th6 {\r\n\t\t\tfont-size: 12px;\r\n\t\t}\r\n\t\t.smallf {\r\n\t\t\tfont-size: 10px;\r\n\t\t}\r\n\t\t.modalcover {\r\n\t\t\tbackground-color: #00000073;\r\n\t\t}\r\n\t</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 JsKartuKontrol() 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_Var30 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var30 == nil {
|
||||
templ_7745c5c3_Var30 = 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 ShowKartuKontrol(title string, cmp templ.Component, css templ.Component, js 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_Var31 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var31 == nil {
|
||||
templ_7745c5c3_Var31 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Var32 := 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.PlaygroundLayout(title, css, js).Render(templ.WithChildren(ctx, templ_7745c5c3_Var32), 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
|
||||
})
|
||||
}
|
||||
305
views/public/surveymcu/surveymcu.templ
Normal file
305
views/public/surveymcu/surveymcu.templ
Normal file
@@ -0,0 +1,305 @@
|
||||
package public_surveymcu
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/layout"
|
||||
)
|
||||
|
||||
func concatIdErrorMessage(idPertanyaan string) string {
|
||||
return "errorMessage-" + idPertanyaan
|
||||
}
|
||||
|
||||
func concatNameDefault(NameRadioButton string) string {
|
||||
return "default-" + NameRadioButton
|
||||
}
|
||||
|
||||
func isIDInClearList(IDItemSurvey string, idclear []models.IdClearErrorMessage) bool {
|
||||
for _, item := range idclear {
|
||||
if item.IdItem == IDItemSurvey {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
templ MainContentSurveyMcuLayout(dataSurveyMcu []models.SurveyMcu, urlPost string, errorComp templ.Component, hxInclude string) {
|
||||
// toast
|
||||
<div class="toast-top-right" id="container-system-notification-x01" style="position: fixed; top: 1vh; right: 0vw; z-index: 999;">
|
||||
<!-- toast success -->
|
||||
<div
|
||||
id="notification-kartukontrol-001"
|
||||
class="toast fade fade"
|
||||
role="alert"
|
||||
aria-live="assertive"
|
||||
aria-atomic="true"
|
||||
>
|
||||
<div class="toast-header bg-success text-white">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--ep mr-2 icon-xl" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 1024 1024" data-icon="ep:success-filled"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"></path></svg>
|
||||
<strong class="mr-auto">Success</strong>
|
||||
<small class="text-muted text-white">just now</small>
|
||||
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body bg-success-transparent">
|
||||
This is a success toast.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
// end toast
|
||||
<div class="content-fluid bg-field">
|
||||
<!-- judul start -->
|
||||
<div class="py-15 px-9">
|
||||
<h1 class="title text-primary text-center">Survey MCU</h1>
|
||||
</div>
|
||||
<!-- judul end -->
|
||||
<div class="mb-2"></div>
|
||||
// <form hx-post={ urlPost }>
|
||||
<div class="px-10">
|
||||
if len(dataSurveyMcu) > 0 {
|
||||
for _, v := range dataSurveyMcu {
|
||||
// radio button
|
||||
if len(v.DataListItemSurveyMcu) > 0 {
|
||||
for _, k := range v.DataListItemSurveyMcu {
|
||||
<!-- pertanyaan 1 start -->
|
||||
<div class="card shadow-sm py-2 mb-8" style="border-radius: 12px">
|
||||
<div class="card-body px-10 py-10">
|
||||
<!-- pertanyaan -->
|
||||
<div class="flex-container">
|
||||
<h5
|
||||
class="title-pertanyaan text-black no-margin-padding flex-number"
|
||||
>
|
||||
{ k.Nomor }.
|
||||
</h5>
|
||||
<h5
|
||||
class="title-pertanyaan text-black no-margin-padding flex-question"
|
||||
>
|
||||
{ k.Pertanyaan }
|
||||
</h5>
|
||||
</div>
|
||||
<!-- jawaban start -->
|
||||
<div class="mt-5">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-group">
|
||||
<input type="hidden" name={ concatNameDefault(k.NameRadioButton) } value={ concatNameDefault(k.NameRadioButton) }/>
|
||||
<input type="hidden" name="id-radio" value={ k.IDItemSurvey }/>
|
||||
<div class="radio-list">
|
||||
<label class="radio">
|
||||
<input type="radio" name={ k.NameRadioButton } value="Baik"/>
|
||||
<span></span>
|
||||
<h3 class="text-jawaban">Baik</h3>
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name={ k.NameRadioButton } value="Kurang"/>
|
||||
<span></span>
|
||||
<h3 class="text-jawaban">Kurang</h3>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- jawaban end -->
|
||||
<div
|
||||
id={ concatIdErrorMessage(k.IDItemSurvey) }
|
||||
class="form-group validated"
|
||||
style="display: none"
|
||||
>
|
||||
<div class="invalid-feedback">
|
||||
hello
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- pertanyaan 1 end -->
|
||||
}
|
||||
}
|
||||
// text area
|
||||
if len(v.DataListItemSurveyMcuSaran) > 0 {
|
||||
for _, q := range v.DataListItemSurveyMcuSaran {
|
||||
<input type="hidden" name={ concatNameDefault(q.NameSurveyMcuSaran) } value={ concatNameDefault(q.NameSurveyMcuSaran) }/>
|
||||
<input type="hidden" name="id-saran" value={ q.IDItemSurveyMcuSaran }/>
|
||||
<!-- text area saran start -->
|
||||
<textarea
|
||||
class="form-control saran-mcu mb-10"
|
||||
name={ q.NameSurveyMcuSaran }
|
||||
rows="9"
|
||||
placeholder="Saran"
|
||||
></textarea>
|
||||
<div
|
||||
id={ concatIdErrorMessage(q.IDItemSurveyMcuSaran) }
|
||||
class="form-group validated"
|
||||
style="display: none"
|
||||
>
|
||||
<div class="invalid-feedback">
|
||||
hello
|
||||
</div>
|
||||
</div>
|
||||
<!-- text area saran end -->
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<!-- button submit start -->
|
||||
<button
|
||||
class="btn btn-lg btn-primary text-white"
|
||||
style="border-radius: 8px; width: 100%"
|
||||
type="submit"
|
||||
hx-swap="none"
|
||||
hx-post={ urlPost }
|
||||
hx-include={ hxInclude }
|
||||
>
|
||||
<span class="title-button text-center">Submit</span>
|
||||
</button>
|
||||
<!-- button submit end -->
|
||||
<!-- atur spacing bottom -->
|
||||
<div style="height: 14vh"></div>
|
||||
</div>
|
||||
// </form>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ErrorMessageSurveyMcu(ErrorMessage string, IDItemSurvey string, idclear []models.IdClearErrorMessage, idSaranMcuAlert string, toast templ.Component) {
|
||||
if len(idclear) > 0 {
|
||||
for _, v := range idclear {
|
||||
<!-- error pertanyaan kosong start -->
|
||||
<div
|
||||
id={ concatIdErrorMessage(v.IdItem) }
|
||||
hx-swap-oob="true"
|
||||
class="form-group validated"
|
||||
style="display:none"
|
||||
>
|
||||
<div class="invalid-feedback">
|
||||
{ ErrorMessage }
|
||||
</div>
|
||||
</div>
|
||||
<!-- error pertanyaan kosong end -->
|
||||
}
|
||||
}
|
||||
<!-- error pertanyaan kosong start -->
|
||||
<div
|
||||
id={ concatIdErrorMessage(IDItemSurvey) }
|
||||
hx-swap-oob="true"
|
||||
class="form-group validated"
|
||||
>
|
||||
<div class="invalid-feedback">
|
||||
{ ErrorMessage }
|
||||
</div>
|
||||
</div>
|
||||
@toast
|
||||
}
|
||||
|
||||
templ CssSurveyMcu() {
|
||||
<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: var(--fieldbg);
|
||||
}
|
||||
.card-control {
|
||||
width: 390px;
|
||||
height: 1212px;
|
||||
/* background-image: url("asset-corporate-portal/media/kartukontrol/bg-kartuKontrol.svg");
|
||||
background-size: 390px 1212px;
|
||||
background-repeat: no-repeat; */
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-family: Poppins;
|
||||
font-size: 24px;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.title-pertanyaan {
|
||||
font-family: Poppins;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.no-margin-padding {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.flex-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.flex-number {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.flex-question {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.text-jawaban {
|
||||
color: var(--textjawabansurveymcu);
|
||||
font-family: Poppins;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.radio-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.radio {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.radio h3 {
|
||||
margin: 0;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.saran-mcu::placeholder {
|
||||
color: var(--text-disabled);
|
||||
font-family: Poppins, sans-serif;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.title-button {
|
||||
font-family: "Public Sans";
|
||||
font-size: 15px;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
line-height: 26px;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
templ JsSurveyMcu() {
|
||||
}
|
||||
|
||||
templ ShowSurveyMcu(title string, cmp templ.Component, css templ.Component, js templ.Component) {
|
||||
@layout.PlaygroundLayout(title, css, js) {
|
||||
@cmp
|
||||
}
|
||||
}
|
||||
455
views/public/surveymcu/surveymcu_templ.go
Normal file
455
views/public/surveymcu/surveymcu_templ.go
Normal file
@@ -0,0 +1,455 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package public_surveymcu
|
||||
|
||||
//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"
|
||||
"cpone/models"
|
||||
)
|
||||
|
||||
func concatIdErrorMessage(idPertanyaan string) string {
|
||||
return "errorMessage-" + idPertanyaan
|
||||
}
|
||||
|
||||
func concatNameDefault(NameRadioButton string) string {
|
||||
return "default-" + NameRadioButton
|
||||
}
|
||||
|
||||
func isIDInClearList(IDItemSurvey string, idclear []models.IdClearErrorMessage) bool {
|
||||
for _, item := range idclear {
|
||||
if item.IdItem == IDItemSurvey {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func MainContentSurveyMcuLayout(dataSurveyMcu []models.SurveyMcu, urlPost string, errorComp templ.Component, hxInclude string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_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=\"toast-top-right\" id=\"container-system-notification-x01\" style=\"position: fixed; top: 1vh; right: 0vw; z-index: 999;\"><!-- toast success --><div id=\"notification-kartukontrol-001\" class=\"toast fade fade\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"><div class=\"toast-header bg-success text-white\"><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" role=\"img\" class=\"iconify iconify--ep mr-2 icon-xl\" width=\"1em\" height=\"1em\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 1024 1024\" data-icon=\"ep:success-filled\"><path fill=\"currentColor\" d=\"M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z\"></path></svg> <strong class=\"mr-auto\">Success</strong> <small class=\"text-muted text-white\">just now</small> <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div><div class=\"toast-body bg-success-transparent\">This is a success toast.\r</div></div></div><div class=\"content-fluid bg-field\"><!-- judul start --><div class=\"py-15 px-9\"><h1 class=\"title text-primary text-center\">Survey MCU</h1></div><!-- judul end --><div class=\"mb-2\"></div><div class=\"px-10\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if len(dataSurveyMcu) > 0 {
|
||||
for _, v := range dataSurveyMcu {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if len(v.DataListItemSurveyMcu) > 0 {
|
||||
for _, k := range v.DataListItemSurveyMcu {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- pertanyaan 1 start --> <div class=\"card shadow-sm py-2 mb-8\" style=\"border-radius: 12px\"><div class=\"card-body px-10 py-10\"><!-- pertanyaan --><div class=\"flex-container\"><h5 class=\"title-pertanyaan text-black no-margin-padding flex-number\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(k.Nomor)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 72, Col: 20}
|
||||
}
|
||||
_, 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(". \r</h5><h5 class=\"title-pertanyaan text-black no-margin-padding flex-question\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(k.Pertanyaan)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 77, Col: 25}
|
||||
}
|
||||
_, 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("</h5></div><!-- jawaban start --><div class=\"mt-5\"><div class=\"row\"><div class=\"col-12\"><div class=\"form-group\"><input type=\"hidden\" name=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(concatNameDefault(k.NameRadioButton))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 85, Col: 77}
|
||||
}
|
||||
_, 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("\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(concatNameDefault(k.NameRadioButton))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 85, Col: 124}
|
||||
}
|
||||
_, 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("\"> <input type=\"hidden\" name=\"id-radio\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(k.IDItemSurvey)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 86, Col: 72}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><div class=\"radio-list\"><label class=\"radio\"><input type=\"radio\" name=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(k.NameRadioButton)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 89, Col: 59}
|
||||
}
|
||||
_, 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("\" value=\"Baik\"> <span></span><h3 class=\"text-jawaban\">Baik</h3></label> <label class=\"radio\"><input type=\"radio\" name=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(k.NameRadioButton)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 94, Col: 59}
|
||||
}
|
||||
_, 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("\" value=\"Kurang\"> <span></span><h3 class=\"text-jawaban\">Kurang</h3></label></div></div></div></div></div><!-- jawaban end --><div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(concatIdErrorMessage(k.IDItemSurvey))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 105, Col: 51}
|
||||
}
|
||||
_, 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("\" class=\"form-group validated\" style=\"display: none\"><div class=\"invalid-feedback\">hello\r</div></div></div></div><!-- pertanyaan 1 end -->")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if len(v.DataListItemSurveyMcuSaran) > 0 {
|
||||
for _, q := range v.DataListItemSurveyMcuSaran {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input type=\"hidden\" name=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(concatNameDefault(q.NameSurveyMcuSaran))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 121, Col: 74}
|
||||
}
|
||||
_, 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("\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(concatNameDefault(q.NameSurveyMcuSaran))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 121, Col: 124}
|
||||
}
|
||||
_, 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("\"> <input type=\"hidden\" name=\"id-saran\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var12 string
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(q.IDItemSurveyMcuSaran)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 122, Col: 74}
|
||||
}
|
||||
_, 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("\"><!-- text area saran start --> <textarea class=\"form-control saran-mcu mb-10\" name=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(q.NameSurveyMcuSaran)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 126, Col: 35}
|
||||
}
|
||||
_, 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("\" rows=\"9\" placeholder=\"Saran\"></textarea><div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var14 string
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(concatIdErrorMessage(q.IDItemSurveyMcuSaran))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 131, Col: 57}
|
||||
}
|
||||
_, 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=\"form-group validated\" style=\"display: none\"><div class=\"invalid-feedback\">hello\r</div></div><!-- text area saran end -->")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- button submit start --><button class=\"btn btn-lg btn-primary text-white\" style=\"border-radius: 8px; width: 100%\" type=\"submit\" hx-swap=\"none\" hx-post=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var15 string
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(urlPost)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 150, Col: 21}
|
||||
}
|
||||
_, 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-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var16 string
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 151, 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("\"><span class=\"title-button text-center\">Submit</span></button><!-- button submit end --><!-- atur spacing bottom --><div style=\"height: 14vh\"></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 ErrorMessageSurveyMcu(ErrorMessage string, IDItemSurvey string, idclear []models.IdClearErrorMessage, idSaranMcuAlert string, toast 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_Var17 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var17 == nil {
|
||||
templ_7745c5c3_Var17 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
if len(idclear) > 0 {
|
||||
for _, v := range idclear {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- error pertanyaan kosong start --> <div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var18 string
|
||||
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(concatIdErrorMessage(v.IdItem))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 168, Col: 39}
|
||||
}
|
||||
_, 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-oob=\"true\" class=\"form-group validated\" style=\"display:none\"><div class=\"invalid-feedback\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var19 string
|
||||
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(ErrorMessage)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 174, Col: 19}
|
||||
}
|
||||
_, 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("</div></div><!-- error pertanyaan kosong end -->")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- error pertanyaan kosong start --><div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var20 string
|
||||
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(concatIdErrorMessage(IDItemSurvey))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 182, Col: 41}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap-oob=\"true\" class=\"form-group validated\"><div class=\"invalid-feedback\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var21 string
|
||||
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(ErrorMessage)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\surveymcu\surveymcu.templ`, Line: 187, Col: 17}
|
||||
}
|
||||
_, 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("</div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = toast.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 CssSurveyMcu() templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var22 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var22 == nil {
|
||||
templ_7745c5c3_Var22 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<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: var(--fieldbg);\r\n }\r\n .card-control {\r\n width: 390px;\r\n height: 1212px;\r\n /* background-image: url(\"asset-corporate-portal/media/kartukontrol/bg-kartuKontrol.svg\");\r\n background-size: 390px 1212px;\r\n background-repeat: no-repeat; */\r\n margin: auto;\r\n }\r\n\r\n .title {\r\n font-family: Poppins;\r\n font-size: 24px;\r\n font-style: normal;\r\n font-weight: 600;\r\n line-height: normal;\r\n }\r\n\r\n .title-pertanyaan {\r\n font-family: Poppins;\r\n font-size: 14px;\r\n font-style: normal;\r\n font-weight: 400;\r\n line-height: 24px;\r\n }\r\n\r\n .no-margin-padding {\r\n margin: 0;\r\n padding: 0;\r\n }\r\n\r\n .flex-container {\r\n display: flex;\r\n align-items: center;\r\n align-items: flex-start;\r\n }\r\n\r\n .flex-number {\r\n margin-right: 5px;\r\n }\r\n\r\n .flex-question {\r\n flex-grow: 1;\r\n }\r\n\r\n .text-jawaban {\r\n color: var(--textjawabansurveymcu);\r\n font-family: Poppins;\r\n font-size: 14px;\r\n font-style: normal;\r\n font-weight: 400;\r\n line-height: 22px;\r\n }\r\n\r\n .radio-list {\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n\r\n .radio {\r\n display: flex;\r\n align-items: center;\r\n margin-bottom: 10px;\r\n }\r\n\r\n .radio h3 {\r\n margin: 0;\r\n padding-left: 10px;\r\n }\r\n\r\n .saran-mcu::placeholder {\r\n color: var(--text-disabled);\r\n font-family: Poppins, sans-serif;\r\n font-size: 14px;\r\n font-style: normal;\r\n font-weight: 400;\r\n line-height: normal;\r\n }\r\n\r\n .title-button {\r\n font-family: \"Public Sans\";\r\n font-size: 15px;\r\n font-style: normal;\r\n font-weight: 700;\r\n line-height: 26px;\r\n }\r\n\t</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 JsSurveyMcu() 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_Var23 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var23 == nil {
|
||||
templ_7745c5c3_Var23 = 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 ShowSurveyMcu(title string, cmp templ.Component, css templ.Component, js 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_Var24 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var24 == nil {
|
||||
templ_7745c5c3_Var24 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Var25 := 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.PlaygroundLayout(title, css, js).Render(templ.WithChildren(ctx, templ_7745c5c3_Var25), 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
|
||||
})
|
||||
}
|
||||
101
views/public/toast/toastpublickartukontrol.templ
Normal file
101
views/public/toast/toastpublickartukontrol.templ
Normal file
@@ -0,0 +1,101 @@
|
||||
package public_toast
|
||||
|
||||
import (
|
||||
"cpone/layout"
|
||||
)
|
||||
|
||||
// kalau eror => bg nya danger
|
||||
// kalau sukses => bgnya success
|
||||
// kalau warning => bgnya warning
|
||||
|
||||
func toastBackgroundKartuKontrol(typeToast string) string {
|
||||
return "bg-" + typeToast
|
||||
}
|
||||
|
||||
func toastBodyKartuKontrol(typeToastBody string) string {
|
||||
return "bg-" + typeToastBody + "-transparent"
|
||||
}
|
||||
|
||||
func toastIconKartuKontrol(typeToast string) string {
|
||||
var stringx string
|
||||
if typeToast == "success" {
|
||||
stringx = "solar:check-circle-broken"
|
||||
} else {
|
||||
if typeToast == "danger" {
|
||||
stringx = "solar:close-circle-broken"
|
||||
} else {
|
||||
if typeToast == "warning" {
|
||||
stringx = "solar:shield-warning-bold"
|
||||
} else {
|
||||
if typeToast == "information" {
|
||||
stringx = "solar:info-square-broken"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stringx
|
||||
}
|
||||
|
||||
templ PublicToastV1KartuKontrolShow(title string, message string, typeToast string) {
|
||||
<div
|
||||
class="toast fade show"
|
||||
role="alert"
|
||||
aria-live="assertive"
|
||||
aria-atomic="true"
|
||||
id="notification-kartukontrol-001"
|
||||
hx-swap-oob="true"
|
||||
hx-get="hidetoastkartukontrol"
|
||||
hx-trigger="load delay:3s"
|
||||
hx-target="this"
|
||||
style="border-radius: 8px 8px 8px 8px;"
|
||||
>
|
||||
<div class={ "toast-header", toastBackgroundKartuKontrol(typeToast) , "text-white" }>
|
||||
<span
|
||||
class="iconify mr-2"
|
||||
data-icon={ toastIconKartuKontrol(typeToast) }
|
||||
></span>
|
||||
<strong class="mr-auto">{ title }</strong>
|
||||
<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",toastBodyKartuKontrol(typeToast) }>
|
||||
{ message }
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ PublicToastV1KartuKontrolHide() {
|
||||
<div
|
||||
id="notification-kartukontrol-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>
|
||||
<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>
|
||||
}
|
||||
|
||||
templ EmptyDiv() {
|
||||
<div></div>
|
||||
}
|
||||
|
||||
templ ShowToastKartuKontrol(title string, cmp templ.Component, css templ.Component, js templ.Component) {
|
||||
@layout.CorporateLayout(title, css, js, EmptyDiv(), EmptyDiv(), EmptyDiv()) {
|
||||
@cmp
|
||||
}
|
||||
}
|
||||
242
views/public/toast/toastpublickartukontrol_templ.go
Normal file
242
views/public/toast/toastpublickartukontrol_templ.go
Normal file
@@ -0,0 +1,242 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package public_toast
|
||||
|
||||
//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"
|
||||
)
|
||||
|
||||
// kalau eror => bg nya danger
|
||||
// kalau sukses => bgnya success
|
||||
// kalau warning => bgnya warning
|
||||
|
||||
func toastBackgroundKartuKontrol(typeToast string) string {
|
||||
return "bg-" + typeToast
|
||||
}
|
||||
|
||||
func toastBodyKartuKontrol(typeToastBody string) string {
|
||||
return "bg-" + typeToastBody + "-transparent"
|
||||
}
|
||||
|
||||
func toastIconKartuKontrol(typeToast string) string {
|
||||
var stringx string
|
||||
if typeToast == "success" {
|
||||
stringx = "solar:check-circle-broken"
|
||||
} else {
|
||||
if typeToast == "danger" {
|
||||
stringx = "solar:close-circle-broken"
|
||||
} else {
|
||||
if typeToast == "warning" {
|
||||
stringx = "solar:shield-warning-bold"
|
||||
} else {
|
||||
if typeToast == "information" {
|
||||
stringx = "solar:info-square-broken"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stringx
|
||||
}
|
||||
|
||||
func PublicToastV1KartuKontrolShow(title string, message string, typeToast 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 class=\"toast fade show\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" id=\"notification-kartukontrol-001\" hx-swap-oob=\"true\" hx-get=\"hidetoastkartukontrol\" hx-trigger=\"load delay:3s\" hx-target=\"this\" style=\"border-radius: 8px 8px 8px 8px;\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 = []any{"toast-header", toastBackgroundKartuKontrol(typeToast), "text-white"}
|
||||
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var2).String())
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\toast\toastpublickartukontrol.templ`, Line: 1, Col: 0}
|
||||
}
|
||||
_, 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("\"><span class=\"iconify mr-2\" data-icon=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(toastIconKartuKontrol(typeToast))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\toast\toastpublickartukontrol.templ`, Line: 56, Col: 48}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></span> <strong class=\"mr-auto\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(title)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\toast\toastpublickartukontrol.templ`, Line: 58, 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("</strong> <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 = []any{"toast-body", toastBodyKartuKontrol(typeToast)}
|
||||
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var6).String())
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\toast\toastpublickartukontrol.templ`, Line: 1, Col: 0}
|
||||
}
|
||||
_, 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(message)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\toast\toastpublickartukontrol.templ`, Line: 64, Col: 12}
|
||||
}
|
||||
_, 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
|
||||
})
|
||||
}
|
||||
|
||||
func PublicToastV1KartuKontrolHide() 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 id=\"notification-kartukontrol-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> <small class=\"text-muted text-white\">just now</small> <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div><div class=\"toast-body bg-success-transparent\">This is a success toast.\r</div></div>")
|
||||
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 EmptyDiv() 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></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 ShowToastKartuKontrol(title string, cmp templ.Component, css templ.Component, js 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_Var11 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var11 == nil {
|
||||
templ_7745c5c3_Var11 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Var12 := 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, EmptyDiv(), EmptyDiv(), EmptyDiv()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), 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
|
||||
})
|
||||
}
|
||||
100
views/public/toast/toastpublicv1.templ
Normal file
100
views/public/toast/toastpublicv1.templ
Normal file
@@ -0,0 +1,100 @@
|
||||
package public_toast
|
||||
|
||||
import (
|
||||
"cpone/layout"
|
||||
)
|
||||
|
||||
// kalau eror => bg nya danger
|
||||
// kalau sukses => bgnya success
|
||||
// kalau warning => bgnya warning
|
||||
|
||||
func toastBackground(typeToast string) string {
|
||||
return "bg-" + typeToast
|
||||
}
|
||||
|
||||
func toastBody(typeToastBody string) string {
|
||||
return "bg-" + typeToastBody + "-transparent"
|
||||
}
|
||||
|
||||
func toastIcon(typeToast string) string {
|
||||
var stringx string
|
||||
if typeToast == "success" {
|
||||
stringx = "solar:check-circle-broken"
|
||||
} else {
|
||||
if typeToast == "danger" {
|
||||
stringx = "solar:close-circle-broken"
|
||||
} else {
|
||||
if typeToast == "warning" {
|
||||
stringx = "solar:shield-warning-bold"
|
||||
} else {
|
||||
if typeToast == "information" {
|
||||
stringx = "solar:info-square-broken"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stringx
|
||||
}
|
||||
|
||||
templ PublicToastV1Show(title string, message string, typeToast string) {
|
||||
<div
|
||||
class="toast fade show"
|
||||
role="alert"
|
||||
aria-live="assertive"
|
||||
aria-atomic="true"
|
||||
id="notification-001"
|
||||
hx-swap-oob="true"
|
||||
hx-get="/hidetoastpublic"
|
||||
hx-trigger="load delay:3s"
|
||||
hx-target="this"
|
||||
style="border-radius: 8px 8px 8px 8px;"
|
||||
>
|
||||
<div class={ "toast-header", toastBackground(typeToast) , "text-white" }>
|
||||
<span
|
||||
class="iconify mr-2"
|
||||
data-icon={ toastIcon(typeToast) }
|
||||
></span>
|
||||
<strong class="mr-auto">{ title }</strong>
|
||||
<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",toastBody(typeToast) }>
|
||||
{ message }
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ PublicToastV1Hide() {
|
||||
<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>
|
||||
<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>
|
||||
}
|
||||
|
||||
templ ShowToast(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
|
||||
}
|
||||
}
|
||||
221
views/public/toast/toastpublicv1_templ.go
Normal file
221
views/public/toast/toastpublicv1_templ.go
Normal file
@@ -0,0 +1,221 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package public_toast
|
||||
|
||||
//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"
|
||||
)
|
||||
|
||||
// kalau eror => bg nya danger
|
||||
// kalau sukses => bgnya success
|
||||
// kalau warning => bgnya warning
|
||||
|
||||
func toastBackground(typeToast string) string {
|
||||
return "bg-" + typeToast
|
||||
}
|
||||
|
||||
func toastBody(typeToastBody string) string {
|
||||
return "bg-" + typeToastBody + "-transparent"
|
||||
}
|
||||
|
||||
func toastIcon(typeToast string) string {
|
||||
var stringx string
|
||||
if typeToast == "success" {
|
||||
stringx = "solar:check-circle-broken"
|
||||
} else {
|
||||
if typeToast == "danger" {
|
||||
stringx = "solar:close-circle-broken"
|
||||
} else {
|
||||
if typeToast == "warning" {
|
||||
stringx = "solar:shield-warning-bold"
|
||||
} else {
|
||||
if typeToast == "information" {
|
||||
stringx = "solar:info-square-broken"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return stringx
|
||||
}
|
||||
|
||||
func PublicToastV1Show(title string, message string, typeToast 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 class=\"toast fade show\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" id=\"notification-001\" hx-swap-oob=\"true\" hx-get=\"/hidetoastpublic\" hx-trigger=\"load delay:3s\" hx-target=\"this\" style=\"border-radius: 8px 8px 8px 8px;\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 = []any{"toast-header", toastBackground(typeToast), "text-white"}
|
||||
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var2).String())
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\toast\toastpublicv1.templ`, Line: 1, Col: 0}
|
||||
}
|
||||
_, 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("\"><span class=\"iconify mr-2\" data-icon=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(toastIcon(typeToast))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\toast\toastpublicv1.templ`, Line: 56, Col: 36}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></span> <strong class=\"mr-auto\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(title)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\toast\toastpublicv1.templ`, Line: 58, 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("</strong> <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 = []any{"toast-body", toastBody(typeToast)}
|
||||
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var6).String())
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\toast\toastpublicv1.templ`, Line: 1, Col: 0}
|
||||
}
|
||||
_, 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(message)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\public\toast\toastpublicv1.templ`, Line: 64, Col: 12}
|
||||
}
|
||||
_, 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
|
||||
})
|
||||
}
|
||||
|
||||
func PublicToastV1Hide() 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 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> <small class=\"text-muted text-white\">just now</small> <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div><div class=\"toast-body bg-success-transparent\">This is a success toast.\r</div></div>")
|
||||
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 ShowToast(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_Var10 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var10 == nil {
|
||||
templ_7745c5c3_Var10 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Var11 := 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_Var11), 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
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user