step 12 : refactor layout add, ketambahan alamat dan agama,
proses add fix
This commit is contained in:
@@ -94,6 +94,8 @@ templ BodyFormDoctor(
|
||||
dropdownDoctorEtnis models.CustomDropdownv1Prm,
|
||||
listItemEtnis templ.Component,
|
||||
InputNomorHP models.CustomTextFieldv2Prm,
|
||||
dropdownDoctorAgama models.CustomDropdownv1Prm,
|
||||
listItemAgama templ.Component,
|
||||
componentID string,
|
||||
hxOnLoad templ.ComponentScript) {
|
||||
<div id={ componentID } hx-on::load={ hxOnLoad }>
|
||||
@@ -162,26 +164,6 @@ templ BodyFormDoctor(
|
||||
listItemGolonganDarah)
|
||||
</div>
|
||||
<!-- golongan darah -->
|
||||
<!-- Kewarganegaraan -->
|
||||
<div class="form-row mt-0">
|
||||
@customradiobuttoninline.MainCustomRadioButtonInputV0(
|
||||
radiobuttonDoctorKewarganegaraan,
|
||||
listItemKewarganegaraan)
|
||||
</div>
|
||||
<!-- Kewarganegaraan -->
|
||||
<!-- Nomor identitas start -->
|
||||
<div class="form-row mt-8">
|
||||
@customtextfield.CustomTextFieldv2(
|
||||
InputNomorIdentitas)
|
||||
</div>
|
||||
<!-- Nomor identitas end -->
|
||||
<!-- spesialis -->
|
||||
<div class="form-row mt-0">
|
||||
@customdropdown.MainCustomDropdownInputV0(
|
||||
dropdownDoctorSpesialis,
|
||||
listItemSpesialis)
|
||||
</div>
|
||||
<!-- spesialis -->
|
||||
</div>
|
||||
<!-- col 1 end -->
|
||||
<!-- col 2 start -->
|
||||
@@ -211,25 +193,7 @@ templ BodyFormDoctor(
|
||||
</div>
|
||||
<!-- BloodRhesus end -->
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<!-- Etnis start -->
|
||||
<div class="col">
|
||||
@customdropdown.MainCustomDropdownInputV0(
|
||||
dropdownDoctorEtnis,
|
||||
listItemEtnis)
|
||||
</div>
|
||||
<!-- Etnis end -->
|
||||
</div>
|
||||
<div class="form-row mt-0">
|
||||
<!-- Nomor HP start -->
|
||||
<div class="col">
|
||||
@customtextfield.CustomTextFieldv2(
|
||||
InputNomorHP)
|
||||
</div>
|
||||
<!-- Nomor HP end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- col 2 start -->
|
||||
<!-- col 3 start -->
|
||||
<div class="col-4">
|
||||
<div class="form-row">
|
||||
@@ -273,19 +237,81 @@ templ BodyFormDoctor(
|
||||
listItemPend)
|
||||
</div>
|
||||
<!-- pendidikan -->
|
||||
<!-- Identitas -->
|
||||
</div>
|
||||
<!-- col 3 start -->
|
||||
</div>
|
||||
<!-- alamat start -->
|
||||
<div class="row mt-5"></div>
|
||||
<!-- alamat end -->
|
||||
<div class="row mt-5">
|
||||
<!-- col 1 start -->
|
||||
<div class="col-4">
|
||||
<!-- Kewarganegaraan -->
|
||||
<div class="form-row mt-0">
|
||||
@customradiobuttoninline.MainCustomRadioButtonInputV0(
|
||||
radiobuttonDoctorKewarganegaraan,
|
||||
listItemKewarganegaraan)
|
||||
</div>
|
||||
<!-- Kewarganegaraan -->
|
||||
<!-- Identitas -->
|
||||
<div class="form-row mt-8">
|
||||
@customdropdown.MainCustomDropdownInputV0(
|
||||
dropdownDoctorIdentitas,
|
||||
listItemIdentitas)
|
||||
</div>
|
||||
<!-- Identitas -->
|
||||
<!-- email -->
|
||||
<!-- spesialis -->
|
||||
<div class="form-row mt-0">
|
||||
@customtextfield.CustomTextFieldv2(
|
||||
InputEmail)
|
||||
@customdropdown.MainCustomDropdownInputV0(
|
||||
dropdownDoctorSpesialis,
|
||||
listItemSpesialis)
|
||||
</div>
|
||||
<!-- spesialis -->
|
||||
</div>
|
||||
<!-- col 1 end -->
|
||||
<!-- col 2 start -->
|
||||
<div class="col-4">
|
||||
<div class="form-row">
|
||||
<!-- Etnis start -->
|
||||
<div class="col">
|
||||
@customdropdown.MainCustomDropdownInputV0(
|
||||
dropdownDoctorEtnis,
|
||||
listItemEtnis)
|
||||
</div>
|
||||
<!-- Etnis end -->
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<!-- Nomor Identitas start -->
|
||||
<div class="col">
|
||||
@customtextfield.CustomTextFieldv2(
|
||||
InputNomorIdentitas)
|
||||
</div>
|
||||
<!-- Nomor Identitas end -->
|
||||
</div>
|
||||
<div class="form-row mt-0">
|
||||
<!-- Email start -->
|
||||
<div class="col">
|
||||
@customtextfield.CustomTextFieldv2(
|
||||
InputEmail)
|
||||
</div>
|
||||
<!-- Email end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- col 2 start -->
|
||||
<!-- col 3 start -->
|
||||
<div class="col-4">
|
||||
<div class="form-row">
|
||||
@customdropdown.MainCustomDropdownInputV0(
|
||||
dropdownDoctorAgama,
|
||||
listItemAgama)
|
||||
</div>
|
||||
<div class="form-row mt-0">
|
||||
<!-- Nomor HP start -->
|
||||
<div class="col">
|
||||
@customtextfield.CustomTextFieldv2(
|
||||
InputNomorHP)
|
||||
</div>
|
||||
<!-- Nomor HP end -->
|
||||
</div>
|
||||
<!-- email -->
|
||||
</div>
|
||||
<!-- col 3 start -->
|
||||
</div>
|
||||
|
||||
@@ -221,6 +221,8 @@ func BodyFormDoctor(
|
||||
dropdownDoctorEtnis models.CustomDropdownv1Prm,
|
||||
listItemEtnis templ.Component,
|
||||
InputNomorHP models.CustomTextFieldv2Prm,
|
||||
dropdownDoctorAgama models.CustomDropdownv1Prm,
|
||||
listItemAgama 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) {
|
||||
@@ -246,7 +248,7 @@ func BodyFormDoctor(
|
||||
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\mddoctor\mddoctorformmodal.templ`, Line: 99, Col: 22}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 101, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -328,36 +330,7 @@ func BodyFormDoctor(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- golongan darah --><!-- Kewarganegaraan --><div class=\"form-row mt-0\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customradiobuttoninline.MainCustomRadioButtonInputV0(
|
||||
radiobuttonDoctorKewarganegaraan,
|
||||
listItemKewarganegaraan).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Kewarganegaraan --><!-- Nomor identitas start --><div class=\"form-row mt-8\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(
|
||||
InputNomorIdentitas).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Nomor identitas end --><!-- spesialis --><div class=\"form-row mt-0\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customdropdown.MainCustomDropdownInputV0(
|
||||
dropdownDoctorSpesialis,
|
||||
listItemSpesialis).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- spesialis --></div><!-- col 1 end --><!-- col 2 start --><div class=\"col-4\"><div class=\"form-row\"><!-- Nama start --><div class=\"col\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- golongan darah --></div><!-- col 1 end --><!-- col 2 start --><div class=\"col-4\"><div class=\"form-row\"><!-- Nama start --><div class=\"col\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -385,26 +358,7 @@ func BodyFormDoctor(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- BloodRhesus end --></div><div class=\"form-row\"><!-- Etnis start --><div class=\"col\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customdropdown.MainCustomDropdownInputV0(
|
||||
dropdownDoctorEtnis,
|
||||
listItemEtnis).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Etnis end --></div><div class=\"form-row mt-0\"><!-- Nomor HP start --><div class=\"col\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(
|
||||
InputNomorHP).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Nomor HP end --></div></div><!-- col 2 start --><!-- col 3 start --><div class=\"col-4\"><div class=\"form-row\"><!-- Imbuhan akhir 1 start --><div class=\"col\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- BloodRhesus end --></div></div><!-- col 3 start --><div class=\"col-4\"><div class=\"form-row\"><!-- Imbuhan akhir 1 start --><div class=\"col\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -459,7 +413,17 @@ func BodyFormDoctor(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- pendidikan --><!-- Identitas --><div class=\"form-row mt-0\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- pendidikan --></div><!-- col 3 start --></div><!-- alamat start --><div class=\"row mt-5\"></div><!-- alamat end --><div class=\"row mt-5\"><!-- col 1 start --><div class=\"col-4\"><!-- Kewarganegaraan --><div class=\"form-row mt-0\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customradiobuttoninline.MainCustomRadioButtonInputV0(
|
||||
radiobuttonDoctorKewarganegaraan,
|
||||
listItemKewarganegaraan).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Kewarganegaraan --><!-- Identitas --><div class=\"form-row mt-8\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -469,7 +433,36 @@ func BodyFormDoctor(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Identitas --><!-- email --><div class=\"form-row mt-0\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- spesialis --><div class=\"form-row mt-0\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customdropdown.MainCustomDropdownInputV0(
|
||||
dropdownDoctorSpesialis,
|
||||
listItemSpesialis).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- spesialis --></div><!-- col 1 end --><!-- col 2 start --><div class=\"col-4\"><div class=\"form-row\"><!-- Etnis start --><div class=\"col\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customdropdown.MainCustomDropdownInputV0(
|
||||
dropdownDoctorEtnis,
|
||||
listItemEtnis).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Etnis end --></div><div class=\"form-row\"><!-- Nomor Identitas start --><div class=\"col\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(
|
||||
InputNomorIdentitas).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Nomor Identitas end --></div><div class=\"form-row mt-0\"><!-- Email start --><div class=\"col\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -478,7 +471,26 @@ func BodyFormDoctor(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- email --></div><!-- col 3 start --></div></div></div><script>\r\n\r\n\tfunction formatDate(todayInput, birthdateValue)\r\n\t{\r\n\t\tvar today = new Date(todayInput);\r\n\t\t\t\t\r\n\t\tvar years = today.getFullYear() - birthdateValue.getFullYear();\r\n\t\tvar months = today.getMonth() - birthdateValue.getMonth();\r\n\t\tvar days = today.getDate() - birthdateValue.getDate();\r\n\t\t\r\n\t\tif (days < 0) {\r\n\t\t\tmonths--;\r\n\t\t\tdays += new Date(today.getFullYear(), today.getMonth(), 0).getDate();\r\n\t\t}\r\n\t\t\r\n\t\tif (months < 0) {\r\n\t\t\tyears--;\r\n\t\t\tmonths += 12;\r\n\t\t}\r\n\r\n\t\tdocument.querySelector(\"[name='doctorimbuhantahun']\").value = years + ' Tahun';\r\n\t\tdocument.querySelector(\"[name='doctorimbuhanbulan']\").value = months + ' Bulan';\r\n\t\tdocument.querySelector(\"[name='doctorimbuhanhari']\").value = days + ' Hari';\r\n\t}\r\n\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\t\tdocument.getElementById('doctorimbuhantahun').setAttribute('readonly',true)\r\n\t\tdocument.getElementById('doctorimbuhanbulan').setAttribute('readonly',true)\r\n\t\tdocument.getElementById('doctorimbuhanhari').setAttribute('readonly',true)\r\n\r\n\t\t// onchange date picker\r\n\t\tvar birthdateInput = document.querySelector(\"#doctorimbuhantanggallahir\");\r\n \tvar invalidFeedback = birthdateInput.closest(\".form-group\").querySelector(\".invalid-feedback\");\r\n\r\n \tvar birthdateValue = birthdateInput.value;\r\n\r\n\t\tvar todayInput = document.querySelector(\"#doctortglnow\");\r\n\t\r\n\t\tbirthdateInput.addEventListener('change', function() {\r\n\t\t\tvar birthdateValue = new Date(birthdateInput.value);\r\n\t\t\tif (!isNaN(birthdateValue)) {\r\n\t\t\t\tformatDate(todayInput.value, birthdateValue)\r\n\t\t\t} else{\r\n\t\t\t\tbirthdateInput.classList.add('is-invalid');\r\n\t\t\t\tinvalidFeedback.textContent = 'Tanggal lahir tidak valid.';\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tvar birthdateNowEdit = document.querySelector(\"#doctortgllahiredit\");\r\n\t\tif (birthdateNowEdit.value.trim() !== \"\") {\r\n\t\t\tbirthdateInput.value = birthdateNowEdit.value\r\n\t\t\tformatDate(todayInput.value, new Date(birthdateInput.value))\r\n\t\t}\r\n });\r\n\r\n\tdocument.addEventListener('DOMContentLoaded', function() {\r\n\t\tdocument.getElementById('doctorimbuhantahun').setAttribute('readonly',true)\r\n\t\tdocument.getElementById('doctorimbuhanbulan').setAttribute('readonly',true)\r\n\t\tdocument.getElementById('doctorimbuhanhari').setAttribute('readonly',true)\r\n\r\n\t\t// onchange date picker\r\n\t\tvar birthdateInput = document.querySelector(\"#doctorimbuhantanggallahir\");\r\n \tvar invalidFeedback = birthdateInput.closest(\".form-group\").querySelector(\".invalid-feedback\");\r\n\r\n \tvar birthdateValue = birthdateInput.value;\r\n\r\n\t\tvar todayInput = document.querySelector(\"#doctortglnow\");\r\n\t\r\n\t\tbirthdateInput.addEventListener('change', function() {\r\n\t\t\tvar birthdateValue = new Date(birthdateInput.value);\r\n\t\t\tif (!isNaN(birthdateValue)) {\r\n\t\t\t\tformatDate(todayInput.value, birthdateValue)\r\n\t\t\t} else{\r\n\t\t\t\tbirthdateInput.classList.add('is-invalid');\r\n\t\t\t\tinvalidFeedback.textContent = 'Tanggal lahir tidak valid.';\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tvar birthdateNowEdit = document.querySelector(\"#doctortgllahiredit\");\r\n\t\tif (birthdateNowEdit.value.trim() !== \"\") {\r\n\t\t\tbirthdateInput.value = birthdateNowEdit.value\r\n\t\t\tformatDate(todayInput.value, new Date(birthdateInput.value))\r\n\t\t}\r\n\t});\r\n </script>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Email end --></div></div><!-- col 2 start --><!-- col 3 start --><div class=\"col-4\"><div class=\"form-row\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customdropdown.MainCustomDropdownInputV0(
|
||||
dropdownDoctorAgama,
|
||||
listItemAgama).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"form-row mt-0\"><!-- Nomor HP start --><div class=\"col\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(
|
||||
InputNomorHP).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Nomor HP end --></div></div><!-- col 3 start --></div></div></div><script>\r\n\r\n\tfunction formatDate(todayInput, birthdateValue)\r\n\t{\r\n\t\tvar today = new Date(todayInput);\r\n\t\t\t\t\r\n\t\tvar years = today.getFullYear() - birthdateValue.getFullYear();\r\n\t\tvar months = today.getMonth() - birthdateValue.getMonth();\r\n\t\tvar days = today.getDate() - birthdateValue.getDate();\r\n\t\t\r\n\t\tif (days < 0) {\r\n\t\t\tmonths--;\r\n\t\t\tdays += new Date(today.getFullYear(), today.getMonth(), 0).getDate();\r\n\t\t}\r\n\t\t\r\n\t\tif (months < 0) {\r\n\t\t\tyears--;\r\n\t\t\tmonths += 12;\r\n\t\t}\r\n\r\n\t\tdocument.querySelector(\"[name='doctorimbuhantahun']\").value = years + ' Tahun';\r\n\t\tdocument.querySelector(\"[name='doctorimbuhanbulan']\").value = months + ' Bulan';\r\n\t\tdocument.querySelector(\"[name='doctorimbuhanhari']\").value = days + ' Hari';\r\n\t}\r\n\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\t\tdocument.getElementById('doctorimbuhantahun').setAttribute('readonly',true)\r\n\t\tdocument.getElementById('doctorimbuhanbulan').setAttribute('readonly',true)\r\n\t\tdocument.getElementById('doctorimbuhanhari').setAttribute('readonly',true)\r\n\r\n\t\t// onchange date picker\r\n\t\tvar birthdateInput = document.querySelector(\"#doctorimbuhantanggallahir\");\r\n \tvar invalidFeedback = birthdateInput.closest(\".form-group\").querySelector(\".invalid-feedback\");\r\n\r\n \tvar birthdateValue = birthdateInput.value;\r\n\r\n\t\tvar todayInput = document.querySelector(\"#doctortglnow\");\r\n\t\r\n\t\tbirthdateInput.addEventListener('change', function() {\r\n\t\t\tvar birthdateValue = new Date(birthdateInput.value);\r\n\t\t\tif (!isNaN(birthdateValue)) {\r\n\t\t\t\tformatDate(todayInput.value, birthdateValue)\r\n\t\t\t} else{\r\n\t\t\t\tbirthdateInput.classList.add('is-invalid');\r\n\t\t\t\tinvalidFeedback.textContent = 'Tanggal lahir tidak valid.';\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tvar birthdateNowEdit = document.querySelector(\"#doctortgllahiredit\");\r\n\t\tif (birthdateNowEdit.value.trim() !== \"\") {\r\n\t\t\tbirthdateInput.value = birthdateNowEdit.value\r\n\t\t\tformatDate(todayInput.value, new Date(birthdateInput.value))\r\n\t\t}\r\n });\r\n\r\n\tdocument.addEventListener('DOMContentLoaded', function() {\r\n\t\tdocument.getElementById('doctorimbuhantahun').setAttribute('readonly',true)\r\n\t\tdocument.getElementById('doctorimbuhanbulan').setAttribute('readonly',true)\r\n\t\tdocument.getElementById('doctorimbuhanhari').setAttribute('readonly',true)\r\n\r\n\t\t// onchange date picker\r\n\t\tvar birthdateInput = document.querySelector(\"#doctorimbuhantanggallahir\");\r\n \tvar invalidFeedback = birthdateInput.closest(\".form-group\").querySelector(\".invalid-feedback\");\r\n\r\n \tvar birthdateValue = birthdateInput.value;\r\n\r\n\t\tvar todayInput = document.querySelector(\"#doctortglnow\");\r\n\t\r\n\t\tbirthdateInput.addEventListener('change', function() {\r\n\t\t\tvar birthdateValue = new Date(birthdateInput.value);\r\n\t\t\tif (!isNaN(birthdateValue)) {\r\n\t\t\t\tformatDate(todayInput.value, birthdateValue)\r\n\t\t\t} else{\r\n\t\t\t\tbirthdateInput.classList.add('is-invalid');\r\n\t\t\t\tinvalidFeedback.textContent = 'Tanggal lahir tidak valid.';\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\tvar birthdateNowEdit = document.querySelector(\"#doctortgllahiredit\");\r\n\t\tif (birthdateNowEdit.value.trim() !== \"\") {\r\n\t\t\tbirthdateInput.value = birthdateNowEdit.value\r\n\t\t\tformatDate(todayInput.value, new Date(birthdateInput.value))\r\n\t\t}\r\n\t});\r\n </script>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -558,7 +570,7 @@ func ActionFormDoctor(LinkClose string, targetClose string, hxSwapClose string,
|
||||
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\mddoctor\mddoctorformmodal.templ`, Line: 408, Col: 22}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 434, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -571,7 +583,7 @@ func ActionFormDoctor(LinkClose string, targetClose string, hxSwapClose string,
|
||||
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\mddoctor\mddoctorformmodal.templ`, Line: 409, Col: 26}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 435, Col: 26}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -584,7 +596,7 @@ func ActionFormDoctor(LinkClose string, targetClose string, hxSwapClose string,
|
||||
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\mddoctor\mddoctorformmodal.templ`, Line: 410, Col: 24}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 436, Col: 24}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -625,7 +637,7 @@ func BtnCloseFormDoctor(LinkClose string, targetClose string, hxSwapClose string
|
||||
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\mddoctor\mddoctorformmodal.templ`, Line: 431, Col: 21}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 457, Col: 21}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -638,7 +650,7 @@ func BtnCloseFormDoctor(LinkClose string, targetClose string, hxSwapClose string
|
||||
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\mddoctor\mddoctorformmodal.templ`, Line: 432, Col: 25}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 458, Col: 25}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -651,7 +663,7 @@ func BtnCloseFormDoctor(LinkClose string, targetClose string, hxSwapClose string
|
||||
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\mddoctor\mddoctorformmodal.templ`, Line: 433, Col: 23}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 459, Col: 23}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -706,7 +718,7 @@ func DeleteConfirmationBodyDoctor(inputId models.CustomTextFieldv2Prm,
|
||||
var templ_7745c5c3_Var23 string
|
||||
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 450, Col: 22}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 476, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -728,7 +740,7 @@ func DeleteConfirmationBodyDoctor(inputId models.CustomTextFieldv2Prm,
|
||||
var templ_7745c5c3_Var25 string
|
||||
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(message)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 451, Col: 14}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 477, Col: 14}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -746,7 +758,7 @@ func DeleteConfirmationBodyDoctor(inputId models.CustomTextFieldv2Prm,
|
||||
var templ_7745c5c3_Var26 string
|
||||
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(v)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 456, Col: 68}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 482, Col: 68}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -769,7 +781,7 @@ func DeleteConfirmationBodyDoctor(inputId models.CustomTextFieldv2Prm,
|
||||
var templ_7745c5c3_Var27 string
|
||||
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(v)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 462, Col: 10}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 488, Col: 10}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -836,7 +848,7 @@ func ActionFormDoctorDelete(LinkClose string, targetClose string, hxSwapClose st
|
||||
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\mddoctor\mddoctorformmodal.templ`, Line: 476, Col: 22}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 502, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -849,7 +861,7 @@ func ActionFormDoctorDelete(LinkClose string, targetClose string, hxSwapClose st
|
||||
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\mddoctor\mddoctorformmodal.templ`, Line: 477, Col: 26}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 503, Col: 26}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -862,7 +874,7 @@ func ActionFormDoctorDelete(LinkClose string, targetClose string, hxSwapClose st
|
||||
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\mddoctor\mddoctorformmodal.templ`, Line: 478, Col: 24}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mddoctor\mddoctorformmodal.templ`, Line: 504, Col: 24}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
||||
Reference in New Issue
Block a user