Compare commits

...

16 Commits

Author SHA1 Message Date
sindhu
875bf744ce step 5 : proses show delete & proses delete ke database 2024-05-27 15:53:06 +07:00
sindhu
29220fa451 step 4 : proses show edit form & edit data 2024-05-27 14:50:27 +07:00
sindhu
c3dc529747 step 3 : proses add data 2024-05-27 14:02:53 +07:00
sindhu
dd29b169ae step 2 : close add form 2024-05-27 13:19:48 +07:00
sindhu
98f698821c step 1 : initial, loading search and pagination 2024-05-27 12:14:07 +07:00
Sas Andy
4ea514c3f0 Merge branch 'andy/usergroupfix' 2024-05-27 09:10:19 +07:00
Sas Andy
398ee17727 revisi bug 2024-05-27 09:06:00 +07:00
Sas Andy
94fea169d1 loading 2024-05-25 20:10:25 +07:00
Sas Andy
af1c16f8f9 up versi 2024-05-25 20:10:12 +07:00
Sas Andy
10c1d3c5dd revisi toast top right based screen view 2024-05-24 13:51:36 +07:00
Sas Andy
b3ef572180 route 2024-05-24 10:31:48 +07:00
Sas Andy
9f2ac20180 handler delete user group 2024-05-24 10:31:37 +07:00
Sas Andy
922f8492c3 view delete user group 2024-05-24 10:31:15 +07:00
sindhu
d8278b6886 add kartu kontrol and survey mcu into public 2024-05-22 16:39:41 +07:00
Sas Andy
caa6dba306 revisi open dialog edit & edit user group 2024-05-22 15:37:37 +07:00
Sas Andy
4c12c45aa8 open and close edit form 2024-05-22 14:00:17 +07:00
95 changed files with 14919 additions and 115 deletions

View File

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

View File

@@ -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;
@@ -5198,6 +5202,8 @@ a.text-hover-tosca:hover .svg-icon svg:hover g [fill],
z-index: 99999999999 !important;
width: 350px;
height: auto;
margin-top: 2vh;
margin-right: 2vw;
}
/* ### TOAST FONT SIZE */
@@ -5205,6 +5211,21 @@ a.text-hover-tosca:hover .svg-icon svg:hover g [fill],
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;
@@ -5274,6 +5295,16 @@ a.text-hover-tosca:hover .svg-icon svg:hover g [fill],
/* ## WARNING */
/* ## DANGER */
/* ### HTMX INDICATOR */
.htmx-indicator {
display: none !important;
}
.htmx-request .htmx-indicator {
display: inline-block !important;
}
.htmx-request.htmx-indicator {
display: inline-block !important;
}
/* ### BUTTON HOVER TEXT */
/* ### */
/* ## PRIMARY */

View File

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

View File

@@ -0,0 +1,143 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package customcheckbox
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import "cpone/models"
func MainCustomCheckboxInput(inp models.CustomCheckboxv1Prm) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"form-control bg-field border-0 h-auto\"><div class=\"form-group\"><label>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Label)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 8, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</label><div class=\"checkbox-list\"><label class=\"checkbox\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if inp.Value == "on" {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input type=\"checkbox\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 12, Col: 44}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 12, Col: 58}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" checked> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input type=\"checkbox\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 14, Col: 44}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 14, Col: 58}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<span></span> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 17, Col: 15}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</label></div></div><div class=\"invalid-feedback text-danger mt-3 ml-2 mt-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv1.templ`, Line: 22, Col: 17}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,61 @@
package customdropdown;
import "cpone/models"
templ MainCustomDropdown(inp models.CustomDropdownv1Prm, listItem templ.Component) {
<div class="form-control bg-field border-0 h-auto">
<select
name={ inp.Name }
class="form-control bg-field selectpicker"
data-live-search="true"
data-size="5"
id={ inp.ID }
hx-get={ inp.HxGet }
hx-target={ inp.HxTarget }
hx-indicator={ inp.HxIndicator }
hx-trigger={ inp.HxTrigger }
hx-include={ inp.HxInclude }
>
@listItem
</select>
<div class="invalid-feedback text-danger mt-3 ml-2 mt-5">
{ inp.ErrorMsg }
</div>
</div>
}
templ MainCustomDropdownInput(inp models.CustomDropdownv1Prm, listItem templ.Component) {
<div class="form-control bg-field border-0 h-auto">
<select
name={ inp.Name }
class="form-control bg-field selectpicker"
data-live-search="true"
data-size="5"
id={ inp.ID }
>
@listItem
</select>
<div class="invalid-feedback text-danger mt-3 ml-2 mt-5">
{ inp.ErrorMsg }
</div>
</div>
}
templ MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string, listItem templ.Component) {
<div class="form-control bg-field border-0 h-auto">
<select
name={ name }
class="form-control bg-field selectpicker"
data-live-search="true"
data-size="5"
id={ id }
hx-get={ hxGet }
hx-target={ hxTarget }
hx-indicator={ hxIndicator }
hx-trigger={ hxTrigger }
hx-include={ hxInclude }
>
@listItem
</select>
</div>
}

View File

@@ -0,0 +1,343 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package customdropdown
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import "cpone/models"
func MainCustomDropdown(inp models.CustomDropdownv1Prm, listItem templ.Component) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"form-control bg-field border-0 h-auto\"><select name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 8, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"form-control bg-field selectpicker\" data-live-search=\"true\" data-size=\"5\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 12, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxGet)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 13, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 14, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxIndicator)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 15, Col: 33}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-trigger=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxTrigger)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 16, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 17, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = listItem.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</select><div class=\"invalid-feedback text-danger mt-3 ml-2 mt-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 22, Col: 17}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func MainCustomDropdownInput(inp models.CustomDropdownv1Prm, listItem templ.Component) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var10 := templ.GetChildren(ctx)
if templ_7745c5c3_Var10 == nil {
templ_7745c5c3_Var10 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"form-control bg-field border-0 h-auto\"><select name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 30, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"form-control bg-field selectpicker\" data-live-search=\"true\" data-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
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,300 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package pagination
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import "strconv"
import "cpone/component/customtextfield"
import "cpone/models"
func PaginationV3(length int,
currentPage int,
link string,
paginationID string,
hxInclude string,
hxTarget string,
hxSwap string,
hxIndicator string,
hxSwapOob string,
hxBeforeRequest templ.ComponentScript,
hxAfterRequest templ.ComponentScript,
) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxAfterRequest)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex justify-content-between align-items-center flex-wrap\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 templ.ComponentScript = hxAfterRequest
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var2.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(paginationID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 24, Col: 19}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap-oob=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapOob)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 25, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><div class=\"d-flex flex-wrap py-2 mr-3\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for i := 0; i < length; i++ {
if (i + 1) == currentPage {
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(link + "?" + "page=" + strconv.Itoa(i+1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 31, Col: 55}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"btn btn-icon btn-sm border-0 btn-light btn-hover-primary active mr-2 my-1\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 33, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 34, Col: 32}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-trigger=\"click\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 templ.ComponentScript = hxBeforeRequest
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 37, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 38, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 39, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(link + "?" + "page=" + strconv.Itoa(i+1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 42, Col: 55}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1 btneditug\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 44, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 templ.ComponentScript = hxBeforeRequest
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 46, Col: 32}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-trigger=\"click\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 48, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 49, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\pagination\paginationv3.templ`, Line: 50, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{
ID: "currpage" + paginationID,
Name: "currpage" + paginationID,
Type: "hidden",
Value: strconv.Itoa(currentPage)}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -48,6 +48,10 @@ func (lh *MdUserGroupHandler) HandleShowMdUserGroupScreen(c echo.Context) error
searchID := utils.GenerateRandomID("searchid")
dialogAddID := utils.GenerateRandomID("dialogaddID")
dialogAddBodyID := utils.GenerateRandomID("dialogaddbodyID")
dialogEditID := utils.GenerateRandomID("dialogEditID")
dialogEditBodyID := utils.GenerateRandomID("dialogEditbodyID")
dialogDeleteID := utils.GenerateRandomID("dialogDeleteID")
dialogDeleteBodyID := utils.GenerateRandomID("dialogDeletebodyID")
dataMenu, err := services.GetMenu()
fmt.Println(dataMenu)
fmt.Println(err)
@@ -108,25 +112,40 @@ func (lh *MdUserGroupHandler) HandleShowMdUserGroupScreen(c echo.Context) error
fmt.Println(dataUserGroup)
return err
}
tableComponent := dev_mdusergroupview.TableUserGroup(dataUserGroup, tableID)
tableComponent := dev_mdusergroupview.TableUserGroup(dataUserGroup,
tableID,
"/dev/md/usergroupv2/openedit",
"#"+dialogEditBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"/dev/md/usergroupv2/opendelete",
"#"+dialogDeleteBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
)
//filter user group component
usergroupFilterComponent := customtextfieldsearch.MainCustomTextFieldSearchV2(searchID,
usergroupFilterComponent := customtextfieldsearch.MainCustomTextFieldSearchV3(searchID,
"search",
"Cari Kode/Nama",
"text",
"/dev/usergroupv2/filter",
"/dev/md/usergroupv2/filter",
"input changed delay:500ms, search",
"#"+paginationID, "", "", "outerHTML", "#tableID, #paginationID, #searchID")
"#"+paginationID, "#loadingcontent", "", "outerHTML", "#tableID, #paginationID, #searchID,#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent())
//Pagination
userGroupPaginationComponent := pagination.PaginationV2(
userGroupPaginationComponent := pagination.PaginationV3(
totalPage,
1,
"/dev/usergroupv2/changepage",
"/dev/md/usergroupv2/changepage",
paginationID,
"#tableID, #searchID, #"+searchID+", #paginationID",
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"#"+paginationID,
"outerHTML", "", "",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent(),
)
//modal add form
@@ -148,22 +167,22 @@ func (lh *MdUserGroupHandler) HandleShowMdUserGroupScreen(c echo.Context) error
Type: "hidden", ID: "usergroupinputid"},
dialogAddBodyID, dev_mdusergroupview.JsHideModal(""))
modalActioAddCmp := dev_mdusergroupview.ActionFormUserGroup(
"/dev/usergroupv2/closeaddform",
"/dev/md/usergroupv2/closeaddform",
"#"+dialogAddBodyID,
"outerHTML",
"#"+dialogAddID)
btnCloaseModalAdd := dev_mdusergroupview.BtnCloseFormUserGroup(
"/dev/usergroupv2/closeaddform",
"/dev/md/usergroupv2/closeaddform",
"#"+dialogAddBodyID,
"outerHTML",
"#"+dialogAddID)
modalAddFormComponent := dev_mdusergroupview.UserGroupForm(
models.UserGroupFormComponent{
IDComponent: "formusergroup",
Link: "/dev/usergroupv2/add",
Link: "/dev/md/usergroupv2/add",
HxTarget: "#" + dialogAddBodyID,
HxSwap: "outerHTML",
HxInclude: "#tableID, #paginationID, #searchID, #dialogAddBodyID, #dialogAddID, #" + searchID + ", #currpage" + paginationID,
HxInclude: "#tableID, #paginationID, #searchID, #dialogAddBodyID, #dialogAddID, #dialogDeleteBodyID, #dialogEditBodyID, #" + searchID + ", #currpage" + paginationID,
ModalID: dialogAddID,
ModalTitle: "New-User Group",
DialogBody: dialogAddBodyCmp,
@@ -172,6 +191,91 @@ func (lh *MdUserGroupHandler) HandleShowMdUserGroupScreen(c echo.Context) error
},
)
//modal edit form
dialogEditBodyCmp := dev_mdusergroupview.BodyFormUserGroup(
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupcode",
Placeholder: "Kode user group",
Type: "text", ID: "usergroupinputname"},
models.CustomTextFieldv2Prm{
Label: "Nama User Group",
Name: "usergroupname",
Placeholder: "Nama user group",
Type: "text", ID: "usergroupinputname"},
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupid",
Placeholder: "Kode user group",
Type: "hidden", ID: "usergroupinputid"},
dialogEditBodyID, dev_mdusergroupview.JsHideModal(""))
modalActioEditCmp := dev_mdusergroupview.ActionFormUserGroup(
"/dev/md/usergroupv2/closeeditform",
"#"+dialogEditBodyID,
"outerHTML",
"#"+dialogEditID)
btnCloaseModalEdit := dev_mdusergroupview.BtnCloseFormUserGroup(
"/dev/md/usergroupv2/closeeditform",
"#"+dialogEditBodyID,
"outerHTML",
"#"+dialogEditID)
modalEditFormComponent := dev_mdusergroupview.UserGroupForm(
models.UserGroupFormComponent{
IDComponent: "formusergroup",
Link: "/dev/md/usergroupv2/edit",
HxTarget: "#" + dialogEditBodyID,
HxSwap: "outerHTML",
HxInclude: "#tableID, #paginationID, #searchID, #dialogDeleteBodyID, #dialogEditBodyID, #dialogEditID, #" + searchID + ", #currpage" + paginationID,
ModalID: dialogEditID,
ModalTitle: "New-User Group",
DialogBody: dialogEditBodyCmp,
DialogAction: modalActioEditCmp,
ButtonCLose: btnCloaseModalEdit,
},
)
//modal delete form
dialogDeleteBodyCmp := dev_mdusergroupview.BodyFormUserGroup(
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupcode",
Placeholder: "Kode user group",
Type: "text", ID: "usergroupinputname"},
models.CustomTextFieldv2Prm{
Label: "Nama User Group",
Name: "usergroupname",
Placeholder: "Nama user group",
Type: "text", ID: "usergroupinputname"},
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupid",
Placeholder: "Kode user group",
Type: "hidden", ID: "usergroupinputid"},
dialogDeleteBodyID, dev_mdusergroupview.JsHideModal(""))
modalActioDeleteCmp := dev_mdusergroupview.ActionFormUserGroupDelete(
"/dev/md/usergroupv2/closedeleteform",
"#"+dialogDeleteBodyID,
"outerHTML",
"#"+dialogDeleteID)
btnCloaseModalDelete := dev_mdusergroupview.BtnCloseFormUserGroup(
"/dev/md/usergroupv2/closedeleteform",
"#"+dialogDeleteBodyID,
"outerHTML",
"#"+dialogDeleteID)
modalDeleteFormComponent := dev_mdusergroupview.UserGroupForm(
models.UserGroupFormComponent{
IDComponent: "formusergroup",
Link: "/dev/md/usergroupv2/delete",
HxTarget: "#" + dialogDeleteBodyID,
HxSwap: "outerHTML",
HxInclude: "#tableID, #paginationID, #searchID, #dialogDeleteBodyID, #dialogDeleteID, #dialogEditBodyID, #" + searchID + ", #currpage" + paginationID,
ModalID: dialogDeleteID,
ModalTitle: "New-User Group",
DialogBody: dialogDeleteBodyCmp,
DialogAction: modalActioDeleteCmp,
ButtonCLose: btnCloaseModalDelete,
},
)
//content js & css
content := dev_mdusergroupview.MdUserGroupScreen(
tableID,
@@ -179,15 +283,27 @@ func (lh *MdUserGroupHandler) HandleShowMdUserGroupScreen(c echo.Context) error
searchID,
dialogAddID,
dialogAddBodyID,
dialogEditID,
dialogEditBodyID,
dialogDeleteID,
dialogDeleteBodyID,
breadcrumbComponent,
tableComponent,
usergroupFilterComponent,
userGroupPaginationComponent,
modalAddFormComponent)
modalAddFormComponent,
modalEditFormComponent,
modalDeleteFormComponent)
css := dev_mdusergroupview.CssMdUserGroup()
js := dev_mdusergroupview.JsMdUserGroup()
view := dev_mdusergroupview.ShowMdUserGroupScreen(title, content, css, js, navbarmenuComponent, navbaruserComponent, sidebaruserprofileComponent)
view := dev_mdusergroupview.ShowMdUserGroupScreen(title,
content,
css,
js,
navbarmenuComponent,
navbaruserComponent,
sidebaruserprofileComponent)
return utils.View(c, view)
}
func (lh *MdUserGroupHandler) HandleFilterMdUserGroup(c echo.Context) error {
@@ -195,6 +311,8 @@ func (lh *MdUserGroupHandler) HandleFilterMdUserGroup(c echo.Context) error {
searchID := c.QueryParam("searchID")
tableID := c.QueryParam("tableID")
paginationID := c.QueryParam("paginationID")
dialogEditBodyID := c.QueryParam("dialogEditBodyID")
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
var retval []templ.Component
logger, _ := zap.NewProduction()
@@ -207,15 +325,26 @@ func (lh *MdUserGroupHandler) HandleFilterMdUserGroup(c echo.Context) error {
fmt.Println(dataUserGroup)
return err
}
tableComponent := dev_mdusergroupview.TableUserGroup(dataUserGroup, tableID)
userGroupPaginationComponent := pagination.PaginationV2(
tableComponent := dev_mdusergroupview.TableUserGroup(dataUserGroup,
tableID,
"/dev/md/usergroupv2/openedit",
"#"+dialogEditBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"/dev/md/usergroupv2/opendelete",
"#"+dialogDeleteBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
userGroupPaginationComponent := pagination.PaginationV3(
totalpage,
1,
"/dev/usergroupv2/changepage",
"/dev/md/usergroupv2/changepage",
paginationID,
"#tableID, #searchID, #"+searchID+", #paginationID",
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"#"+paginationID,
"outerHTML", "", "",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent(),
)
retval = append(retval, tableComponent)
retval = append(retval, userGroupPaginationComponent)
@@ -227,6 +356,8 @@ func (lh *MdUserGroupHandler) HandleChangePageMdUserGroup(c echo.Context) error
tableID := c.QueryParam("tableID")
searchID := c.QueryParam("searchID")
paginationID := c.QueryParam("paginationID")
dialogEditBodyID := c.QueryParam("dialogEditBodyID")
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
var retval []templ.Component
logger, _ := zap.NewProduction()
page, err := strconv.Atoi(pageparam)
@@ -247,15 +378,27 @@ func (lh *MdUserGroupHandler) HandleChangePageMdUserGroup(c echo.Context) error
fmt.Println(dataUserGroup)
return err
}
tableComponent := dev_mdusergroupview.TableUserGroup(dataUserGroup, tableID)
userGroupPaginationComponent := pagination.PaginationV2(
tableComponent := dev_mdusergroupview.TableUserGroup(dataUserGroup,
tableID,
"/dev/md/usergroupv2/openedit",
"#"+dialogEditBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"/dev/md/usergroupv2/opendelete",
"#"+dialogDeleteBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
)
userGroupPaginationComponent := pagination.PaginationV3(
totalpage,
page,
"/dev/usergroupv2/changepage",
"/dev/md/usergroupv2/changepage",
paginationID,
"#tableID, #searchID, #"+searchID+", #paginationID",
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"#"+paginationID,
"outerHTML", "", "",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent(),
)
retval = append(retval, tableComponent)
retval = append(retval, userGroupPaginationComponent)
@@ -297,6 +440,8 @@ func (lh *MdUserGroupHandler) HandleAddUserGroup(c echo.Context) error {
currPagePrm := c.FormValue("currpage" + paginationID)
dialogAddBodyID := c.FormValue("dialogAddBodyID")
dialogAddID := c.FormValue("dialogAddID")
dialogEditBodyID := c.FormValue("dialogEditBodyID")
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
currPage, err := strconv.Atoi(currPagePrm)
if err != nil {
@@ -403,18 +548,29 @@ func (lh *MdUserGroupHandler) HandleAddUserGroup(c echo.Context) error {
return err
}
//table component
tableComponent := dev_mdusergroupview.TableUserGroup(dataUserGroupList, tableID)
tableComponent := dev_mdusergroupview.TableUserGroup(dataUserGroupList,
tableID,
"/dev/md/usergroupv2/openedit",
"#"+dialogEditBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"/dev/md/usergroupv2/opendelete",
"#"+dialogDeleteBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
//pagination component
//Pagination
userGroupPaginationComponent := pagination.PaginationV2(
userGroupPaginationComponent := pagination.PaginationV3(
totalPage,
currPage,
"/dev/usergroupv2/changepage",
"/dev/md/usergroupv2/changepage",
paginationID,
"#tableID, #searchID, #"+searchID+", #paginationID",
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"#"+paginationID,
"outerHTML", "", "true",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent(),
)
newForm := dev_mdusergroupview.BodyFormUserGroup(
@@ -444,3 +600,395 @@ func (lh *MdUserGroupHandler) HandleAddUserGroup(c echo.Context) error {
userGroupPaginationComponent,
newForm})
}
func (lh *MdUserGroupHandler) HandleOpenEditForm(c echo.Context) error {
id := c.QueryParam("id")
dialogEditID := c.QueryParam("dialogEditID")
dialogEditBodyID := c.QueryParam("dialogEditBodyID")
dataUserGroup, err := lh.MdUserGroupServices.GetMdUserGroupByID(id)
if err != nil {
newForm := dev_mdusergroupview.BodyFormUserGroup(
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupcode",
Placeholder: "Kode user group",
Type: "text", ID: "usergroupinputname"},
models.CustomTextFieldv2Prm{
Label: "Nama User Group",
Name: "usergroupname",
Placeholder: "Nama user group",
Type: "text", ID: "usergroupinputname"},
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupid",
Placeholder: "Kode user group",
Type: "hidden", ID: "usergroupinputid"},
dialogEditBodyID, dev_mdusergroupview.JsHideModal(""))
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Error", "Get user group error", "danger"), newForm})
}
newForm := dev_mdusergroupview.BodyFormUserGroup(
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupcode",
Placeholder: "Kode user group",
Value: dataUserGroup.M_UserGroupCode,
Type: "text", ID: "usergroupinputname"},
models.CustomTextFieldv2Prm{
Label: "Nama User Group",
Name: "usergroupname",
Placeholder: "Nama user group",
Value: dataUserGroup.M_UserGroupName,
Type: "text", ID: "usergroupinputname"},
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupid",
Placeholder: "Kode user group",
Value: strconv.Itoa(dataUserGroup.M_UserGroupID),
Type: "hidden", ID: "usergroupinputid"},
dialogEditBodyID, dev_mdusergroupview.JsShowModal("#"+dialogEditID))
return utils.View(c, newForm)
}
func (lh *MdUserGroupHandler) HandleCloseFormEdit(c echo.Context) error {
dialogEditBodyID := c.FormValue("dialogEditBodyID")
newForm := dev_mdusergroupview.BodyFormUserGroup(
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupcode",
Placeholder: "Kode user group",
Type: "text", ID: "usergroupinputname"},
models.CustomTextFieldv2Prm{
Label: "Nama User Group",
Name: "usergroupname",
Placeholder: "Nama user group",
Type: "text", ID: "usergroupinputname"},
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupid",
Placeholder: "Kode user group",
Type: "hidden", ID: "usergroupinputid"},
dialogEditBodyID, dev_mdusergroupview.JsHideModal(""))
return utils.View(c, newForm)
}
func (lh *MdUserGroupHandler) HandleEditUserGroup(c echo.Context) error {
logger, _ := zap.NewProduction()
defer logger.Sync()
//prm form addusergroup
code := c.FormValue("usergroupcode")
name := c.FormValue("usergroupname")
id := c.FormValue("usergroupid")
tableID := c.FormValue("tableID")
paginationID := c.FormValue("paginationID")
searchID := c.FormValue("searchID")
search := c.FormValue("search")
currPagePrm := c.FormValue("currpage" + paginationID)
// dialogAddBodyID := c.FormValue("dialogAddBodyID")
dialogEditID := c.FormValue("dialogEditID")
dialogEditBodyID := c.FormValue("dialogEditBodyID")
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
currPage, err := strconv.Atoi(currPagePrm)
if err != nil {
return err
}
logger.Info("ADD USER GROUP PARAM",
zap.Any("code", code),
zap.Any("nama", name),
zap.Any("tableid", tableID),
zap.Any("search", search),
zap.Any("currpage", currPage),
)
formValidation := ""
codeValidation := ""
nameValidation := ""
if strings.TrimSpace(code) == "" {
formValidation = "Code user group tidak boleh kosong"
codeValidation = "Code user group tidak boleh kosong"
nameValidation = ""
}
if strings.TrimSpace(name) == "" {
formValidation = "Nama user group tidak boleh kosong"
codeValidation = ""
nameValidation = "Nama user group tidak boleh kosong"
}
if strings.TrimSpace(code) == "" && strings.TrimSpace(name) == "" {
formValidation = "Code dan nama user group tidak boleh kosong"
codeValidation = "Code user group tidak boleh kosong"
nameValidation = "Nama user group tidak boleh kosong"
}
if formValidation != "" || codeValidation != "" || nameValidation != "" {
newForm := dev_mdusergroupview.BodyFormUserGroup(
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupcode",
Placeholder: "Kode user group",
ErrorMsg: codeValidation,
Value: code,
Type: "text"},
models.CustomTextFieldv2Prm{
Label: "Nama User Group",
Name: "usergroupname",
Placeholder: "Nama user group",
ErrorMsg: nameValidation,
Value: name,
Type: "text"},
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupid",
Placeholder: "Kode user group",
Type: "hidden", ID: "usergroupinputid"},
dialogEditBodyID, dev_mdusergroupview.JsHideModal(""))
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Warning", formValidation, "warning"), newForm})
}
//edit user group service
dataUserGroup, err := lh.MdUserGroupServices.EditMdUsergroup(id, code, name)
if err != nil {
logger.Info("Error",
zap.Any("Error", err),
zap.Any("code", code),
zap.Any("name", name),
)
newForm := dev_mdusergroupview.BodyFormUserGroup(
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupcode",
Placeholder: "Kode user group",
ErrorMsg: codeValidation,
Value: code,
Type: "text"},
models.CustomTextFieldv2Prm{
Label: "Nama User Group",
Name: "usergroupname",
Placeholder: "Nama user group",
ErrorMsg: nameValidation,
Value: name,
Type: "text"},
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupid",
Placeholder: "Kode user group",
Type: "hidden", ID: "usergroupinputid"},
dialogEditBodyID, dev_mdusergroupview.JsHideModal(""))
return utils.ViewMulti(c, []templ.Component{
customtoastv2.CustomToastV2Show("Error", err.Error(), "danger"),
newForm})
}
logger.Info("ADD USER GROUP",
zap.Any("return", dataUserGroup),
zap.Any("code", code),
zap.Any("name", name),
)
//get list user group for table
dataUserGroupList, totalPage, err := lh.MdUserGroupServices.GetListMdUserGroup(search, currPage, 5)
if err != nil {
defer logger.Sync()
logger.Info("ERROR GET USER GROUP",
zap.Any("error", err),
)
fmt.Println(dataUserGroup)
return err
}
//table component
tableComponent := dev_mdusergroupview.TableUserGroup(dataUserGroupList,
tableID,
"/dev/md/usergroupv2/openedit",
"#"+dialogEditBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"/dev/md/usergroupv2/opendelete",
"#"+dialogDeleteBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
//pagination component
//Pagination
userGroupPaginationComponent := pagination.PaginationV3(
totalPage,
currPage,
"/dev/md/usergroupv2/changepage",
paginationID,
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"#"+paginationID,
"outerHTML", "", "true",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent(),
)
var retVal []templ.Component
newForm := dev_mdusergroupview.BodyFormUserGroup(
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupcode",
Placeholder: "Kode user group",
ErrorMsg: codeValidation,
Type: "text"},
models.CustomTextFieldv2Prm{
Label: "Nama User Group",
Name: "usergroupname",
Placeholder: "Nama user group",
ErrorMsg: nameValidation,
Type: "text"},
models.CustomTextFieldv2Prm{
Label: "Kode User Group",
Name: "usergroupid",
Placeholder: "Kode user group",
Type: "hidden", ID: "usergroupinputid"},
dialogEditBodyID, dev_mdusergroupview.JsHideModal("#"+dialogEditID))
toastSuccess := customtoastv2.CustomToastV2Show("Success", "Berhasil edit User group "+name, "success")
retVal = append(retVal, toastSuccess)
retVal = append(retVal, tableComponent)
retVal = append(retVal, userGroupPaginationComponent)
retVal = append(retVal, newForm)
return utils.ViewMulti(c, retVal)
}
func (lh *MdUserGroupHandler) HandleOpenDeleteForm(c echo.Context) error {
id := c.QueryParam("id")
dialogDeleteID := c.QueryParam("dialogDeleteID")
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
dataUserGroup, err := lh.MdUserGroupServices.GetMdUserGroupByID(id)
if err != nil {
newForm := dev_mdusergroupview.DeleteConfirmationBody(
models.CustomTextFieldv2Prm{Name: "usergroupid", Type: "hidden", Value: strconv.Itoa(dataUserGroup.M_UserGroupID)},
dialogDeleteBodyID,
"Apakah anda yakin menghapus user group berikut ?",
[]string{"Kode", "User Group"},
[]string{"", ""},
dev_mdusergroupview.JsShowModal(""))
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Error", "Get user group error", "danger"), newForm})
}
newForm := dev_mdusergroupview.DeleteConfirmationBody(
models.CustomTextFieldv2Prm{Name: "usergroupid", Type: "hidden", Value: strconv.Itoa(dataUserGroup.M_UserGroupID)},
dialogDeleteBodyID,
"Apakah anda yakin menghapus user group berikut ?",
[]string{"Kode", "User Group"},
[]string{dataUserGroup.M_UserGroupCode, dataUserGroup.M_UserGroupName},
dev_mdusergroupview.JsShowModal("#"+dialogDeleteID))
return utils.View(c, newForm)
}
func (lh *MdUserGroupHandler) HandleCloseFormDelete(c echo.Context) error {
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
newForm := dev_mdusergroupview.DeleteConfirmationBody(
models.CustomTextFieldv2Prm{Name: "usergroupid", Type: "hidden", Value: ""},
dialogDeleteBodyID,
"Apakah anda yakin menghapus user group berikut ?",
[]string{"Kode", "User Group"},
[]string{"", ""},
dev_mdusergroupview.JsShowModal(""))
return utils.View(c, newForm)
}
func (lh *MdUserGroupHandler) HandleDeleteUserGroup(c echo.Context) error {
logger, _ := zap.NewProduction()
defer logger.Sync()
//prm form addusergroup
id := c.FormValue("usergroupid")
tableID := c.FormValue("tableID")
paginationID := c.FormValue("paginationID")
searchID := c.FormValue("searchID")
search := c.FormValue("search")
currPagePrm := c.FormValue("currpage" + paginationID)
// dialogAddBodyID := c.FormValue("dialogAddBodyID")
dialogDeleteID := c.FormValue("dialogDeleteID")
dialogEditBodyID := c.FormValue("dialogEditBodyID")
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
currPage, err := strconv.Atoi(currPagePrm)
if err != nil {
return err
}
logger.Info("ADD USER GROUP PARAM",
zap.Any("tableid", tableID),
zap.Any("search", search),
zap.Any("currpage", currPage),
)
//edit user group service
dataUserGroup, err := lh.MdUserGroupServices.DeleteMdUserGroup(id)
if err != nil {
logger.Info("Error",
zap.Any("Error", err),
)
newForm := dev_mdusergroupview.DeleteConfirmationBody(
models.CustomTextFieldv2Prm{Name: "usergroupid", Type: "hidden", Value: ""},
dialogDeleteBodyID,
"Apakah anda yakin menghapus user group berikut ?",
[]string{"Kode", "User Group"},
[]string{"", ""},
dev_mdusergroupview.JsShowModal(""))
return utils.ViewMulti(c, []templ.Component{
customtoastv2.CustomToastV2Show("Error", err.Error(), "danger"),
newForm})
}
logger.Info("ADD USER GROUP",
zap.Any("return", dataUserGroup),
)
//get list user group for table
dataUserGroupList, totalPage, err := lh.MdUserGroupServices.GetListMdUserGroup(search, currPage, 5)
if err != nil {
defer logger.Sync()
logger.Info("ERROR GET USER GROUP",
zap.Any("error", err),
)
fmt.Println(dataUserGroup)
return err
}
if len(dataUserGroupList) == 0 && totalPage > 1 {
currPage = currPage - 1
dataUserGroupList, _, err = lh.MdUserGroupServices.GetListMdUserGroup(search, currPage, 5)
if err != nil {
defer logger.Sync()
logger.Info("ERROR GET USER GROUP",
zap.Any("error", err),
)
return err
}
}
//table component
tableComponent := dev_mdusergroupview.TableUserGroup(dataUserGroupList,
tableID,
"/dev/md/usergroupv2/openedit",
"#"+dialogEditBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"/dev/md/usergroupv2/opendelete",
"#"+dialogDeleteBodyID,
"outerHTML",
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
//pagination component
//Pagination
userGroupPaginationComponent := pagination.PaginationV3(
totalPage,
currPage,
"/dev/md/usergroupv2/changepage",
paginationID,
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
"#"+paginationID,
"outerHTML", "", "true",
dev_mdusergroupview.BeforeRequestContent(),
dev_mdusergroupview.AfterRequestContent(),
)
var retVal []templ.Component
newForm := dev_mdusergroupview.DeleteConfirmationBody(
models.CustomTextFieldv2Prm{Name: "usergroupid", Type: "hidden", Value: ""},
dialogDeleteBodyID,
"Apakah anda yakin menghapus user group berikut ?",
[]string{"Kode", "User Group"},
[]string{"", ""},
dev_mdusergroupview.JsHideModal("#"+dialogDeleteID))
toastSuccess := customtoastv2.CustomToastV2Show("Success", "Berhasil delete User group ", "success")
retVal = append(retVal, toastSuccess)
retVal = append(retVal, tableComponent)
retVal = append(retVal, userGroupPaginationComponent)
retVal = append(retVal, newForm)
return utils.ViewMulti(c, retVal)
}

View 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)
}

View 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)
}

View File

@@ -68,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")
@@ -215,10 +235,46 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
//New User Group
devMdUserGroupServices := dev_services.NewMdUserGroupServices(appStore)
devMdUserGroupHandlers := dev_handlers.NewMdUserGroupHandler(devMdUserGroupServices)
dev.GET("/usergroupv2", devMdUserGroupHandlers.HandleShowMdUserGroupScreen)
dev.GET("/usergroupv2/filter", devMdUserGroupHandlers.HandleFilterMdUserGroup)
dev.GET("/usergroupv2/changepage", devMdUserGroupHandlers.HandleChangePageMdUserGroup)
dev.POST("/usergroupv2/closeaddform", devMdUserGroupHandlers.HandleCloseFormAdd)
dev.POST("/usergroupv2/add", devMdUserGroupHandlers.HandleAddUserGroup)
dev.GET("/md/usergroupv2", devMdUserGroupHandlers.HandleShowMdUserGroupScreen)
dev.GET("/md/usergroupv2/filter", devMdUserGroupHandlers.HandleFilterMdUserGroup)
dev.GET("/md/usergroupv2/changepage", devMdUserGroupHandlers.HandleChangePageMdUserGroup)
dev.POST("/md/usergroupv2/closeaddform", devMdUserGroupHandlers.HandleCloseFormAdd)
dev.POST("/md/usergroupv2/add", devMdUserGroupHandlers.HandleAddUserGroup)
dev.GET("/md/usergroupv2/openedit", devMdUserGroupHandlers.HandleOpenEditForm)
dev.POST("/md/usergroupv2/closeeditform", devMdUserGroupHandlers.HandleCloseFormEdit)
dev.POST("/md/usergroupv2/edit", devMdUserGroupHandlers.HandleEditUserGroup)
dev.GET("/md/usergroupv2/opendelete", devMdUserGroupHandlers.HandleOpenDeleteForm)
dev.POST("/md/usergroupv2/closedeleteform", devMdUserGroupHandlers.HandleCloseFormDelete)
dev.POST("/md/usergroupv2/delete", devMdUserGroupHandlers.HandleDeleteUserGroup)
// // group result
// devGRServices := dev_services.NewServicesGroupResult(appStore)
// devGRhandlers := dev_handlers.NewGroupResultHandler(devGRServices)
// dev.GET("/groupresult", devGRhandlers.HandlerShowGroupResultV1)
// dev.GET("/searchgroupresultv1", devGRhandlers.HandlerShowGroupResultSearchV1)
// dev.GET("/groupresultv1pagination", devGRhandlers.HandlerShowGroupResultPaginationV1)
// dev.POST("/groupresulthandlecloseform", devGRhandlers.HandleCloseForm)
// dev.POST("/groupresulthandlecloseformedit", devGRhandlers.HandleCloseFormEdit)
// dev.GET("/groupresultshoweditform", devGRhandlers.HandleEditForm)
// dev.GET("/groupresultshowdeleteform", devGRhandlers.HandleDeleteForm)
// // dev.GET("/groupresultshowdeleteform", devGRhandlers.HandleDeleteForm)
// // form add
// dev.POST("/groupresult/add", devGRhandlers.AddGroupResult)
// dev.POST("/groupresult/edit", devGRhandlers.EditGroupResult)
// dev.POST("/groupresult/delete", devGRhandlers.DeleteGroupResult)
// group result v2
devMdGRServices := dev_services.NewServicesMdGroupResult(appStore)
devMdGRhandlers := dev_handlers.NewMdGroupResultHandler(devMdGRServices)
dev.GET("/md/groupresultv2", devMdGRhandlers.HandleShowMdGroupResultScreen)
dev.GET("/md/groupresultv2/filter", devMdGRhandlers.HandleFilterMdGroupResult)
dev.GET("/md/groupresultv2/changepage", devMdGRhandlers.HandleChangePageMdGroupResult)
dev.POST("/md/groupresultv2/closeaddform", devMdGRhandlers.HandleCloseFormAdd)
dev.POST("/md/groupresultv2/add", devMdGRhandlers.HandleAddGroupResult)
dev.GET("/md/groupresultv2/openedit", devMdGRhandlers.HandleOpenEditForm)
dev.POST("/md/groupresultv2/closeeditform", devMdGRhandlers.HandleCloseFormEdit)
dev.POST("/md/groupresultv2/edit", devMdGRhandlers.HandleEditGroupResult)
dev.GET("/md/groupresultv2/opendelete", devMdGRhandlers.HandleOpenDeleteForm)
dev.POST("/md/groupresultv2/closedeleteform", devMdGRhandlers.HandleCloseFormDelete)
dev.POST("/md/groupresultv2/delete", devMdGRhandlers.HandleDeleteUserGroup)
}

View File

@@ -0,0 +1,23 @@
package breadcrumadmin
templ MainBreadcrumbAdmin() {
<div class="col-11">
<h1 class="title text-black" style="margin-bottom: 0">
PT. Sadhana Abiyasa Sampoerna
</h1>
<nav aria-label="breadcrumb">
<ol class="breadcrumb" style="margin-bottom: 0">
<li class="breadcrumb-item"><a href="#">Dashboard</a></li>
<li class="breadcrumb-item">
<a href="#">Employee Health Medical Analytic</a>
</li>
<li class="breadcrumb-item">
<a href="#">PT. Sadhana Abiyasa Sampoerna</a>
</li>
<li class="breadcrumb-item active" aria-current="page">
Mcu Karyawan
</li>
</ol>
</nav>
</div>
}

View File

@@ -0,0 +1,35 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package breadcrumadmin
//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 MainBreadcrumbAdmin() 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=\"col-11\"><h1 class=\"title text-black\" style=\"margin-bottom: 0\">PT. Sadhana Abiyasa Sampoerna\r</h1><nav aria-label=\"breadcrumb\"><ol class=\"breadcrumb\" style=\"margin-bottom: 0\"><li class=\"breadcrumb-item\"><a href=\"#\">Dashboard</a></li><li class=\"breadcrumb-item\"><a href=\"#\">Employee Health Medical Analytic</a></li><li class=\"breadcrumb-item\"><a href=\"#\">PT. Sadhana Abiyasa Sampoerna</a></li><li class=\"breadcrumb-item active\" aria-current=\"page\">Mcu Karyawan\r</li></ol></nav></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,26 @@
package breadcrumadmin
import "cpone/models"
templ MainBreadcrumbAdminV1(data models.BreadCrumbV1) {
<div class="col-11">
<h1 class="title text-black" style="margin-bottom: 0">
{ data.Title }
</h1>
<nav aria-label="breadcrumb">
<ol class="breadcrumb" style="margin-bottom: 0">
for idx, d := range data.Item {
if (idx != len(data.Item) - 1) {
// tidak active
<li class="breadcrumb-item"><a href={ templ.SafeURL(d.Url) }>{ d.Item }</a></li>
} else {
// active
<li class="breadcrumb-item active" aria-current="page">
{ d.Item }
</li>
}
}
</ol>
</nav>
</div>
}

View File

@@ -0,0 +1,102 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package breadcrumadmin
//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 MainBreadcrumbAdminV1(data models.BreadCrumbV1) 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=\"col-11\"><h1 class=\"title text-black\" style=\"margin-bottom: 0\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(data.Title)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\breadcrumbadmin\breadcrumbadminv1.templ`, Line: 8, Col: 15}
}
_, 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("</h1><nav aria-label=\"breadcrumb\"><ol class=\"breadcrumb\" style=\"margin-bottom: 0\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for idx, d := range data.Item {
if idx != len(data.Item)-1 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <li class=\"breadcrumb-item\"><a href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 templ.SafeURL = templ.SafeURL(d.Url)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var3)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(d.Item)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\breadcrumbadmin\breadcrumbadminv1.templ`, Line: 15, Col: 75}
}
_, 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("</a></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <li class=\"breadcrumb-item active\" aria-current=\"page\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(d.Item)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\breadcrumbadmin\breadcrumbadminv1.templ`, Line: 19, Col: 15}
}
_, 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("</li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</ol></nav></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,30 @@
package chart
templ ShowChart(idDiv string, udata string) {
<div id={ idDiv } class="mx-auto"></div>
@GenerateChart(idDiv, udata)
}
script GenerateChart(idDiv string, udata string) {
htmx.onLoad(function(elt) {
console.log("elt ",elt)
var element = document.getElementById(idDiv);
console.log("element ",element)
if (element) {
element.style.height = "400px";
element.style.width = "100%";
}
var myChart = {};
var option = {};
// var myChart_001 = echarts.init(document.getElementById(idDiv));
myChart[idDiv] = echarts.init(element);
// var option_001 = JSON.parse(udata);
option[idDiv] = JSON.parse(udata);
console.log("option ", option)
// myChart_001.setOption(option_001);
myChart[idDiv].setOption(option[idDiv]);
});
}

View File

@@ -0,0 +1,82 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package chart
//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 ShowChart(idDiv string, udata string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(idDiv)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\chart\chart.templ`, Line: 4, Col: 19}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"mx-auto\"></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = GenerateChart(idDiv, udata).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 GenerateChart(idDiv string, udata string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_GenerateChart_4c73`,
Function: `function __templ_GenerateChart_4c73(idDiv, udata){htmx.onLoad(function(elt) {
console.log("elt ",elt)
var element = document.getElementById(idDiv);
console.log("element ",element)
if (element) {
element.style.height = "400px";
element.style.width = "100%";
}
var myChart = {};
var option = {};
// var myChart_001 = echarts.init(document.getElementById(idDiv));
myChart[idDiv] = echarts.init(element);
// var option_001 = JSON.parse(udata);
option[idDiv] = JSON.parse(udata);
console.log("option ", option)
// myChart_001.setOption(option_001);
myChart[idDiv].setOption(option[idDiv]);
});
}`,
Call: templ.SafeScript(`__templ_GenerateChart_4c73`, idDiv, udata),
CallInline: templ.SafeScriptInline(`__templ_GenerateChart_4c73`, idDiv, udata),
}
}

View File

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

View File

@@ -0,0 +1,143 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package customcheckbox
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import "cpone/models"
func MainCustomCheckboxInput(inp models.CustomCheckboxv1Prm) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"form-control bg-field border-0 h-auto\"><div class=\"form-group\"><label>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Label)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customcheckbox\customcheckboxv1.templ`, Line: 8, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</label><div class=\"checkbox-list\"><label class=\"checkbox\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if inp.Value == "on" {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input type=\"checkbox\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customcheckbox\customcheckboxv1.templ`, Line: 12, Col: 44}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customcheckbox\customcheckboxv1.templ`, Line: 12, Col: 58}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" checked> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input type=\"checkbox\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customcheckbox\customcheckboxv1.templ`, Line: 14, Col: 44}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customcheckbox\customcheckboxv1.templ`, Line: 14, Col: 58}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<span></span> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customcheckbox\customcheckboxv1.templ`, Line: 17, Col: 15}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</label></div></div><div class=\"invalid-feedback text-danger mt-3 ml-2 mt-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customcheckbox\customcheckboxv1.templ`, Line: 22, Col: 17}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,61 @@
package customdropdown;
import "cpone/models"
templ MainCustomDropdown(inp models.CustomDropdownv1Prm, listItem templ.Component) {
<div class="form-control bg-field border-0 h-auto">
<select
name={ inp.Name }
class="form-control bg-field selectpicker"
data-live-search="true"
data-size="5"
id={ inp.ID }
hx-get={ inp.HxGet }
hx-target={ inp.HxTarget }
hx-indicator={ inp.HxIndicator }
hx-trigger={ inp.HxTrigger }
hx-include={ inp.HxInclude }
>
@listItem
</select>
<div class="invalid-feedback text-danger mt-3 ml-2 mt-5">
{ inp.ErrorMsg }
</div>
</div>
}
templ MainCustomDropdownInput(inp models.CustomDropdownv1Prm, listItem templ.Component) {
<div class="form-control bg-field border-0 h-auto">
<select
name={ inp.Name }
class="form-control bg-field selectpicker"
data-live-search="true"
data-size="5"
id={ inp.ID }
>
@listItem
</select>
<div class="invalid-feedback text-danger mt-3 ml-2 mt-5">
{ inp.ErrorMsg }
</div>
</div>
}
templ MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string, hxIndicator string, hxTrigger string, hxInclude string, listItem templ.Component) {
<div class="form-control bg-field border-0 h-auto">
<select
name={ name }
class="form-control bg-field selectpicker"
data-live-search="true"
data-size="5"
id={ id }
hx-get={ hxGet }
hx-target={ hxTarget }
hx-indicator={ hxIndicator }
hx-trigger={ hxTrigger }
hx-include={ hxInclude }
>
@listItem
</select>
</div>
}

View File

@@ -0,0 +1,343 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package customdropdown
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import "cpone/models"
func MainCustomDropdown(inp models.CustomDropdownv1Prm, listItem templ.Component) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"form-control bg-field border-0 h-auto\"><select name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customdropdown\customdropdown.templ`, Line: 8, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"form-control bg-field selectpicker\" data-live-search=\"true\" data-size=\"5\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customdropdown\customdropdown.templ`, Line: 12, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxGet)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customdropdown\customdropdown.templ`, Line: 13, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customdropdown\customdropdown.templ`, Line: 14, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxIndicator)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customdropdown\customdropdown.templ`, Line: 15, Col: 33}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-trigger=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxTrigger)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customdropdown\customdropdown.templ`, Line: 16, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customdropdown\customdropdown.templ`, Line: 17, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = listItem.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</select><div class=\"invalid-feedback text-danger mt-3 ml-2 mt-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,17 @@
package customtextfield
templ MainCustomTextField(inpLabelText,
inpName,
inpPlaceHolder,
inpType string) {
<div class="form-group">
<label class="text-black" style="font-family: Poppins; font-weight: 600;">{ inpLabelText } </label>
<input
id={ inpName }
name={ inpName }
type={ inpType }
placeholder={ inpPlaceHolder }
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
/>
</div>
}

View File

@@ -0,0 +1,103 @@
// 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"
func MainCustomTextField(inpLabelText,
inpName,
inpPlaceHolder,
inpType 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=\"form-group\"><label class=\"text-black\" style=\"font-family: Poppins; font-weight: 600;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inpLabelText)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfield\customtextfield.templ`, Line: 8, Col: 90}
}
_, 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> <input id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(inpName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfield\customtextfield.templ`, Line: 10, Col: 15}
}
_, 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(inpName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfield\customtextfield.templ`, Line: 11, Col: 17}
}
_, 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(inpType)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfield\customtextfield.templ`, Line: 12, Col: 17}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" placeholder=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(inpPlaceHolder)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfield\customtextfield.templ`, Line: 13, Col: 31}
}
_, 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("\" class=\"form-control bg-field border-0 h-auto py-6 px-6 rounded-lg\"></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,31 @@
package customtextfield
import "cpone/models"
templ CustomTextFieldv2(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>
<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="invalid-feedback text-danger mt-3 ml-2">
{ inp.ErrorMsg }
</div>
</div>
}

View File

@@ -0,0 +1,158 @@
// 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 CustomTextFieldv2(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: `models\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 {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</label> <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: `models\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 {
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: `models\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 {
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: `models\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 {
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: `models\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 {
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: `models\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 {
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=\"invalid-feedback text-danger mt-3 ml-2\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\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 {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,126 @@
package customtextfieldautocomplete;
import (
"cpone/layout"
"cpone/models"
)
templ MainCustomAutoComplete(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 ListCustomAutoCompleteHide() {
<div id="hasilAutoComplete"></div>
}
templ ListCustomAutoComplete(limit string, param string, totalDataInt int, foundCount int, pageOf string, textFound string, data []models.AutoComplete) {
<div id="contentList" class="bootstrap-autocomplete dropdown-menu-custom bg-white show">
if len(data) == 0 {
<a class="dropdown-item" href="#" style="overflow: hidden; text-overflow: ellipsis;">Data Tidak Ditemukan</a>
} else {
for _, d := range data {
<a
hx-trigger="click"
hx-get={ "/client/autoCompleteSetValue/" + d.Name }
hx-swap="outerHTML"
hx-target="#initial"
class="dropdown-item"
style="overflow: hidden; text-overflow: ellipsis;"
>{ d.Name }</a>
}
}
<div class="container px-4">
<div class="row mb-4">
<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 class="row align-items-center">
<div class="col-md-6">
<p style="font-style: italic; margin: 0; text-align: left;">{ textFound }</p>
</div>
<div class="col-md-6 d-flex justify-content-end">
if foundCount == totalDataInt {
<a href="#" class="btn btn-link-primary text-primary mr-2 disabled">Show More</a>
} else {
<a
href="#"
hx-get={ "/client/autoCompleteLoadMore/" + pageOf + "/" + param + "/" + limit }
hx-trigger="click"
hx-target="#contentList"
hx-swap="outerHTML"
hx-select="#contentList"
hx-indicator="#indicator"
class="text-dark-75 text-hover-primary mr-2"
>Show More</a>
}
</div>
</div>
</div>
</div>
}
templ JsCustomAutoComplete() {
}
templ CssCustomAutoComplete() {
<style>
.htmx-indicator{
display:none;
}
.htmx-request .htmx-indicator{
display:inline;
opacity:1;
}
.htmx-request.htmx-indicator{
display:inline;
opacity:1;
}
.dropdown-menu-custom {
/* position: absolute; */
/* top: 100%; */
/* left: 0; */
/* z-index: 1000; */
/* display: none; */
width: 100%;
float: left;
min-width: 10rem;
padding: 0.5rem 0;
margin: 0.125rem 0 0;
font-size: 1rem;
/* color: #212529; */
text-align: left;
list-style: none;
/* background-color: #fff; */
background-clip: padding-box;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 0.25rem;
}
</style>
}
templ ShowCustomAutoComplete(title string, cmp templ.Component, css templ.Component, js templ.Component) {
@layout.PlaygroundLayout(title, css, js) {
@cmp
}
}

View File

@@ -0,0 +1,268 @@
// 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"
import (
"cpone/layout"
"cpone/models"
)
func MainCustomAutoComplete(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: `models\component\customtextfieldautocomplete\customtextfieldautocomplete.templ`, Line: 21, 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 ListCustomAutoCompleteHide() 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
})
}
func ListCustomAutoComplete(limit string, param string, totalDataInt int, foundCount int, pageOf string, textFound string, data []models.AutoComplete) 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 id=\"contentList\" class=\"bootstrap-autocomplete dropdown-menu-custom bg-white show\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if len(data) == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a class=\"dropdown-item\" href=\"#\" style=\"overflow: hidden; text-overflow: ellipsis;\">Data Tidak Ditemukan</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
for _, d := range data {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a hx-trigger=\"click\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs("/client/autoCompleteSetValue/" + d.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldautocomplete\customtextfieldautocomplete.templ`, Line: 43, Col: 54}
}
_, 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-swap=\"outerHTML\" hx-target=\"#initial\" class=\"dropdown-item\" style=\"overflow: hidden; text-overflow: ellipsis;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(d.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldautocomplete\customtextfieldautocomplete.templ`, Line: 48, Col: 13}
}
_, 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("</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"container px-4\"><div class=\"row mb-4\"><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 class=\"row align-items-center\"><div class=\"col-md-6\"><p style=\"font-style: italic; margin: 0; text-align: left;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(textFound)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldautocomplete\customtextfieldautocomplete.templ`, Line: 59, Col: 76}
}
_, 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("</p></div><div class=\"col-md-6 d-flex justify-content-end\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if foundCount == totalDataInt {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a href=\"#\" class=\"btn btn-link-primary text-primary mr-2 disabled\">Show More</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a href=\"#\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs("/client/autoCompleteLoadMore/" + pageOf + "/" + param + "/" + limit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldautocomplete\customtextfieldautocomplete.templ`, Line: 67, Col: 84}
}
_, 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-trigger=\"click\" hx-target=\"#contentList\" hx-swap=\"outerHTML\" hx-select=\"#contentList\" hx-indicator=\"#indicator\" class=\"text-dark-75 text-hover-primary mr-2\">Show More</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></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 JsCustomAutoComplete() 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)
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func CssCustomAutoComplete() 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("<style>\r\n\t.htmx-indicator{\r\n\t\tdisplay:none;\r\n\t}\r\n\t.htmx-request .htmx-indicator{\r\n\t\tdisplay:inline;\r\n\t\topacity:1;\r\n\t}\r\n\t.htmx-request.htmx-indicator{\r\n\t\tdisplay:inline;\r\n\t\topacity:1;\r\n\t}\r\n\r\n .dropdown-menu-custom {\r\n /* position: absolute; */\r\n /* top: 100%; */\r\n /* left: 0; */\r\n /* z-index: 1000; */\r\n /* display: none; */\r\n width: 100%;\r\n float: left;\r\n min-width: 10rem;\r\n padding: 0.5rem 0;\r\n margin: 0.125rem 0 0;\r\n font-size: 1rem;\r\n /* color: #212529; */\r\n text-align: left;\r\n list-style: none;\r\n /* background-color: #fff; */\r\n background-clip: padding-box;\r\n border: 1px solid rgba(0, 0, 0, 0.15);\r\n border-radius: 0.25rem;\r\n }\r\n </style>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func ShowCustomAutoComplete(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.PlaygroundLayout(title, css, js).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
})
}

View File

@@ -0,0 +1,85 @@
package customtextfieldsearch
templ MainCustomTextFieldSearch(
inpName,
inpPlaceHolder,
inpType,
hxPost,
hxTrigger,
hxTarget,
hxIndicator string) {
<input
class="form-control bg-field border-0"
type={ inpType }
name={ inpName }
id={ inpName }
placeholder={ inpPlaceHolder }
hx-post={ hxPost }
hx-trigger={ hxTrigger }
hx-target={ hxTarget }
hx-indicator={ hxIndicator }
autocomplete="off"
/>
}
templ MainCustomTextFieldSearchV1(
inpId,
inpName,
inpPlaceHolder,
inpType,
hxGet,
hxTrigger,
hxTarget,
hxIndicator,
value,
hxExt 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-ext={ hxExt }
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>
}

View File

@@ -0,0 +1,488 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package customtextfieldsearch
//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 MainCustomTextFieldSearch(
inpName,
inpPlaceHolder,
inpType,
hxPost,
hxTrigger,
hxTarget,
hxIndicator 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("<input class=\"form-control bg-field border-0\" type=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inpType)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 13, 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("\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(inpName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 14, Col: 16}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inpName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 15, Col: 14}
}
_, 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("\" placeholder=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inpPlaceHolder)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 16, Col: 30}
}
_, 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-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(hxPost)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 17, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-trigger=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 18, Col: 24}
}
_, 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(hxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 19, Col: 22}
}
_, 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-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\customtextfieldsearch\customtextfieldsearch.templ`, Line: 20, Col: 28}
}
_, 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("\" autocomplete=\"off\">")
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 MainCustomTextFieldSearchV1(
inpId,
inpName,
inpPlaceHolder,
inpType,
hxGet,
hxTrigger,
hxTarget,
hxIndicator,
value,
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 {
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("<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_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(inpType)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\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 {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
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: `models\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 {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
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: `models\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 {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" placeholder=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
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: `models\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 {
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_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\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 {
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_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\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 {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\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 {
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_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\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 {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
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: `models\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 {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-ext=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
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: `models\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("\" autocomplete=\"off\">")
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 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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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
})
}

View File

@@ -0,0 +1,30 @@
package modalcomponent
templ Modal(modalID string, modalTitle string, modalBody templ.Component, modalAction templ.Component, btnClose templ.Component) {
<div
class="modal fade"
style="display: none"
id={ modalID }
tabindex="-1"
role="dialog"
data-backdrop="static"
aria-hidden="true"
>
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content rounded-lg">
<div class="modal-header border-bottom-0">
<h6 class="modal-title text-black font-weight-bolder">
{ modalTitle }
</h6>
@btnClose
</div>
<div class="modal-body border-bottom-0">
@modalBody
</div>
<div class="modal-footer border-top-0">
@modalAction
</div>
</div>
</div>
</div>
}

View File

@@ -0,0 +1,52 @@
package modalcomponent
templ ModalConfirmation(
id string,
modalTitle string,
message string,
btnClose templ.Component,
datHeader []string,
dataText []string,
modalAction templ.Component) {
<div
class="modal fade"
id={ id }
tabindex="-1"
aria-labelledby="exampleModalLabel"
data-backdrop="static"
aria-hidden="true"
>
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content rounded-lg">
<div class="modal-header border-bottom-0">
<h6 class="modal-title text-black font-weight-bolder">
{ modalTitle }
</h6>
@btnClose
</div>
<div class="modal-body border-bottom-0">
<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>
</div>
<div class="modal-footer border-top-0">
@modalAction
</div>
</div>
</div>
</div>
}

View File

@@ -0,0 +1,143 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package modalcomponent
//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 ModalConfirmation(
id string,
modalTitle string,
message string,
btnClose templ.Component,
datHeader []string,
dataText []string,
modalAction templ.Component) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"modal fade\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\modal\modal_confirmation.templ`, Line: 13, Col: 9}
}
_, 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("\" tabindex=\"-1\" aria-labelledby=\"exampleModalLabel\" data-backdrop=\"static\" aria-hidden=\"true\"><div class=\"modal-dialog modal-dialog-centered\"><div class=\"modal-content rounded-lg\"><div class=\"modal-header border-bottom-0\"><h6 class=\"modal-title text-black font-weight-bolder\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(modalTitle)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\modal\modal_confirmation.templ`, Line: 23, Col: 18}
}
_, 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("</h6>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = btnClose.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"modal-body border-bottom-0\"><p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(message)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\modal\modal_confirmation.templ`, Line: 28, Col: 17}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p><div class=\"card rounded-lg\"><div class=\"card-body d-flex flex-row\"><div class=\"d-flex flex-column\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range 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_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\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 {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"d-flex flex-column \">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range dataText {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 font-weight-bold\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\modal\modal_confirmation.templ`, Line: 39, Col: 13}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div></div><div class=\"modal-footer border-top-0\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalAction.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></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
})
}

View File

@@ -0,0 +1,85 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package modalcomponent
//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 Modal(modalID string, modalTitle string, modalBody templ.Component, modalAction templ.Component, btnClose templ.Component) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"modal fade\" style=\"display: none\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(modalID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\modal\modal.templ`, Line: 7, 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("\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\" aria-hidden=\"true\"><div class=\"modal-dialog modal-dialog-centered\" role=\"document\"><div class=\"modal-content rounded-lg\"><div class=\"modal-header border-bottom-0\"><h6 class=\"modal-title text-black font-weight-bolder\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(modalTitle)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\modal\modal.templ`, Line: 17, Col: 18}
}
_, 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("</h6>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = btnClose.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"modal-body border-bottom-0\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalBody.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"modal-footer border-top-0\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalAction.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></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
})
}

View File

@@ -0,0 +1,74 @@
package navbar
import (
"cpone/component/sidebarmaster"
"cpone/models"
)
templ Navbar(dataUser models.User) {
<div id="kt_header" class="header header-fixed ">
<!--begin::Container-->
<div class="container-fluid d-flex align-items-stretch justify-content-between">
<!--begin::Header Menu Wrapper-->
<div class="header-menu-wrapper header-menu-wrapper-left" id="kt_header_menu_wrapper"></div>
<!--end::Header Menu Wrapper-->
<!--begin::Topbar-->
<div class="topbar">
<!--begin::User-->
<div class="topbar-item">
<div
class="btn btn-icon btn-icon-mobile w-auto btn-clean d-flex align-items-center btn-lg px-2"
id="kt_quick_user_toggle"
>
<span
class="text-muted font-weight-bold font-size-base d-none d-md-inline mr-1"
>Hi,</span>
<span
class="text-dark-50 font-weight-bolder font-size-base d-none d-md-inline mr-3"
>{ dataUser.Username }</span>
<span class="bg-primary-transparent p-3" style="border-radius: 50%; width: 40px; height: 40px;">
<span class="iconify text-primary" data-icon="gravity-ui:person"></span>
</span>
</div>
</div>
<!--end::User-->
</div>
<!--end::Topbar-->
</div>
<!--end::Container-->
</div>
}
templ NavbarMenu(datamenu []models.Menu) {
<div class="aside-menu-wrapper flex-column-fluid" id="kt_aside_menu_wrapper">
<!--begin::Menu Container-->
<div
id="kt_aside_menu"
class="aside-menu my-4 "
data-menu-vertical="1"
data-menu-scroll="1"
data-menu-dropdown-timeout="500"
>
<!--begin::Menu Nav-->
<ul class="menu-nav ">
for index, d := range datamenu {
if index == 0 {
// @MenuDashboard(d.ParentMenuName, d.ParentUrl)
@sidebarmaster.MenuDashboard(d.ParentMenuName, d.ParentUrl)
<li class="menu-section ">
<h4 class="menu-text">Menu</h4>
<i class="menu-icon ki ki-bold-more-hor icon-md"></i>
</li>
}
if index+1 < len(datamenu) {
// @ListMenuNavbar(datamenu[index+1].ParentMenuName, d.Children)
@sidebarmaster.ListMenuNavbar(datamenu[index+1].ParentMenuName, datamenu[index+1].Children)
}
}
</ul>
<!--end::Menu Nav-->
</div>
<!--end::Menu Container-->
</div>
}

View File

@@ -0,0 +1,112 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package navbar
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import (
"cpone/component/sidebarmaster"
"cpone/models"
)
func Navbar(dataUser models.User) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
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=\"kt_header\" class=\"header header-fixed \"><!--begin::Container--><div class=\"container-fluid d-flex align-items-stretch justify-content-between\"><!--begin::Header Menu Wrapper--><div class=\"header-menu-wrapper header-menu-wrapper-left\" id=\"kt_header_menu_wrapper\"></div><!--end::Header Menu Wrapper--><!--begin::Topbar--><div class=\"topbar\"><!--begin::User--><div class=\"topbar-item\"><div class=\"btn btn-icon btn-icon-mobile w-auto btn-clean d-flex align-items-center btn-lg px-2\" id=\"kt_quick_user_toggle\"><span class=\"text-muted font-weight-bold font-size-base d-none d-md-inline mr-1\">Hi,</span> <span class=\"text-dark-50 font-weight-bolder font-size-base d-none d-md-inline mr-3\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(dataUser.Username)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\navbar\navbar.templ`, Line: 29, Col: 26}
}
_, 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("</span> <span class=\"bg-primary-transparent p-3\" style=\"border-radius: 50%; width: 40px; height: 40px;\"><span class=\"iconify text-primary\" data-icon=\"gravity-ui:person\"></span></span></div></div><!--end::User--></div><!--end::Topbar--></div><!--end::Container--></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func NavbarMenu(datamenu []models.Menu) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_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 class=\"aside-menu-wrapper flex-column-fluid\" id=\"kt_aside_menu_wrapper\"><!--begin::Menu Container--><div id=\"kt_aside_menu\" class=\"aside-menu my-4 \" data-menu-vertical=\"1\" data-menu-scroll=\"1\" data-menu-dropdown-timeout=\"500\"><!--begin::Menu Nav--><ul class=\"menu-nav \">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for index, d := range datamenu {
if index == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = sidebarmaster.MenuDashboard(d.ParentMenuName, d.ParentUrl).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <li class=\"menu-section \"><h4 class=\"menu-text\">Menu</h4><i class=\"menu-icon ki ki-bold-more-hor icon-md\"></i></li>")
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 index+1 < len(datamenu) {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = sidebarmaster.ListMenuNavbar(datamenu[index+1].ParentMenuName, datamenu[index+1].Children).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</ul><!--end::Menu Nav--></div><!--end::Menu Container--></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,59 @@
package pagination
import "strconv"
templ Pagination(length int, currentPage int, link string, contentID 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">
<div class="d-flex flex-wrap py-2 mr-3">
for i:=0; i<length; i++ {
if (i+1) == currentPage {
<a
hx-get={ link + "?" + "currentPage=" + strconv.Itoa(i+1) + "&page=" + strconv.Itoa(length) + "&contentID=" + contentID }
class="btn btn-icon btn-sm border-0 btn-light btn-hover-primary active mr-2 my-1"
hx-swap="outerHTML"
hx-indicator="#indicator"
hx-trigger="click"
hx-on::before-request={ HideContent(contentID) }
hx-on::after-request={ ShowContent(contentID) }
hx-target={ "#" + contentID }
>{ strconv.Itoa(i+1) }</a>
} else {
<a
hx-get={ link + "?" + "currentPage=" + strconv.Itoa(i+1) + "&page=" + strconv.Itoa(length) + "&contentID=" + contentID }
class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1"
hx-swap="outerHTML"
hx-indicator="#indicator"
hx-trigger="click"
hx-on::before-request={ HideContent(contentID) }
hx-on::after-request={ ShowContent(contentID) }
hx-target={ "#" + contentID }
>{ strconv.Itoa(i+1) }</a>
}
}
</div>
</div>
}
script ShowContent(contentID string) {
console.log("Show Content");
console.log(contentID);
document.getElementById(contentID).setAttribute("visible","");
// document.querySelector('#'+contentID).style.display = 'block';
// document.querySelector('#'+contentID).setAttribute("visible","");
}
script HideContent(contentID string) {
console.log("Hide Content");
console.log(contentID);
document.getElementById(contentID).setAttribute("hidden","");
// document.querySelector('#'+contentID).style.display = 'none';
// document.querySelector('#'+contentID).setAttribute("hidden","");
}
script CobaContent(contentID string) {
console.log(contentID);
}

View File

@@ -0,0 +1,216 @@
// 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"
func Pagination(length int, currentPage int, link string, contentID 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\"><div class=\"d-flex flex-wrap py-2 mr-3\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for i := 0; i < length; i++ {
if (i + 1) == currentPage {
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HideContent(contentID), ShowContent(contentID))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(link + "?" + "currentPage=" + strconv.Itoa(i+1) + "&page=" + strconv.Itoa(length) + "&contentID=" + contentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\pagination.templ`, Line: 13, Col: 124}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"btn btn-icon btn-sm border-0 btn-light btn-hover-primary active mr-2 my-1\" hx-swap=\"outerHTML\" hx-indicator=\"#indicator\" hx-trigger=\"click\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 templ.ComponentScript = HideContent(contentID)
_, 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("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 templ.ComponentScript = ShowContent(contentID)
_, 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("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs("#" + contentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\pagination.templ`, Line: 20, Col: 33}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\pagination.templ`, Line: 21, Col: 25}
}
_, 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("</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HideContent(contentID), ShowContent(contentID))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(link + "?" + "currentPage=" + strconv.Itoa(i+1) + "&page=" + strconv.Itoa(length) + "&contentID=" + contentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\pagination.templ`, Line: 24, Col: 124}
}
_, 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("\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\" hx-swap=\"outerHTML\" hx-indicator=\"#indicator\" hx-trigger=\"click\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 templ.ComponentScript = HideContent(contentID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 templ.ComponentScript = ShowContent(contentID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs("#" + contentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\pagination.templ`, Line: 31, Col: 33}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\pagination.templ`, Line: 32, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
}
_, 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 ShowContent(contentID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_ShowContent_cf70`,
Function: `function __templ_ShowContent_cf70(contentID){console.log("Show Content");
console.log(contentID);
document.getElementById(contentID).setAttribute("visible","");
// document.querySelector('#'+contentID).style.display = 'block';
// document.querySelector('#'+contentID).setAttribute("visible","");
}`,
Call: templ.SafeScript(`__templ_ShowContent_cf70`, contentID),
CallInline: templ.SafeScriptInline(`__templ_ShowContent_cf70`, contentID),
}
}
func HideContent(contentID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HideContent_0799`,
Function: `function __templ_HideContent_0799(contentID){console.log("Hide Content");
console.log(contentID);
document.getElementById(contentID).setAttribute("hidden","");
// document.querySelector('#'+contentID).style.display = 'none';
// document.querySelector('#'+contentID).setAttribute("hidden","");
}`,
Call: templ.SafeScript(`__templ_HideContent_0799`, contentID),
CallInline: templ.SafeScriptInline(`__templ_HideContent_0799`, contentID),
}
}
func CobaContent(contentID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_CobaContent_ef1c`,
Function: `function __templ_CobaContent_ef1c(contentID){console.log(contentID);
}`,
Call: templ.SafeScript(`__templ_CobaContent_ef1c`, contentID),
CallInline: templ.SafeScriptInline(`__templ_CobaContent_ef1c`, contentID),
}
}

View File

@@ -0,0 +1,55 @@
package pagination
import "strconv"
templ PaginationV1(length int, currentPage int, link string, contentID string, searchQueryParam 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">
<div class="d-flex flex-wrap py-2 mr-3">
for i:=0; i<length; i++ {
if (i+1) == currentPage {
<a
hx-get={ link + "?" + "currentPage=" + strconv.Itoa(i+1) + "&page=" + strconv.Itoa(length) + "&contentID=" + contentID + searchQueryParam }
class="btn btn-icon btn-sm border-0 btn-light btn-hover-primary active mr-2 my-1"
hx-swap="outerHTML"
hx-indicator="#indicator"
hx-trigger="click"
hx-target={ "#" + contentID }
>{ strconv.Itoa(i+1) }</a>
} else {
<a
hx-get={ link + "?" + "currentPage=" + strconv.Itoa(i+1) + "&page=" + strconv.Itoa(length) + "&contentID=" + contentID + searchQueryParam }
class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1"
hx-swap="outerHTML"
hx-indicator="#indicator"
hx-trigger="click"
hx-target={ "#" + contentID }
>{ strconv.Itoa(i+1) }</a>
}
}
</div>
</div>
}
// script ShowContent(contentID string) {
// console.log("Show Content");
// console.log(contentID);
// document.getElementById(contentID).setAttribute("visible","");
// // document.querySelector('#'+contentID).style.display = 'block';
// // document.querySelector('#'+contentID).setAttribute("visible","");
// }
// script HideContent(contentID string) {
// console.log("Hide Content");
// console.log(contentID);
// document.getElementById(contentID).setAttribute("hidden","");
// // document.querySelector('#'+contentID).style.display = 'none';
// // document.querySelector('#'+contentID).setAttribute("hidden","");
// }
// script CobaContent(contentID string) {
// console.log(contentID);
// }

View File

@@ -0,0 +1,154 @@
// 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"
func PaginationV1(length int, currentPage int, link string, contentID string, searchQueryParam 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\"><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_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(link + "?" + "currentPage=" + strconv.Itoa(i+1) + "&page=" + strconv.Itoa(length) + "&contentID=" + contentID + searchQueryParam)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\paginationv1.templ`, Line: 13, Col: 143}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"btn btn-icon btn-sm border-0 btn-light btn-hover-primary active mr-2 my-1\" hx-swap=\"outerHTML\" hx-indicator=\"#indicator\" hx-trigger=\"click\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs("#" + contentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\paginationv1.templ`, Line: 18, Col: 33}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\paginationv1.templ`, Line: 19, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(link + "?" + "currentPage=" + strconv.Itoa(i+1) + "&page=" + strconv.Itoa(length) + "&contentID=" + contentID + searchQueryParam)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\paginationv1.templ`, Line: 22, Col: 143}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"btn btn-icon btn-sm border-0 btn-light mr-2 my-1\" hx-swap=\"outerHTML\" hx-indicator=\"#indicator\" hx-trigger=\"click\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("#" + contentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\paginationv1.templ`, Line: 27, 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("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\pagination\paginationv1.templ`, Line: 28, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a>")
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
})
}
// script ShowContent(contentID string) {
// console.log("Show Content");
// console.log(contentID);
// document.getElementById(contentID).setAttribute("visible","");
// // document.querySelector('#'+contentID).style.display = 'block';
// // document.querySelector('#'+contentID).setAttribute("visible","");
// }
// script HideContent(contentID string) {
// console.log("Hide Content");
// console.log(contentID);
// document.getElementById(contentID).setAttribute("hidden","");
// // document.querySelector('#'+contentID).style.display = 'none';
// // document.querySelector('#'+contentID).setAttribute("hidden","");
// }
// script CobaContent(contentID string) {
// console.log(contentID);
// }

View 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>
}

View 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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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: `models\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
})
}

View File

@@ -0,0 +1,82 @@
package sidebaruserprofile
import "cpone/models"
templ Navbaruserprofile(dataUser models.User) {
<div id="kt_quick_user" class="offcanvas offcanvas-right p-10">
<!--begin::Header-->
<div class="offcanvas-header d-flex align-items-center justify-content-between pb-5">
<h3 class="font-weight-bold m-0 text-black">
User Profile
// <small class="text-muted font-size-sm ml-2">12 messages</small>
</h3>
<a href="#" class="btn btn-xs btn-icon btn-light btn-hover-primary" id="kt_quick_user_close">
<i class="ki ki-close icon-xs text-muted"></i>
</a>
</div>
<!--end::Header-->
<!--begin::Content-->
<div class="offcanvas-content pr-5 mr-n5">
<!--begin::Header-->
@ProfileHeader(dataUser)
<!--end::Header-->
<!--begin::Separator-->
<div class="separator separator-dashed my-7"></div>
<!--end::Separator-->
<!--begin::Notifications-->
<div>
<!--begin:Heading-->
<h5 class="mb-5">
Recent Notifications
</h5>
<!--end:Heading-->
<!--begin::Item-->
@NotificationCard()
<!--end::Item-->
</div>
<!--end::Notifications-->
</div>
<!--end::Content-->
</div>
}
templ ProfileHeader(dataUser models.User) {
<div class="d-flex align-items-center mt-5">
<div class="symbol symbol-100 mr-5 p-2 bg-primary-transparent">
// <div class="symbol-label" style="background-image:url('/assets/media/users/300_21.jpg')"></div>
// <i class="symbol-badge bg-success"></i>
<span class="iconify symbol-label bg-primary-transparent text-primary" data-icon="gravity-ui:person"></span>
</div>
<div class="d-flex flex-column">
<a href="#" class="font-weight-bold font-size-h5 text-dark-75 text-hover-primary">
{ dataUser.UserFullName }
</a>
<div class="text-muted mt-1">
{ dataUser.UserPosition }
</div>
<div class="navi mt-2">
<a href="#" class="btn btn-sm btn-light-primary font-weight-bolder py-2 px-5">Sign Out</a>
</div>
</div>
</div>
}
templ NotificationCard() {
<div class="d-flex align-items-center bg-light-warning rounded p-5 gutter-b">
<span class="svg-icon svg-icon-warning mr-5">
<span
class="svg-icon svg-icon-lg"
>
<!--begin::Svg Icon | path:/assets/media/svg/icons/Home/Library.svg-->
<span class="iconify" data-icon="material-symbols:notifications-active-outline-rounded"></span>
</span>
</span>
<div class="d-flex flex-column flex-grow-1 mr-2">
<a href="#" class="font-weight-normal text-dark-75 text-hover-primary font-size-lg mb-1">
Another
purpose persuade
</a>
<span class="text-muted font-size-sm">Due in 2 Days</span>
</div>
</div>
}

View File

@@ -0,0 +1,127 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package sidebaruserprofile
//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 Navbaruserprofile(dataUser models.User) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
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=\"kt_quick_user\" class=\"offcanvas offcanvas-right p-10\"><!--begin::Header--><div class=\"offcanvas-header d-flex align-items-center justify-content-between pb-5\"><h3 class=\"font-weight-bold m-0 text-black\">User Profile\r</h3><a href=\"#\" class=\"btn btn-xs btn-icon btn-light btn-hover-primary\" id=\"kt_quick_user_close\"><i class=\"ki ki-close icon-xs text-muted\"></i></a></div><!--end::Header--><!--begin::Content--><div class=\"offcanvas-content pr-5 mr-n5\"><!--begin::Header-->")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ProfileHeader(dataUser).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--end::Header--><!--begin::Separator--><div class=\"separator separator-dashed my-7\"></div><!--end::Separator--><!--begin::Notifications--><div><!--begin:Heading--><h5 class=\"mb-5\">Recent Notifications\r</h5><!--end:Heading--><!--begin::Item-->")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = NotificationCard().Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--end::Item--></div><!--end::Notifications--></div><!--end::Content--></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 ProfileHeader(dataUser models.User) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var2 := templ.GetChildren(ctx)
if templ_7745c5c3_Var2 == nil {
templ_7745c5c3_Var2 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex align-items-center mt-5\"><div class=\"symbol symbol-100 mr-5 p-2 bg-primary-transparent\"><span class=\"iconify symbol-label bg-primary-transparent text-primary\" data-icon=\"gravity-ui:person\"></span></div><div class=\"d-flex flex-column\"><a href=\"#\" class=\"font-weight-bold font-size-h5 text-dark-75 text-hover-primary\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(dataUser.UserFullName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\sidebar_user_profile\sidebar_user_profile.templ`, Line: 52, Col: 27}
}
_, 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("</a><div class=\"text-muted mt-1\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(dataUser.UserPosition)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\sidebar_user_profile\sidebar_user_profile.templ`, Line: 55, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"navi mt-2\"><a href=\"#\" class=\"btn btn-sm btn-light-primary font-weight-bolder py-2 px-5\">Sign Out</a></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 NotificationCard() templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
if templ_7745c5c3_Var5 == nil {
templ_7745c5c3_Var5 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex align-items-center bg-light-warning rounded p-5 gutter-b\"><span class=\"svg-icon svg-icon-warning mr-5\"><span class=\"svg-icon svg-icon-lg\"><!--begin::Svg Icon | path:/assets/media/svg/icons/Home/Library.svg--><span class=\"iconify\" data-icon=\"material-symbols:notifications-active-outline-rounded\"></span></span></span><div class=\"d-flex flex-column flex-grow-1 mr-2\"><a href=\"#\" class=\"font-weight-normal text-dark-75 text-hover-primary font-size-lg mb-1\">Another\r purpose persuade\r</a> <span class=\"text-muted font-size-sm\">Due in 2 Days</span></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,102 @@
package sidebarmaster
import (
"cpone/models"
)
templ MenuDashboard(ParentMenuName string, ParentMenuUrl string) {
<li class="menu-item menu-item-active" aria-haspopup="true">
<a
href={ templ.SafeURL(ParentMenuUrl) }
class="menu-link "
>
<span
class="svg-icon menu-icon"
>
<!--begin::Svg Icon | path:/assets/media/svg/icons/Design/Layers.svg-->
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="24px"
height="24px"
viewBox="0 0 24 24"
version="1.1"
>
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<polygon points="0 0 24 0 24 24 0 24"></polygon>
<path
d="M12.9336061,16.072447 L19.36,10.9564761 L19.5181585,10.8312381 C20.1676248,10.3169571 20.2772143,9.3735535 19.7629333,8.72408713 C19.6917232,8.63415859 19.6104327,8.55269514 19.5206557,8.48129411 L12.9336854,3.24257445 C12.3871201,2.80788259 11.6128799,2.80788259 11.0663146,3.24257445 L4.47482784,8.48488609 C3.82645598,9.00054628 3.71887192,9.94418071 4.23453211,10.5925526 C4.30500305,10.6811601 4.38527899,10.7615046 4.47382636,10.8320511 L4.63,10.9564761 L11.0659024,16.0730648 C11.6126744,16.5077525 12.3871218,16.5074963 12.9336061,16.072447 Z"
fill="#000000"
fill-rule="nonzero"
></path>
<path
d="M11.0563554,18.6706981 L5.33593024,14.122919 C4.94553994,13.8125559 4.37746707,13.8774308 4.06710397,14.2678211 C4.06471678,14.2708238 4.06234874,14.2738418 4.06,14.2768747 L4.06,14.2768747 C3.75257288,14.6738539 3.82516916,15.244888 4.22214834,15.5523151 C4.22358765,15.5534297 4.2250303,15.55454 4.22647627,15.555646 L11.0872776,20.8031356 C11.6250734,21.2144692 12.371757,21.2145375 12.909628,20.8033023 L19.7677785,15.559828 C20.1693192,15.2528257 20.2459576,14.6784381 19.9389553,14.2768974 C19.9376429,14.2751809 19.9363245,14.2734691 19.935,14.2717619 L19.935,14.2717619 C19.6266937,13.8743807 19.0546209,13.8021712 18.6572397,14.1104775 C18.654352,14.112718 18.6514778,14.1149757 18.6486172,14.1172508 L12.9235044,18.6705218 C12.377022,19.1051477 11.6029199,19.1052208 11.0563554,18.6706981 Z"
fill="#000000"
opacity="0.3"
></path>
</g>
</svg><!--end::Svg Icon-->
</span><span class="menu-text">{ ParentMenuName }</span>
</a>
</li>
}
templ ListMenuChildren(ChildrenMenuURL string, ChildrenMenuName string) {
<li class="menu-item" aria-haspopup="true">
<a href={ templ.SafeURL(ChildrenMenuURL) } class="menu-link">
<i class="menu-bullet menu-bullet-line"><span></span></i>
<span class="menu-text">{ ChildrenMenuName }</span>
</a>
</li>
}
templ ListMenuNavbar(ParentMenuName string, datamenuchildren []models.ChildrenMenu) {
<li class="menu-item menu-item-submenu" aria-haspopup="true" data-menu-toggle="hover">
<a
href="javascript:;"
class="menu-link menu-toggle"
>
<span
class="svg-icon menu-icon"
>
<!--begin::Svg Icon | path:/assets/media/svg/icons/Shopping/Barcode-read.svg-->
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="24px"
height="24px"
viewBox="0 0 24 24"
version="1.1"
>
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<rect x="0" y="0" width="24" height="24"></rect>
<path
d="M7,3 L17,3 C19.209139,3 21,4.790861 21,7 C21,9.209139 19.209139,11 17,11 L7,11 C4.790861,11 3,9.209139 3,7 C3,4.790861 4.790861,3 7,3 Z M7,9 C8.1045695,9 9,8.1045695 9,7 C9,5.8954305 8.1045695,5 7,5 C5.8954305,5 5,5.8954305 5,7 C5,8.1045695 5.8954305,9 7,9 Z"
fill="#000000"
></path>
<path
d="M7,13 L17,13 C19.209139,13 21,14.790861 21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 C3,14.790861 4.790861,13 7,13 Z M17,19 C18.1045695,19 19,18.1045695 19,17 C19,15.8954305 18.1045695,15 17,15 C15.8954305,15 15,15.8954305 15,17 C15,18.1045695 15.8954305,19 17,19 Z"
fill="#000000"
opacity="0.3"
></path>
</g>
</svg><!--end::Svg Icon-->
</span><span class="menu-text">{ ParentMenuName }</span><i
class="menu-arrow"
></i>
</a>
<div class="menu-submenu ">
<i class="menu-arrow"></i>
<ul class="menu-subnav">
<li class="menu-item menu-item-parent" aria-haspopup="true">
<span
class="menu-link"
><span class="menu-text">{ ParentMenuName }</span></span>
</li>
for _, dx := range datamenuchildren {
@ListMenuChildren(dx.ChildrenMenuURL, dx.ChildrenMenuName)
}
</ul>
</div>
</li>
}

View File

@@ -0,0 +1,167 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package sidebarmaster
//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 MenuDashboard(ParentMenuName string, ParentMenuUrl 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("<li class=\"menu-item menu-item-active\" aria-haspopup=\"true\"><a href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 templ.SafeURL = templ.SafeURL(ParentMenuUrl)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var2)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"menu-link \"><span class=\"svg-icon menu-icon\"><!--begin::Svg Icon | path:/assets/media/svg/icons/Design/Layers.svg--><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" version=\"1.1\"><g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"><polygon points=\"0 0 24 0 24 24 0 24\"></polygon> <path d=\"M12.9336061,16.072447 L19.36,10.9564761 L19.5181585,10.8312381 C20.1676248,10.3169571 20.2772143,9.3735535 19.7629333,8.72408713 C19.6917232,8.63415859 19.6104327,8.55269514 19.5206557,8.48129411 L12.9336854,3.24257445 C12.3871201,2.80788259 11.6128799,2.80788259 11.0663146,3.24257445 L4.47482784,8.48488609 C3.82645598,9.00054628 3.71887192,9.94418071 4.23453211,10.5925526 C4.30500305,10.6811601 4.38527899,10.7615046 4.47382636,10.8320511 L4.63,10.9564761 L11.0659024,16.0730648 C11.6126744,16.5077525 12.3871218,16.5074963 12.9336061,16.072447 Z\" fill=\"#000000\" fill-rule=\"nonzero\"></path> <path d=\"M11.0563554,18.6706981 L5.33593024,14.122919 C4.94553994,13.8125559 4.37746707,13.8774308 4.06710397,14.2678211 C4.06471678,14.2708238 4.06234874,14.2738418 4.06,14.2768747 L4.06,14.2768747 C3.75257288,14.6738539 3.82516916,15.244888 4.22214834,15.5523151 C4.22358765,15.5534297 4.2250303,15.55454 4.22647627,15.555646 L11.0872776,20.8031356 C11.6250734,21.2144692 12.371757,21.2145375 12.909628,20.8033023 L19.7677785,15.559828 C20.1693192,15.2528257 20.2459576,14.6784381 19.9389553,14.2768974 C19.9376429,14.2751809 19.9363245,14.2734691 19.935,14.2717619 L19.935,14.2717619 C19.6266937,13.8743807 19.0546209,13.8021712 18.6572397,14.1104775 C18.654352,14.112718 18.6514778,14.1149757 18.6486172,14.1172508 L12.9235044,18.6705218 C12.377022,19.1051477 11.6029199,19.1052208 11.0563554,18.6706981 Z\" fill=\"#000000\" opacity=\"0.3\"></path></g></svg><!--end::Svg Icon--></span><span class=\"menu-text\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(ParentMenuName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\sidebarmaster\sidebarmaster.templ`, Line: 39, 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("</span></a></li>")
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 ListMenuChildren(ChildrenMenuURL string, ChildrenMenuName 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("<li class=\"menu-item\" aria-haspopup=\"true\"><a href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 templ.SafeURL = templ.SafeURL(ChildrenMenuURL)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var5)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"menu-link\"><i class=\"menu-bullet menu-bullet-line\"><span></span></i> <span class=\"menu-text\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(ChildrenMenuName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\sidebarmaster\sidebarmaster.templ`, Line: 48, Col: 45}
}
_, 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("</span></a></li>")
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 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 {
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("<li class=\"menu-item menu-item-submenu\" aria-haspopup=\"true\" data-menu-toggle=\"hover\"><a href=\"javascript:;\" class=\"menu-link menu-toggle\"><span class=\"svg-icon menu-icon\"><!--begin::Svg Icon | path:/assets/media/svg/icons/Shopping/Barcode-read.svg--><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" version=\"1.1\"><g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"><rect x=\"0\" y=\"0\" width=\"24\" height=\"24\"></rect> <path d=\"M7,3 L17,3 C19.209139,3 21,4.790861 21,7 C21,9.209139 19.209139,11 17,11 L7,11 C4.790861,11 3,9.209139 3,7 C3,4.790861 4.790861,3 7,3 Z M7,9 C8.1045695,9 9,8.1045695 9,7 C9,5.8954305 8.1045695,5 7,5 C5.8954305,5 5,5.8954305 5,7 C5,8.1045695 5.8954305,9 7,9 Z\" fill=\"#000000\"></path> <path d=\"M7,13 L17,13 C19.209139,13 21,14.790861 21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 C3,14.790861 4.790861,13 7,13 Z M17,19 C18.1045695,19 19,18.1045695 19,17 C19,15.8954305 18.1045695,15 17,15 C15.8954305,15 15,15.8954305 15,17 C15,18.1045695 15.8954305,19 17,19 Z\" fill=\"#000000\" opacity=\"0.3\"></path></g></svg><!--end::Svg Icon--></span><span class=\"menu-text\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(ParentMenuName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\sidebarmaster\sidebarmaster.templ`, Line: 84, Col: 50}
}
_, 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("</span><i class=\"menu-arrow\"></i></a><div class=\"menu-submenu \"><i class=\"menu-arrow\"></i><ul class=\"menu-subnav\"><li class=\"menu-item menu-item-parent\" aria-haspopup=\"true\"><span class=\"menu-link\"><span class=\"menu-text\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(ParentMenuName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\sidebarmaster\sidebarmaster.templ`, Line: 94, Col: 46}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</span></span></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, dx := range datamenuchildren {
templ_7745c5c3_Err = ListMenuChildren(dx.ChildrenMenuURL, dx.ChildrenMenuName).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</ul></div></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,25 @@
package tablecomponent
templ Table(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component) {
if len(thName) != len(thWidth) {
<div>length array thname berbeda dengan array thwidth</div>
} else {
<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>
<div>
@pagination
</div>
}
}

View File

@@ -0,0 +1,94 @@
// 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 Table(thName []string, thWidth []string, trComponent templ.Component, pagination 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)
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><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: `models\component\table\table.templ`, Line: 12, 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: `models\component\table\table.templ`, Line: 12, 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></div><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = pagination.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,25 @@
package tablecomponent
templ TableV1(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component, idunique string) {
if len(thName) != len(thWidth) {
<div>length array thname berbeda dengan array thwidth</div>
} else {
<div id={ idunique }>
<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>
@pagination
</div>
</div>
}
}

View File

@@ -0,0 +1,107 @@
// 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 TableV1(thName []string, thWidth []string, trComponent templ.Component, pagination templ.Component, idunique 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)
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 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: `models\component\table\tablev1.templ`, Line: 7, 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("\"><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_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: `models\component\table\tablev1.templ`, Line: 12, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
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: `models\component\table\tablev1.templ`, Line: 12, Col: 50}
}
_, 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("</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><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = pagination.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,31 @@
package tablecomponent
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 {
@inputanSearch
<div id={ idunique }>
<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>
@pagination
</div>
</div>
}
}
templ DivEmpty() {
<div></div>
}

View File

@@ -0,0 +1,135 @@
// 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 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 {
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)
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 = inputanSearch.Render(ctx, templ_7745c5c3_Buffer)
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(idunique)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\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 {
return templ_7745c5c3_Err
}
_, 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_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: `models\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 {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
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: `models\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 {
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><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = pagination.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></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 DivEmpty() 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></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -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>
}

View 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: `models\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: `models\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
})
}

View File

@@ -0,0 +1,15 @@
package customtoastv1
templ CustomToastV1(message string, idUniqueCustomToast string) {
<div class="position-fixed top-0 end-0 p-3" style="z-index: 11">
<div id="myToast" class="toast hide" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<strong class="me-auto">Pemberitahuan</strong>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body" id="pesanTxt">
{ message }
</div>
</div>
</div>
}

View File

@@ -0,0 +1,48 @@
// 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"
func CustomToastV1(message string, idUniqueCustomToast 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=\"position-fixed top-0 end-0 p-3\" style=\"z-index: 11\"><div id=\"myToast\" class=\"toast hide\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"><div class=\"toast-header\"><strong class=\"me-auto\">Pemberitahuan</strong> <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"toast\" aria-label=\"Close\"></button></div><div class=\"toast-body\" id=\"pesanTxt\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(message)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\toastbootstrap\customtoastv1.templ`, Line: 11, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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
})
}

View 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>
}

View 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: `models\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: `models\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: `models\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: `models\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: `models\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
})
}

View File

@@ -0,0 +1,17 @@
package under_development
templ UnderDevelopment() {
<div class="d-flex justify-content-center text-center flex-column mt-20">
<div class="text-primary underdev">Site Under Development</div>
<div class="text-disabled underdevsub mb-10">
"Stay Tuned, We're Building Excitement!"
</div>
<div>
<img
src="/asset-corporate-portal/media/under_development/under_development.png"
class="img-fluid"
alt="Your Brand"
/>
</div>
</div>
}

View File

@@ -0,0 +1,35 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package under_development
//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 UnderDevelopment() 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-center text-center flex-column mt-20\"><div class=\"text-primary underdev\">Site Under Development</div><div class=\"text-disabled underdevsub mb-10\">\"Stay Tuned, We're Building Excitement!\"\r</div><div><img src=\"/asset-corporate-portal/media/under_development/under_development.png\" class=\"img-fluid\" alt=\"Your Brand\"></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

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

View File

@@ -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
}

View File

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

View File

@@ -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"`
}

View 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"`
}

View File

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

View File

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

View 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
}

View 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
View 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, ", ")
}

View File

@@ -0,0 +1,237 @@
package dev_mdgroupresultview
import (
"cpone/layout"
"cpone/component/customtextfield"
"cpone/models"
"strconv"
)
templ MdGroupResultScreen(
tableID string,
paginationID string,
searchID string,
dialogAddID string,
dialogAddBodyID string,
dialogEditID string,
dialogEditBodyID string,
dialogDeleteID string,
dialogDeleteBodyID string,
breadcrumb templ.Component,
tablecontent templ.Component,
filterComponent templ.Component,
paginationComponent templ.Component,
modalAddForm templ.Component,
modalEditForm templ.Component,
modalDeleteForm templ.Component) {
<div class="container-fluid">
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
Name: "tableID",
Type: "hidden",
Value: tableID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID",
Name: "paginationID",
Type: "hidden",
Value: paginationID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "searchID",
Name: "searchID",
Type: "hidden",
Value: searchID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddID",
Name: "dialogAddID",
Type: "hidden",
Value: dialogAddID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddBodyID",
Name: "dialogAddBodyID",
Type: "hidden",
Value: dialogAddBodyID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditID",
Name: "dialogEditID",
Type: "hidden",
Value: dialogEditID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditBodyID",
Name: "dialogEditBodyID",
Type: "hidden",
Value: dialogEditBodyID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteID",
Name: "dialogDeleteID",
Type: "hidden",
Value: dialogDeleteID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteBodyID",
Name: "dialogDeleteBodyID",
Type: "hidden",
Value: dialogDeleteBodyID})
<div class="row align-items-center mb-10">
<div class="col-md-10 col-sm-12 p-0 ">
@breadcrumb
</div>
<div class="col-md-2 d-none d-lg-block d-xl-block d-md-block d-sm-none">
// <div class="d-block align-items-center">
<div class="d-flex justify-content-end">
<button
type="button"
class="btn btn-primary"
data-toggle="modal"
data-target={ "#" + dialogAddID }
>Add New</button>
</div>
</div>
<div class="col-md-2 d-block d-lg-none d-xl-none d-md-none d-sm-block justify-content-center px-5">
<button
type="button"
class="btn btn-primary btn-block"
data-toggle="modal"
data-target={ "#" + dialogAddID }
>Add New</button>
</div>
</div>
@filterComponent
<div id="loading-parent" class=" rounded">
@tablecontent
@paginationComponent
@modalAddForm
@modalEditForm
@modalDeleteForm
<div id="loading-child" class=" rounded bg-transparent">
// <div class="spinner spinner-lg spinner-primary"></div>
<div id="loading-spinner" class="spinner-border text-primary d-none" style="width: 3rem; height: 3rem;" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
</div>
<div id="loadingcontent"></div>
</div>
}
// for item dropdown
templ ItemDropdown(dataDropdown []models.GroupResultResumeMcu, selectedId int) {
if len(dataDropdown) == 0 {
<option value="0" disabled selected>Tidak Ada Data</option>
} else {
for _, v := range dataDropdown {
if (selectedId == v.ID) {
<option value={ strconv.Itoa(v.ID) } selected>{ v.Text }</option>
} else {
<option value={ strconv.Itoa(v.ID) }>{ v.Text }</option>
}
}
}
}
// for empty div
templ EmptyDiv1() {
<div></div>
}
templ CssMdGroupResult() {
<link
rel="stylesheet"
href="assets/css/googlefont/poppins.css"
/>
<link
rel="stylesheet"
href="assets/css/googlefont/publicsans.css"
/>
<link
rel="stylesheet"
href="assets/css/googlefont/roboto.css"
/>
<style>
body {
background-color: white;
/* padding-right: 100px;
padding-left: 100px; */
}
#div-chart {
/* overflow-x: scroll; */
margin: 40px 10vw 40px 10vw;
}
.title {
font-size:20px;
font-weight: bold;
}
#title {
font-weight: 600;
}
.dropdown-menu{
transform: translate3d(0px, 35px, 0px)!important;
}
</style>
}
templ JsMdGroupResult() {
<script>
function onLoadingStart() {
// const loadingParent = document.getElementById("loading-parent");
// const loadingChild = document.getElementById("loading-child");
// const loadingSpinner = document.getElementById("loading-spinner");
// loadingParent.classList.add("overlay");
// loadingParent.classList.add("overlay-block");
// loadingChild.classList.add("overlay-layer");
// loadingSpinner.classList.remove("d-none");
// Additional logic when loading starts
}
function onLoadingEnd() {
console.log('Loading ended');
// const loadingParent = document.getElementById("loading-parent");
// const loadingChild = document.getElementById("loading-child");
// const loadingSpinner = document.getElementById("loading-spinner");
// loadingParent.classList.remove("overlay");
// loadingParent.classList.remove("overlay-block");
// loadingChild.classList.remove("overlay-layer");
// loadingSpinner.classList.add("d-none");
}
document.addEventListener('htmx:beforeRequest', function(event) {
var indicator = document.querySelector('#loadingcontent');
console.log(event.detail.xhr)
console.log(event.detail.elt)
if (indicator) {
onLoadingStart();
}
});
document.addEventListener('htmx:afterRequest', function(event) {
var indicator = document.querySelector('#loadingcontent');
if (indicator) {
onLoadingEnd();
}
});
</script>
}
script BeforeRequestContentMdGroupResult() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}
script AfterRequestContentMdGroupResult() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.remove("overlay");
loadingParent.classList.remove("overlay-block");
loadingChild.classList.remove("overlay-layer");
loadingSpinner.classList.add("d-none");
}
templ ShowMdGroupResultScreen(title string, cmp templ.Component, css templ.Component, js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,
userprofile templ.Component) {
@layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile) {
@cmp
}
}

View File

@@ -0,0 +1,433 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdgroupresultview
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import (
"cpone/component/customtextfield"
"cpone/layout"
"cpone/models"
"strconv"
)
func MdGroupResultScreen(
tableID string,
paginationID string,
searchID string,
dialogAddID string,
dialogAddBodyID string,
dialogEditID string,
dialogEditBodyID string,
dialogDeleteID string,
dialogDeleteBodyID string,
breadcrumb templ.Component,
tablecontent templ.Component,
filterComponent templ.Component,
paginationComponent templ.Component,
modalAddForm templ.Component,
modalEditForm templ.Component,
modalDeleteForm templ.Component) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"container-fluid\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
Name: "tableID",
Type: "hidden",
Value: tableID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID",
Name: "paginationID",
Type: "hidden",
Value: paginationID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "searchID",
Name: "searchID",
Type: "hidden",
Value: searchID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddID",
Name: "dialogAddID",
Type: "hidden",
Value: dialogAddID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddBodyID",
Name: "dialogAddBodyID",
Type: "hidden",
Value: dialogAddBodyID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditID",
Name: "dialogEditID",
Type: "hidden",
Value: dialogEditID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditBodyID",
Name: "dialogEditBodyID",
Type: "hidden",
Value: dialogEditBodyID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteID",
Name: "dialogDeleteID",
Type: "hidden",
Value: dialogDeleteID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteBodyID",
Name: "dialogDeleteBodyID",
Type: "hidden",
Value: dialogDeleteBodyID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row align-items-center mb-10\"><div class=\"col-md-10 col-sm-12 p-0 \">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = breadcrumb.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"col-md-2 d-none d-lg-block d-xl-block d-md-block d-sm-none\"><div class=\"d-flex justify-content-end\"><button type=\"button\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs("#" + dialogAddID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresult.templ`, Line: 75, Col: 37}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">Add New</button></div></div><div class=\"col-md-2 d-block d-lg-none d-xl-none d-md-none d-sm-block justify-content-center px-5\"><button type=\"button\" class=\"btn btn-primary btn-block\" data-toggle=\"modal\" data-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs("#" + dialogAddID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresult.templ`, Line: 84, Col: 36}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">Add New</button></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = filterComponent.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-parent\" class=\" rounded\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecontent.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = paginationComponent.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalAddForm.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalEditForm.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalDeleteForm.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-child\" class=\" rounded bg-transparent\"><div id=\"loading-spinner\" class=\"spinner-border text-primary d-none\" style=\"width: 3rem; height: 3rem;\" role=\"status\"><span class=\"sr-only\">Loading...</span></div></div></div><div id=\"loadingcontent\"></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
// for item dropdown
func ItemDropdown(dataDropdown []models.GroupResultResumeMcu, selectedId int) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if len(dataDropdown) == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"0\" disabled selected>Tidak Ada Data</option>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
for _, v := range dataDropdown {
if selectedId == v.ID {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresult.templ`, Line: 113, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" selected>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.Text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresult.templ`, Line: 113, Col: 58}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</option>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresult.templ`, Line: 115, Col: 38}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(v.Text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresult.templ`, Line: 115, Col: 49}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</option>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
}
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
// for empty div
func EmptyDiv1() templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var9 := templ.GetChildren(ctx)
if templ_7745c5c3_Var9 == nil {
templ_7745c5c3_Var9 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func CssMdGroupResult() templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var10 := templ.GetChildren(ctx)
if templ_7745c5c3_Var10 == nil {
templ_7745c5c3_Var10 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<link rel=\"stylesheet\" href=\"assets/css/googlefont/poppins.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/publicsans.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/roboto.css\"><style>\r\n body {\r\n background-color: white;\r\n /* padding-right: 100px;\r\n padding-left: 100px; */\r\n }\r\n #div-chart {\r\n /* overflow-x: scroll; */\r\n margin: 40px 10vw 40px 10vw;\r\n }\r\n .title {\r\n font-size:20px;\r\n font-weight: bold;\r\n }\r\n #title {\r\n font-weight: 600;\r\n }\r\n .dropdown-menu{\r\n\t\ttransform: translate3d(0px, 35px, 0px)!important;\r\n\t}\r\n \r\n</style>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func JsMdGroupResult() templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var11 := templ.GetChildren(ctx)
if templ_7745c5c3_Var11 == nil {
templ_7745c5c3_Var11 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script>\r\n function onLoadingStart() {\r\n // const loadingParent = document.getElementById(\"loading-parent\");\r\n\t\t\t// const loadingChild = document.getElementById(\"loading-child\");\r\n\t\t\t// const loadingSpinner = document.getElementById(\"loading-spinner\");\r\n\r\n\t\t\t// loadingParent.classList.add(\"overlay\");\r\n\t\t\t// loadingParent.classList.add(\"overlay-block\");\r\n\t\t\t// loadingChild.classList.add(\"overlay-layer\");\r\n\t\t\t// loadingSpinner.classList.remove(\"d-none\");\r\n\r\n // Additional logic when loading starts\r\n }\r\n\r\n function onLoadingEnd() {\r\n console.log('Loading ended');\r\n // const loadingParent = document.getElementById(\"loading-parent\");\r\n\t\t\t// const loadingChild = document.getElementById(\"loading-child\");\r\n\t\t\t// const loadingSpinner = document.getElementById(\"loading-spinner\");\r\n\r\n\t\t\t// loadingParent.classList.remove(\"overlay\");\r\n\t\t\t// loadingParent.classList.remove(\"overlay-block\");\r\n\t\t\t// loadingChild.classList.remove(\"overlay-layer\");\r\n\t\t\t// loadingSpinner.classList.add(\"d-none\");\r\n }\r\n\r\n document.addEventListener('htmx:beforeRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n\t\t\tconsole.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.elt)\r\n if (indicator) {\r\n onLoadingStart();\r\n }\r\n });\r\n\r\n document.addEventListener('htmx:afterRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n if (indicator) {\r\n onLoadingEnd();\r\n }\r\n });\r\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func BeforeRequestContentMdGroupResult() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_BeforeRequestContentMdGroupResult_911f`,
Function: `function __templ_BeforeRequestContentMdGroupResult_911f(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}`,
Call: templ.SafeScript(`__templ_BeforeRequestContentMdGroupResult_911f`),
CallInline: templ.SafeScriptInline(`__templ_BeforeRequestContentMdGroupResult_911f`),
}
}
func AfterRequestContentMdGroupResult() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_AfterRequestContentMdGroupResult_6cc0`,
Function: `function __templ_AfterRequestContentMdGroupResult_6cc0(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.remove("overlay");
loadingParent.classList.remove("overlay-block");
loadingChild.classList.remove("overlay-layer");
loadingSpinner.classList.add("d-none");
}`,
Call: templ.SafeScript(`__templ_AfterRequestContentMdGroupResult_6cc0`),
CallInline: templ.SafeScriptInline(`__templ_AfterRequestContentMdGroupResult_6cc0`),
}
}
func ShowMdGroupResultScreen(title string, cmp templ.Component, css templ.Component, js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,
userprofile templ.Component) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var12 := templ.GetChildren(ctx)
if templ_7745c5c3_Var12 == nil {
templ_7745c5c3_Var12 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Var13 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
templ_7745c5c3_Err = cmp.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer)
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var13), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,203 @@
package dev_mdgroupresultview
import "cpone/models"
import "cpone/component/modal"
import "cpone/component/customtextfield"
import "cpone/component/customcheckbox"
import "cpone/component/customdropdown"
templ GroupResultForm(data models.GroupResultFormComponent) {
<div class="">
<form
id={ data.IDComponent }
hx-post={ data.Link }
class="form"
hx-target={ data.HxTarget }
hx-swap={ data.HxSwap }
hx-include={ data.HxInclude }
hx-indicator=".formloading"
hx-on::before-request={ HandleFormBeforeRequest() }
hx-on::after-request={ HandleFormAfterRequest() }
>
@modalcomponent.Modal(data.ModalID,
data.ModalTitle,
data.DialogBody,
data.DialogAction,
data.ButtonCLose)
</form>
</div>
}
script HandleFormBeforeRequest() {
console.log("handle disable btn add");
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].setAttribute('disabled', 'true');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].setAttribute('disabled', 'true');
}
}
script HandleFormAfterRequest() {
console.log("handle enable btn add");
const btnactcancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnactcancel.length; i++) {
btnactcancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].removeAttribute('disabled');
}
}
templ BodyFormGroupResult(inputId models.CustomTextFieldv2Prm,
inputGrName models.CustomTextFieldv2Prm,
checkboxGrFlagPerTest models.CustomCheckboxv1Prm,
checkboxGrFlagNonLab models.CustomCheckboxv1Prm,
dropdownGrResumeMcu models.CustomDropdownv1Prm,
listItem templ.Component,
componentID string,
hxOnLoad templ.ComponentScript) {
<div id={ componentID } hx-on::load={ hxOnLoad }>
@customtextfield.CustomTextFieldv2(
inputId)
@customtextfield.CustomTextFieldv2(
inputGrName)
@customcheckbox.MainCustomCheckboxInput(
checkboxGrFlagPerTest)
@customcheckbox.MainCustomCheckboxInput(
checkboxGrFlagNonLab)
@customdropdown.MainCustomDropdownInput(
dropdownGrResumeMcu,
listItem)
</div>
<script>
document.addEventListener('htmx:afterSwap', function(event) {
// Reinitialize selectpicker after HTMX content swap
$('.selectpicker').selectpicker('refresh');
});
</script>
}
script JsHideModalGroupResult(modalID string) {
$(modalID).modal('hide')
}
script JsShowModalGroupResult(modalID string) {
$(modalID).modal('show')
const btnactcancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnactcancel.length; i++) {
btnactcancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].removeAttribute('disabled');
}
}
templ ActionFormGroupResult(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
<div>
<button
hx-on::after-request={ JsHideModalGroupResult(modalID) }
hx-post={ LinkClose }
hx-target={ targetClose }
hx-swap={ hxSwapClose }
hx-indicator=".cancelloading"
type="button"
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel "
data-dismiss="modal"
>
<span class="htmx-indicator spinner-border spinner-border-sm cancelloading" role="status" aria-hidden="true"></span>
Batal
</button>
<button
type="submit"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata"
>
<span class="htmx-indicator spinner-border spinner-border-sm formloading" role="status" aria-hidden="true"></span>
Simpan
</button>
</div>
}
templ BtnCloseFormGroupResult(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
<button
hx-post={ LinkClose }
hx-target={ targetClose }
hx-swap={ hxSwapClose }
type="button"
hx-on::after-request={ JsHideModalGroupResult(modalID) }
class="close btnactcancel"
data-dismiss="modal"
aria-label="Close"
>
<i aria-hidden="true" class="ki ki-close"></i>
</button>
}
templ DeleteConfirmationBodyGroupResult(inputId models.CustomTextFieldv2Prm,
componentID string,
message string,
datHeader []string,
dataText []string,
hxOnLoad templ.ComponentScript) {
<div id={ componentID } hx-on::load={ hxOnLoad }>
<p>{ message }</p>
<div class="card rounded-lg">
<div class="card-body d-flex flex-row">
<div class="d-flex flex-column">
for _, v := range datHeader {
<div class="mb-1 mt-1 text-disabled font-weight-bold mr-5">{ v }</div>
}
</div>
<div class="d-flex flex-column ">
for _, v := range dataText {
<div class="mb-1 mt-1 font-weight-bold">
{ v }
</div>
}
</div>
</div>
</div>
@customtextfield.CustomTextFieldv2(inputId)
</div>
}
templ ActionFormGroupResultDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
<div>
<button
hx-on::after-request={ JsHideModalGroupResult(modalID) }
hx-post={ LinkClose }
hx-target={ targetClose }
hx-swap={ hxSwapClose }
hx-indicator=".cancelloading"
type="button"
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel"
data-dismiss="modal"
>
<span class="htmx-indicator spinner-border spinner-border-sm cancelloading" role="status" aria-hidden="true"></span>
Batal
</button>
<button
type="submit"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata"
>
<span class="htmx-indicator spinner-border spinner-border-sm formloading" role="status" aria-hidden="true"></span>
Yakin
</button>
</div>
}

View File

@@ -0,0 +1,665 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdgroupresultview
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import "cpone/models"
import "cpone/component/modal"
import "cpone/component/customtextfield"
import "cpone/component/customcheckbox"
import "cpone/component/customdropdown"
func GroupResultForm(data models.GroupResultFormComponent) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleFormBeforeRequest(), HandleFormAfterRequest())
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<form id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(data.IDComponent)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 12, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(data.Link)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 13, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"form\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(data.HxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 15, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(data.HxSwap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 16, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(data.HxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 17, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\".formloading\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 templ.ComponentScript = HandleFormBeforeRequest()
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 templ.ComponentScript = HandleFormAfterRequest()
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalcomponent.Modal(data.ModalID,
data.ModalTitle,
data.DialogBody,
data.DialogAction,
data.ButtonCLose).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</form></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func HandleFormBeforeRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormBeforeRequest_2922`,
Function: `function __templ_HandleFormBeforeRequest_2922(){console.log("handle disable btn add");
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].setAttribute('disabled', 'true');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].setAttribute('disabled', 'true');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_2922`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_2922`),
}
}
func HandleFormAfterRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormAfterRequest_956b`,
Function: `function __templ_HandleFormAfterRequest_956b(){console.log("handle enable btn add");
const btnactcancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnactcancel.length; i++) {
btnactcancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].removeAttribute('disabled');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormAfterRequest_956b`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_956b`),
}
}
func BodyFormGroupResult(inputId models.CustomTextFieldv2Prm,
inputGrName models.CustomTextFieldv2Prm,
checkboxGrFlagPerTest models.CustomCheckboxv1Prm,
checkboxGrFlagNonLab models.CustomCheckboxv1Prm,
dropdownGrResumeMcu models.CustomDropdownv1Prm,
listItem templ.Component,
componentID string,
hxOnLoad templ.ComponentScript) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var9 := templ.GetChildren(ctx)
if templ_7745c5c3_Var9 == nil {
templ_7745c5c3_Var9 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxOnLoad)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 71, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 templ.ComponentScript = hxOnLoad
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(
inputId).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(
inputGrName).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customcheckbox.MainCustomCheckboxInput(
checkboxGrFlagPerTest).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customcheckbox.MainCustomCheckboxInput(
checkboxGrFlagNonLab).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customdropdown.MainCustomDropdownInput(
dropdownGrResumeMcu,
listItem).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><script>\r\n document.addEventListener('htmx:afterSwap', function(event) {\r\n // Reinitialize selectpicker after HTMX content swap\r\n $('.selectpicker').selectpicker('refresh');\r\n });\r\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func JsHideModalGroupResult(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JsHideModalGroupResult_da6c`,
Function: `function __templ_JsHideModalGroupResult_da6c(modalID){$(modalID).modal('hide')
}`,
Call: templ.SafeScript(`__templ_JsHideModalGroupResult_da6c`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsHideModalGroupResult_da6c`, modalID),
}
}
func JsShowModalGroupResult(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JsShowModalGroupResult_b74d`,
Function: `function __templ_JsShowModalGroupResult_b74d(modalID){$(modalID).modal('show')
const btnactcancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnactcancel.length; i++) {
btnactcancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].removeAttribute('disabled');
}
}`,
Call: templ.SafeScript(`__templ_JsShowModalGroupResult_b74d`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsShowModalGroupResult_b74d`, modalID),
}
}
func ActionFormGroupResult(LinkClose string, targetClose string, hxSwapClose string, modalID string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var12 := templ.GetChildren(ctx)
if templ_7745c5c3_Var12 == nil {
templ_7745c5c3_Var12 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModalGroupResult(modalID))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 templ.ComponentScript = JsHideModalGroupResult(modalID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 116, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 117, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 118, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\".cancelloading\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel \" data-dismiss=\"modal\"><span class=\"htmx-indicator spinner-border spinner-border-sm cancelloading\" role=\"status\" aria-hidden=\"true\"></span> Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata\"><span class=\"htmx-indicator spinner-border spinner-border-sm formloading\" role=\"status\" aria-hidden=\"true\"></span> Simpan\r</button></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func BtnCloseFormGroupResult(LinkClose string, targetClose string, hxSwapClose string, modalID string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var17 := templ.GetChildren(ctx)
if templ_7745c5c3_Var17 == nil {
templ_7745c5c3_Var17 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModalGroupResult(modalID))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 139, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 140, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 141, Col: 23}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"button\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var21 templ.ComponentScript = JsHideModalGroupResult(modalID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var21.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"close btnactcancel\" data-dismiss=\"modal\" aria-label=\"Close\"><i aria-hidden=\"true\" class=\"ki ki-close\"></i></button>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func DeleteConfirmationBodyGroupResult(inputId models.CustomTextFieldv2Prm,
componentID string,
message string,
datHeader []string,
dataText []string,
hxOnLoad templ.ComponentScript) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var22 := templ.GetChildren(ctx)
if templ_7745c5c3_Var22 == nil {
templ_7745c5c3_Var22 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxOnLoad)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 158, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var24 templ.ComponentScript = hxOnLoad
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(message)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 159, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p><div class=\"card rounded-lg\"><div class=\"card-body d-flex flex-row\"><div class=\"d-flex flex-column\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range datHeader {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 text-disabled font-weight-bold mr-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 164, Col: 68}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"d-flex flex-column \">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range dataText {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 font-weight-bold\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 170, Col: 10}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputId).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func ActionFormGroupResultDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var28 := templ.GetChildren(ctx)
if templ_7745c5c3_Var28 == nil {
templ_7745c5c3_Var28 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModalGroupResult(modalID))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var29 templ.ComponentScript = JsHideModalGroupResult(modalID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 184, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 185, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresultformmodal.templ`, Line: 186, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\".cancelloading\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel\" data-dismiss=\"modal\"><span class=\"htmx-indicator spinner-border spinner-border-sm cancelloading\" role=\"status\" aria-hidden=\"true\"></span> Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata\"><span class=\"htmx-indicator spinner-border spinner-border-sm formloading\" role=\"status\" aria-hidden=\"true\"></span> Yakin\r</button></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,131 @@
package dev_mdgroupresultview
import "cpone/component/table"
import "cpone/models"
import "strconv"
templ TableGroupResult(data []models.GroupResult,
tableID string,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete string,
) {
<div id={ tableID } hx-swap-oob="true">
@tablecomponent.TableV3([]string{"GROUP RESULT NAME", "RESULT FLAG PER TEST", "RESULT FLAG NON LAB", "RESULT RESUME MCU", "AKSI"},
[]string{"20%", "20%", "20%", "20%", "20%"},
RowGroupResult(data,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
))
</div>
}
templ RowGroupResult(data []models.GroupResult,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete string,
) {
if len(data) == 0 {
<tr>
<td colspan="3" class="text-center">Data Tidak Ditemukan</td>
</tr>
}
for _, v := range data {
<tr>
<td>{ v.Group_ResultName }</td>
<td>{ v.Group_ResultFlagPerTest }</td>
<td>{ v.Group_ResultFlagNonLab }</td>
<td>{ v.Group_ResultResumeMcu }</td>
<td>
@TableAction(v.Group_ResultID,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
)
</td>
</tr>
}
}
templ TableAction(
id int,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete string,
) {
<div class="row px-5 d-flex justify-content-around">
<a
type="button"
class="btnactiongr col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2 btn-sm"
hx-get={ hxGetEdit + "?id=" + strconv.Itoa(id) }
hx-target={ hxTargetEdit }
hx-swap={ hxSwapEdit }
hx-include={ hxIncludeEdit }
hx-indicator={ "#spnredt" + strconv.Itoa(id) }
hx-on::before-request={ HandleBeforeRequestRow(strconv.Itoa(id)) }
hx-on::after-request={ HandleAfterRequestRow(strconv.Itoa(id)) }
>
<span id={ "spnredt" + strconv.Itoa(id) } class="htmx-indicator spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Edit
</a>
<a
type="button"
class=" btnactiongr col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2 btn-sm"
hx-get={ hxGetDelete + "?id=" + strconv.Itoa(id) }
hx-target={ hxTargetDelete }
hx-swap={ hxSwapDelete }
hx-include={ hxIncludeDelete }
hx-indicator={ "#spnrdel" + strconv.Itoa(id) }
hx-on::before-request={ HandleBeforeRequestRow(strconv.Itoa(id)) }
hx-on::after-request={ HandleAfterRequestRow(strconv.Itoa(id)) }
>
<span id={ "spnrdel" + strconv.Itoa(id) } class="htmx-indicator spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Hapus
</a>
</div>
}
script HandleBeforeRequestRow(id string) {
var cusid_ele = document.getElementsByClassName('btnactiongr');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.add('disabled');
}
console.log(id)
}
script HandleAfterRequestRow(id string) {
var cusid_ele = document.getElementsByClassName('btnactiongr');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.remove('disabled');
}
console.log(id)
}

View File

@@ -0,0 +1,464 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdgroupresultview
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import "cpone/component/table"
import "cpone/models"
import "strconv"
func TableGroupResult(data []models.GroupResult,
tableID string,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete string,
) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(tableID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 18, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap-oob=\"true\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"GROUP RESULT NAME", "RESULT FLAG PER TEST", "RESULT FLAG NON LAB", "RESULT RESUME MCU", "AKSI"},
[]string{"20%", "20%", "20%", "20%", "20%"},
RowGroupResult(data,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
)).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func RowGroupResult(data []models.GroupResult,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete string,
) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
if templ_7745c5c3_Var3 == nil {
templ_7745c5c3_Var3 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if len(data) == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td colspan=\"3\" class=\"text-center\">Data Tidak Ditemukan</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
for _, v := range data {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(v.Group_ResultName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 51, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v.Group_ResultFlagPerTest)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 52, Col: 34}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.Group_ResultFlagNonLab)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 53, Col: 33}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(v.Group_ResultResumeMcu)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 54, Col: 32}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = TableAction(v.Group_ResultID,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func TableAction(
id int,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete string,
) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var8 := templ.GetChildren(ctx)
if templ_7745c5c3_Var8 == nil {
templ_7745c5c3_Var8 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row px-5 d-flex justify-content-around\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleBeforeRequestRow(strconv.Itoa(id)), HandleAfterRequestRow(strconv.Itoa(id)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\"btnactiongr col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2 btn-sm\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetEdit + "?id=" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 87, Col: 49}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 88, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 89, Col: 23}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 90, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs("#spnredt" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 91, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><span id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs("spnredt" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 95, Col: 42}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"htmx-indicator spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span> Edit\r</a> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleBeforeRequestRow(strconv.Itoa(id)), HandleAfterRequestRow(strconv.Itoa(id)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\" btnactiongr col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2 btn-sm\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetDelete + "?id=" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 101, Col: 51}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 102, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 103, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 104, Col: 31}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs("#spnrdel" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 105, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var22 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var23.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><span id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs("spnrdel" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdgroupresult\mdgroupresulttable.templ`, Line: 109, Col: 42}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"htmx-indicator spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span> Hapus\r</a></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func HandleBeforeRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleBeforeRequestRow_8869`,
Function: `function __templ_HandleBeforeRequestRow_8869(id){var cusid_ele = document.getElementsByClassName('btnactiongr');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.add('disabled');
}
console.log(id)
}`,
Call: templ.SafeScript(`__templ_HandleBeforeRequestRow_8869`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleBeforeRequestRow_8869`, id),
}
}
func HandleAfterRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleAfterRequestRow_ef01`,
Function: `function __templ_HandleAfterRequestRow_ef01(id){var cusid_ele = document.getElementsByClassName('btnactiongr');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.remove('disabled');
}
console.log(id)
}`,
Call: templ.SafeScript(`__templ_HandleAfterRequestRow_ef01`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleAfterRequestRow_ef01`, id),
}
}

View File

@@ -12,11 +12,17 @@ templ MdUserGroupScreen(
searchID string,
dialogAddID string,
dialogAddBodyID string,
dialogEditID string,
dialogEditBodyID string,
dialogDeleteID string,
dialogDeleteBodyID string,
breadcrumb templ.Component,
tablecontent templ.Component,
filterComponent templ.Component,
paginationComponent templ.Component,
modalAddForm templ.Component) {
modalAddForm templ.Component,
modalEditForm templ.Component,
modalDeleteForm templ.Component) {
<div class="container-fluid">
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
Name: "tableID",
@@ -38,6 +44,22 @@ templ MdUserGroupScreen(
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
@@ -63,9 +85,20 @@ templ MdUserGroupScreen(
</div>
</div>
@filterComponent
@tablecontent
@paginationComponent
@modalAddForm
<div id="loading-parent" class=" rounded">
@tablecontent
@paginationComponent
@modalAddForm
@modalEditForm
@modalDeleteForm
<div id="loading-child" class=" rounded bg-transparent">
// <div class="spinner spinner-lg spinner-primary"></div>
<div id="loading-spinner" class="spinner-border text-primary d-none" style="width: 3rem; height: 3rem;" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
</div>
<div id="loadingcontent"></div>
</div>
}
@@ -104,6 +137,70 @@ templ CssMdUserGroup() {
}
templ JsMdUserGroup() {
<script>
function onLoadingStart() {
// const loadingParent = document.getElementById("loading-parent");
// const loadingChild = document.getElementById("loading-child");
// const loadingSpinner = document.getElementById("loading-spinner");
// loadingParent.classList.add("overlay");
// loadingParent.classList.add("overlay-block");
// loadingChild.classList.add("overlay-layer");
// loadingSpinner.classList.remove("d-none");
// Additional logic when loading starts
}
function onLoadingEnd() {
console.log('Loading ended');
// const loadingParent = document.getElementById("loading-parent");
// const loadingChild = document.getElementById("loading-child");
// const loadingSpinner = document.getElementById("loading-spinner");
// loadingParent.classList.remove("overlay");
// loadingParent.classList.remove("overlay-block");
// loadingChild.classList.remove("overlay-layer");
// loadingSpinner.classList.add("d-none");
}
document.addEventListener('htmx:beforeRequest', function(event) {
var indicator = document.querySelector('#loadingcontent');
console.log(event.detail.xhr)
console.log(event.detail.elt)
if (indicator) {
onLoadingStart();
}
});
document.addEventListener('htmx:afterRequest', function(event) {
var indicator = document.querySelector('#loadingcontent');
if (indicator) {
onLoadingEnd();
}
});
</script>
}
script BeforeRequestContent() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}
script AfterRequestContent() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.remove("overlay");
loadingParent.classList.remove("overlay-block");
loadingChild.classList.remove("overlay-layer");
loadingSpinner.classList.add("d-none");
}
templ ShowMdUserGroupScreen(title string, cmp templ.Component, css templ.Component, js templ.Component,

View File

@@ -22,11 +22,17 @@ func MdUserGroupScreen(
searchID string,
dialogAddID string,
dialogAddBodyID string,
dialogEditID string,
dialogEditBodyID string,
dialogDeleteID string,
dialogDeleteBodyID string,
breadcrumb templ.Component,
tablecontent templ.Component,
filterComponent templ.Component,
paginationComponent templ.Component,
modalAddForm templ.Component) 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 {
@@ -78,6 +84,34 @@ func MdUserGroupScreen(
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
@@ -86,27 +120,27 @@ func MdUserGroupScreen(
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-toggle=\"modal\" data-target=\"")
_, 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\mdusergroup\mdusergroup.templ`, Line: 53, Col: 37}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroup.templ`, Line: 74, Col: 37}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">Add New</button></div></div><div class=\"col-md-2 d-block d-lg-none d-xl-none d-md-none d-sm-block justify-content-center px-5\"><button type=\"button\" class=\"btn btn-primary btn-block\" data-toggle=\"modal\" data-toggle=\"modal\" data-target=\"")
_, 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\mdusergroup\mdusergroup.templ`, Line: 63, Col: 36}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroup.templ`, Line: 83, Col: 36}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
@@ -120,6 +154,10 @@ func MdUserGroupScreen(
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-parent\" class=\" rounded\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecontent.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
@@ -132,7 +170,15 @@ func MdUserGroupScreen(
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
templ_7745c5c3_Err = modalEditForm.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalDeleteForm.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-child\" class=\" rounded bg-transparent\"><div id=\"loading-spinner\" class=\"spinner-border text-primary d-none\" style=\"width: 3rem; height: 3rem;\" role=\"status\"><span class=\"sr-only\">Loading...</span></div></div></div><div id=\"loadingcontent\"></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -180,6 +226,10 @@ func JsMdUserGroup() templ.Component {
templ_7745c5c3_Var5 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script>\r\n function onLoadingStart() {\r\n // const loadingParent = document.getElementById(\"loading-parent\");\r\n\t\t\t// const loadingChild = document.getElementById(\"loading-child\");\r\n\t\t\t// const loadingSpinner = document.getElementById(\"loading-spinner\");\r\n\r\n\t\t\t// loadingParent.classList.add(\"overlay\");\r\n\t\t\t// loadingParent.classList.add(\"overlay-block\");\r\n\t\t\t// loadingChild.classList.add(\"overlay-layer\");\r\n\t\t\t// loadingSpinner.classList.remove(\"d-none\");\r\n\r\n // Additional logic when loading starts\r\n }\r\n\r\n function onLoadingEnd() {\r\n console.log('Loading ended');\r\n // const loadingParent = document.getElementById(\"loading-parent\");\r\n\t\t\t// const loadingChild = document.getElementById(\"loading-child\");\r\n\t\t\t// const loadingSpinner = document.getElementById(\"loading-spinner\");\r\n\r\n\t\t\t// loadingParent.classList.remove(\"overlay\");\r\n\t\t\t// loadingParent.classList.remove(\"overlay-block\");\r\n\t\t\t// loadingChild.classList.remove(\"overlay-layer\");\r\n\t\t\t// loadingSpinner.classList.add(\"d-none\");\r\n }\r\n\r\n document.addEventListener('htmx:beforeRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n\t\t\tconsole.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.elt)\r\n if (indicator) {\r\n onLoadingStart();\r\n }\r\n });\r\n\r\n document.addEventListener('htmx:afterRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n if (indicator) {\r\n onLoadingEnd();\r\n }\r\n });\r\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
@@ -187,6 +237,40 @@ func JsMdUserGroup() templ.Component {
})
}
func BeforeRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_BeforeRequestContent_911f`,
Function: `function __templ_BeforeRequestContent_911f(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}`,
Call: templ.SafeScript(`__templ_BeforeRequestContent_911f`),
CallInline: templ.SafeScriptInline(`__templ_BeforeRequestContent_911f`),
}
}
func AfterRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_AfterRequestContent_6cc0`,
Function: `function __templ_AfterRequestContent_6cc0(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.remove("overlay");
loadingParent.classList.remove("overlay-block");
loadingChild.classList.remove("overlay-layer");
loadingSpinner.classList.add("d-none");
}`,
Call: templ.SafeScript(`__templ_AfterRequestContent_6cc0`),
CallInline: templ.SafeScriptInline(`__templ_AfterRequestContent_6cc0`),
}
}
func ShowMdUserGroupScreen(title string, cmp templ.Component, css templ.Component, js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,

View File

@@ -13,6 +13,7 @@ templ UserGroupForm(data models.UserGroupFormComponent) {
hx-target={ data.HxTarget }
hx-swap={ data.HxSwap }
hx-include={ data.HxInclude }
hx-indicator=".formloading"
hx-on::before-request={ HandleFormBeforeRequest() }
hx-on::after-request={ HandleFormAfterRequest() }
>
@@ -27,10 +28,15 @@ templ UserGroupForm(data models.UserGroupFormComponent) {
script HandleFormBeforeRequest() {
console.log("handle disable btn add");
const boxes = document.querySelectorAll('.btnaddact');
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < boxes.length; i++) {
boxes[i].setAttribute('disabled', 'true');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].setAttribute('disabled', 'true');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].setAttribute('disabled', 'true');
}
}
@@ -38,10 +44,16 @@ script HandleFormBeforeRequest() {
script HandleFormAfterRequest() {
console.log("handle enable btn add");
const boxes = document.querySelectorAll('.btnaddact');
const btnactcancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < boxes.length; i++) {
boxes[i].removeAttribute('disabled');
for (let i = 0; i < btnactcancel.length; i++) {
btnactcancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].removeAttribute('disabled');
}
}
@@ -67,6 +79,18 @@ script JsHideModal(modalID string) {
script JsShowModal(modalID string) {
$(modalID).modal('show')
const btnactcancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnactcancel.length; i++) {
btnactcancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].removeAttribute('disabled');
}
}
templ ActionFormUserGroup(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
@@ -76,17 +100,20 @@ templ ActionFormUserGroup(LinkClose string, targetClose string, hxSwapClose stri
hx-post={ LinkClose }
hx-target={ targetClose }
hx-swap={ hxSwapClose }
hx-indicator=".cancelloading"
type="button"
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnaddact"
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel "
data-dismiss="modal"
>
<span class="htmx-indicator spinner-border spinner-border-sm cancelloading" role="status" aria-hidden="true"></span>
Batal
</button>
<button
type="submit"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata"
>
Save
<span class="htmx-indicator spinner-border spinner-border-sm formloading" role="status" aria-hidden="true"></span>
Simpan
</button>
</div>
}
@@ -98,10 +125,63 @@ templ BtnCloseFormUserGroup(LinkClose string, targetClose string, hxSwapClose st
hx-swap={ hxSwapClose }
type="button"
hx-on::after-request={ JsHideModal(modalID) }
class="close btnaddact"
class="close btnactcancel"
data-dismiss="modal"
aria-label="Close"
>
<i aria-hidden="true" class="ki ki-close"></i>
</button>
}
templ DeleteConfirmationBody(inputId models.CustomTextFieldv2Prm,
componentID string,
message string,
datHeader []string,
dataText []string,
hxOnLoad templ.ComponentScript) {
<div id={ componentID } hx-on::load={ hxOnLoad }>
<p>{ message }</p>
<div class="card rounded-lg">
<div class="card-body d-flex flex-row">
<div class="d-flex flex-column">
for _, v := range datHeader {
<div class="mb-1 mt-1 text-disabled font-weight-bold mr-5">{ v }</div>
}
</div>
<div class="d-flex flex-column ">
for _, v := range dataText {
<div class="mb-1 mt-1 font-weight-bold">
{ v }
</div>
}
</div>
</div>
</div>
@customtextfield.CustomTextFieldv2(inputId)
</div>
}
templ ActionFormUserGroupDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
<div>
<button
hx-on::after-request={ JsHideModal(modalID) }
hx-post={ LinkClose }
hx-target={ targetClose }
hx-swap={ hxSwapClose }
hx-indicator=".cancelloading"
type="button"
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel"
data-dismiss="modal"
>
<span class="htmx-indicator spinner-border spinner-border-sm cancelloading" role="status" aria-hidden="true"></span>
Batal
</button>
<button
type="submit"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata"
>
<span class="htmx-indicator spinner-border spinner-border-sm formloading" role="status" aria-hidden="true"></span>
Yakin
</button>
</div>
}

View File

@@ -100,7 +100,7 @@ func UserGroupForm(data models.UserGroupFormComponent) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\".formloading\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -143,34 +143,45 @@ func UserGroupForm(data models.UserGroupFormComponent) templ.Component {
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');
Name: `__templ_HandleFormBeforeRequest_2922`,
Function: `function __templ_HandleFormBeforeRequest_2922(){console.log("handle disable btn add");
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < boxes.length; i++) {
boxes[i].setAttribute('disabled', 'true');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].setAttribute('disabled', 'true');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].setAttribute('disabled', 'true');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_1e3f`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_1e3f`),
Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_2922`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_2922`),
}
}
func HandleFormAfterRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormAfterRequest_ee07`,
Function: `function __templ_HandleFormAfterRequest_ee07(){console.log("handle enable btn add");
Name: `__templ_HandleFormAfterRequest_956b`,
Function: `function __templ_HandleFormAfterRequest_956b(){console.log("handle enable btn add");
const boxes = document.querySelectorAll('.btnaddact');
const btnactcancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < boxes.length; i++) {
boxes[i].removeAttribute('disabled');
for (let i = 0; i < btnactcancel.length; i++) {
btnactcancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].removeAttribute('disabled');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormAfterRequest_ee07`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_ee07`),
Call: templ.SafeScript(`__templ_HandleFormAfterRequest_956b`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_956b`),
}
}
@@ -202,7 +213,7 @@ func BodyFormUserGroup(inputId models.CustomTextFieldv2Prm,
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 54, Col: 22}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 66, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
@@ -259,11 +270,23 @@ func JsHideModal(modalID string) templ.ComponentScript {
func JsShowModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JsShowModal_3147`,
Function: `function __templ_JsShowModal_3147(modalID){$(modalID).modal('show')
Name: `__templ_JsShowModal_b74d`,
Function: `function __templ_JsShowModal_b74d(modalID){$(modalID).modal('show')
const btnactcancel = document.querySelectorAll('.btnactcancel');
const btnactsavedata = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnactcancel.length; i++) {
btnactcancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnactsavedata.length; i++) {
btnactsavedata[i].removeAttribute('disabled');
}
}`,
Call: templ.SafeScript(`__templ_JsShowModal_3147`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsShowModal_3147`, modalID),
Call: templ.SafeScript(`__templ_JsShowModal_b74d`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsShowModal_b74d`, modalID),
}
}
@@ -304,7 +327,7 @@ func ActionFormUserGroup(LinkClose string, targetClose string, hxSwapClose strin
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 76, Col: 22}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 100, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
@@ -317,7 +340,7 @@ func ActionFormUserGroup(LinkClose string, targetClose string, hxSwapClose strin
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 77, Col: 26}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 101, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
@@ -330,13 +353,13 @@ func ActionFormUserGroup(LinkClose string, targetClose string, hxSwapClose strin
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 78, Col: 24}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 102, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" 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>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\".cancelloading\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel \" data-dismiss=\"modal\"><span class=\"htmx-indicator spinner-border spinner-border-sm cancelloading\" role=\"status\" aria-hidden=\"true\"></span> Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata\"><span class=\"htmx-indicator spinner-border spinner-border-sm formloading\" role=\"status\" aria-hidden=\"true\"></span> Simpan\r</button></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -371,7 +394,7 @@ func BtnCloseFormUserGroup(LinkClose string, targetClose string, hxSwapClose str
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 96, Col: 21}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 123, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
@@ -384,7 +407,7 @@ func BtnCloseFormUserGroup(LinkClose string, targetClose string, hxSwapClose str
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 97, Col: 25}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 124, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
@@ -397,7 +420,7 @@ func BtnCloseFormUserGroup(LinkClose string, targetClose string, hxSwapClose str
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 98, Col: 23}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 125, Col: 23}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
@@ -412,7 +435,209 @@ func BtnCloseFormUserGroup(LinkClose string, targetClose string, hxSwapClose str
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"close btnaddact\" data-dismiss=\"modal\" aria-label=\"Close\"><i aria-hidden=\"true\" class=\"ki ki-close\"></i></button>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"close btnactcancel\" data-dismiss=\"modal\" aria-label=\"Close\"><i aria-hidden=\"true\" class=\"ki ki-close\"></i></button>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func DeleteConfirmationBody(inputId models.CustomTextFieldv2Prm,
componentID string,
message string,
datHeader []string,
dataText []string,
hxOnLoad templ.ComponentScript) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var22 := templ.GetChildren(ctx)
if templ_7745c5c3_Var22 == nil {
templ_7745c5c3_Var22 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxOnLoad)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 142, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var24 templ.ComponentScript = hxOnLoad
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(message)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 143, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p><div class=\"card rounded-lg\"><div class=\"card-body d-flex flex-row\"><div class=\"d-flex flex-column\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range datHeader {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 text-disabled font-weight-bold mr-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 148, Col: 68}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"d-flex flex-column \">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range dataText {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 font-weight-bold\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 154, Col: 10}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputId).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func ActionFormUserGroupDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var28 := templ.GetChildren(ctx)
if templ_7745c5c3_Var28 == nil {
templ_7745c5c3_Var28 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModal(modalID))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var29 templ.ComponentScript = JsHideModal(modalID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 168, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 169, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergroupformmodal.templ`, Line: 170, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\".cancelloading\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel\" data-dismiss=\"modal\"><span class=\"htmx-indicator spinner-border spinner-border-sm cancelloading\" role=\"status\" aria-hidden=\"true\"></span> Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata\"><span class=\"htmx-indicator spinner-border spinner-border-sm formloading\" role=\"status\" aria-hidden=\"true\"></span> Yakin\r</button></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -2,17 +2,45 @@ package dev_mdusergroupview
import "cpone/component/table"
import "cpone/models"
import "strconv"
templ TableUserGroup(data []models.UserGroupV1,
tableID string) {
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%"},
RowUserGroup(data))
RowUserGroup(data,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
))
</div>
}
templ RowUserGroup(data []models.UserGroupV1) {
templ RowUserGroup(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>
@@ -23,8 +51,79 @@ templ RowUserGroup(data []models.UserGroupV1) {
<td>{ v.M_UserGroupCode }</td>
<td>{ v.M_UserGroupName }</td>
<td>
action
@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
type="button"
class="btnactionug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2 btn-sm"
hx-get={ hxGetEdit + "?id=" + strconv.Itoa(id) }
hx-target={ hxTargetEdit }
hx-swap={ hxSwapEdit }
hx-include={ hxIncludeEdit }
hx-indicator={ "#spnredt" + strconv.Itoa(id) }
hx-on::before-request={ HandleBeforeRequestRow(strconv.Itoa(id)) }
hx-on::after-request={ HandleAfterRequestRow(strconv.Itoa(id)) }
>
<span id={ "spnredt" + strconv.Itoa(id) } class="htmx-indicator spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Edit
</a>
<a
type="button"
class=" btnactionug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2 btn-sm"
hx-get={ hxGetDelete + "?id=" + strconv.Itoa(id) }
hx-target={ hxTargetDelete }
hx-swap={ hxSwapDelete }
hx-include={ hxIncludeDelete }
hx-indicator={ "#spnrdel" + strconv.Itoa(id) }
hx-on::before-request={ HandleBeforeRequestRow(strconv.Itoa(id)) }
hx-on::after-request={ HandleAfterRequestRow(strconv.Itoa(id)) }
>
<span id={ "spnrdel" + strconv.Itoa(id) } class="htmx-indicator spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Hapus
</a>
</div>
}
script HandleBeforeRequestRow(id string) {
var cusid_ele = document.getElementsByClassName('btnactionug');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.add('disabled');
}
console.log(id)
}
script HandleAfterRequestRow(id string) {
var cusid_ele = document.getElementsByClassName('btnactionug');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.remove('disabled');
}
console.log(id)
}

View File

@@ -12,9 +12,19 @@ import "bytes"
import "cpone/component/table"
import "cpone/models"
import "strconv"
func TableUserGroup(data []models.UserGroupV1,
tableID string) templ.Component {
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 {
@@ -34,7 +44,7 @@ func TableUserGroup(data []models.UserGroupV1,
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(tableID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 8, Col: 18}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 18, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
@@ -46,7 +56,16 @@ func TableUserGroup(data []models.UserGroupV1,
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"KODE", "USERGROUP", "AKSI"},
[]string{"40%", "40%", "20%"},
RowUserGroup(data)).Render(ctx, templ_7745c5c3_Buffer)
RowUserGroup(data,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
)).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -61,7 +80,16 @@ func TableUserGroup(data []models.UserGroupV1,
})
}
func RowUserGroup(data []models.UserGroupV1) templ.Component {
func RowUserGroup(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 {
@@ -88,7 +116,7 @@ func RowUserGroup(data []models.UserGroupV1) templ.Component {
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_UserGroupCode)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 23, Col: 26}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 51, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
@@ -101,13 +129,30 @@ func RowUserGroup(data []models.UserGroupV1) templ.Component {
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_UserGroupName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 24, Col: 26}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 52, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>action\r</td></tr>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
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 = templ_7745c5c3_Buffer.WriteString("</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -118,3 +163,276 @@ func RowUserGroup(data []models.UserGroupV1) templ.Component {
return templ_7745c5c3_Err
})
}
func TableAction(
id int,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete string,
) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var6 := templ.GetChildren(ctx)
if templ_7745c5c3_Var6 == nil {
templ_7745c5c3_Var6 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row px-5 d-flex justify-content-around\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleBeforeRequestRow(strconv.Itoa(id)), HandleAfterRequestRow(strconv.Itoa(id)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\"btnactionug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2 btn-sm\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetEdit + "?id=" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 85, Col: 49}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 86, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 87, Col: 23}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 88, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs("#spnredt" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 89, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><span id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs("spnredt" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 93, Col: 42}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"htmx-indicator spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span> Edit\r</a> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleBeforeRequestRow(strconv.Itoa(id)), HandleAfterRequestRow(strconv.Itoa(id)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\" btnactionug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2 btn-sm\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetDelete + "?id=" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 99, Col: 51}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 100, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 101, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 102, Col: 31}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs("#spnrdel" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 103, Col: 47}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var20.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var21 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var21.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><span id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var22 string
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs("spnrdel" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdusergroup\mdusergrouptable.templ`, Line: 107, Col: 42}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"htmx-indicator spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span> Hapus\r</a></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func HandleBeforeRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleBeforeRequestRow_ee28`,
Function: `function __templ_HandleBeforeRequestRow_ee28(id){var cusid_ele = document.getElementsByClassName('btnactionug');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.add('disabled');
}
console.log(id)
}`,
Call: templ.SafeScript(`__templ_HandleBeforeRequestRow_ee28`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleBeforeRequestRow_ee28`, id),
}
}
func HandleAfterRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleAfterRequestRow_2a96`,
Function: `function __templ_HandleAfterRequestRow_2a96(id){var cusid_ele = document.getElementsByClassName('btnactionug');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.remove('disabled');
}
console.log(id)
}`,
Call: templ.SafeScript(`__templ_HandleAfterRequestRow_2a96`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleAfterRequestRow_2a96`, id),
}
}

View 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
}
}

View 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=&#39;urlSurveyMcu&#39;], [name=&#39;nomorRegistrasi&#39;]\"></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=&#39;urlSurveyMcu&#39;], [name=&#39;nomorRegistrasi&#39;]\">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
})
}

View 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 }.&nbsp;
</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
}
}

View 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(".&nbsp;\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
})
}

View 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
}
}

View 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
})
}