Compare commits
5 Commits
release/de
...
groupresul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
875bf744ce | ||
|
|
29220fa451 | ||
|
|
c3dc529747 | ||
|
|
dd29b169ae | ||
|
|
98f698821c |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,4 +4,3 @@ config.yaml
|
||||
restapi.rest
|
||||
cpone.db
|
||||
coba.Http
|
||||
.vscode/
|
||||
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"liveServer.settings.port": 5501
|
||||
}
|
||||
10
README.md
10
README.md
@@ -56,12 +56,4 @@ $ templ generate --watch
|
||||
### Happy coding 😀!!
|
||||
|
||||
# LINK ODOO DAN TUTORIAL INIT
|
||||
http://odoo.sismedika.com/web#id=6282&cids=1&menu_id=225&action=342&active_id=3&model=project.task&view_type=form
|
||||
|
||||
|
||||
## BUILD WEB LINUX
|
||||
Run di Bash command line
|
||||
|
||||
```
|
||||
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ./bin/main ./cmd/main.go
|
||||
```
|
||||
http://odoo.sismedika.com/web#id=6282&cids=1&menu_id=225&action=342&active_id=3&model=project.task&view_type=form
|
||||
@@ -294,56 +294,6 @@ a.text-white:focus {
|
||||
-webkit-box-shadow: 0 0 0 0.2rem rgba(84, 168, 255, 0.5);
|
||||
box-shadow: 0 0 0 0.2rem rgba(84, 168, 255, 0.5);
|
||||
}
|
||||
|
||||
.btn-field {
|
||||
color: var(--text-black);
|
||||
background-color: var(--fieldbg) !important;
|
||||
border-color: var(--fieldbg) !important;
|
||||
}
|
||||
.btn-field.btn-lg {
|
||||
padding: 0.825rem 1.42rem !important;
|
||||
font-size: 1.08rem !important;
|
||||
line-height: 1.5 !important;
|
||||
border-radius: 0.42rem !important;
|
||||
}
|
||||
.btn-field.btn-lg.rounded-lg {
|
||||
padding: 0.825rem 1.42rem !important;
|
||||
font-size: 1.08rem !important;
|
||||
line-height: 1.5 !important;
|
||||
border-radius: 0.85rem !important;
|
||||
}
|
||||
.btn-field:hover {
|
||||
color: var(--text-black);
|
||||
background-color: var(--fieldbg) !important;
|
||||
border-color: var(--fieldbg) !important;
|
||||
}
|
||||
.btn-field:focus,
|
||||
.btn-field.focus {
|
||||
color: var(--text-black);
|
||||
background-color: var(--fieldbg) !important;
|
||||
border-color: var(--fieldbg) !important;
|
||||
-webkit-box-shadow: 0 0 0 0rem var(--fieldbg) !important;
|
||||
box-shadow: 0 0 0 0rem var(--fieldbg) !important;
|
||||
}
|
||||
.btn-field.disabled,
|
||||
.btn-field:disabled {
|
||||
color: var(--text-black);
|
||||
background-color: var(--fieldbg) !important;
|
||||
border-color: var(--fieldbg) !important;
|
||||
}
|
||||
.btn-field:not(:disabled):not(.disabled):active,
|
||||
.btn-field:not(:disabled):not(.disabled).active,
|
||||
.show > .btn-field.dropdown-toggle {
|
||||
color: var(--text-black);
|
||||
background-color: var(--fieldbg) !important;
|
||||
border-color: var(--fieldbg) !important;
|
||||
}
|
||||
.btn-field:not(:disabled):not(.disabled):active:focus,
|
||||
.btn-field:not(:disabled):not(.disabled).active:focus,
|
||||
.show > .btn-field.dropdown-toggle:focus {
|
||||
-webkit-box-shadow: 0 0 0 0rem var(--fieldbg) !important;
|
||||
box-shadow: 0 0 0 0rem var(--fieldbg) !important;
|
||||
}
|
||||
/* COBA CUSTOM BTN */
|
||||
.btn-tosca {
|
||||
color: #ffffff;
|
||||
@@ -5276,12 +5226,6 @@ a.text-hover-tosca:hover .svg-icon svg:hover g [fill],
|
||||
border-radius: 0.42rem;
|
||||
}
|
||||
|
||||
/* ### CUSTOM CSS SELECTPICKER */
|
||||
.btn-custom-selectpicker{
|
||||
height: 8vh;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* ### OVERLAY */
|
||||
.overlay-loading {
|
||||
position: relative !important;
|
||||
|
||||
@@ -54,17 +54,17 @@ var KTLogin = function () {
|
||||
|
||||
validation.validate().then(function (status) {
|
||||
if (status == 'Valid') {
|
||||
// swal.fire({
|
||||
// text: "All is cool! Now you submit this form",
|
||||
// icon: "success",
|
||||
// buttonsStyling: false,
|
||||
// confirmButtonText: "Ok, got it!",
|
||||
// customClass: {
|
||||
// confirmButton: "btn font-weight-bold btn-light-primary"
|
||||
// }
|
||||
// }).then(function () {
|
||||
// KTUtil.scrollTop();
|
||||
// });
|
||||
swal.fire({
|
||||
text: "All is cool! Now you submit this form",
|
||||
icon: "success",
|
||||
buttonsStyling: false,
|
||||
confirmButtonText: "Ok, got it!",
|
||||
customClass: {
|
||||
confirmButton: "btn font-weight-bold btn-light-primary"
|
||||
}
|
||||
}).then(function () {
|
||||
KTUtil.scrollTop();
|
||||
});
|
||||
} else {
|
||||
swal.fire({
|
||||
text: "Sorry, looks like there are some errors detected, please try again.",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 KiB |
File diff suppressed because it is too large
Load Diff
@@ -1,784 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Template Name: Metronic - Bootstrap 4 HTML, React, Angular 9 & VueJS Admin Dashboard Theme
|
||||
Author: KeenThemes
|
||||
Website: http://www.keenthemes.com/
|
||||
Contact: support@keenthemes.com
|
||||
Follow: www.twitter.com/keenthemes
|
||||
Dribbble: www.dribbble.com/keenthemes
|
||||
Like: www.facebook.com/keenthemes
|
||||
Purchase: https://1.envato.market/EA4JP
|
||||
Renew Support: https://1.envato.market/EA4JP
|
||||
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
|
||||
-->
|
||||
<html lang="en">
|
||||
<!--begin::Head-->
|
||||
|
||||
<head>
|
||||
<base href="../" />
|
||||
<meta charset="utf-8" />
|
||||
<title>KESIMPULAN & SARAN</title>
|
||||
<meta name="description" content="Login page example" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||||
/>
|
||||
|
||||
<!--begin::Fonts-->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700"
|
||||
/>
|
||||
<!--end::Fonts-->
|
||||
|
||||
<!--begin::Page Custom Styles(used by this page)-->
|
||||
<link
|
||||
href="assets/css/pages/login/login-1.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!--end::Page Custom Styles-->
|
||||
|
||||
<!--begin::Global Theme Styles(used by all pages)-->
|
||||
<link
|
||||
href="assets/plugins/global/plugins.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/plugins/custom/prismjs/prismjs.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
|
||||
<!--end::Global Theme Styles-->
|
||||
|
||||
<!--begin::Layout Themes(used by all pages)-->
|
||||
|
||||
<link
|
||||
href="assets/css/themes/layout/header/base/light.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/header/menu/light.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/brand/dark.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/aside/dark.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!--end::Layout Themes-->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Public Sans:300,400,500,600,700"
|
||||
/>
|
||||
<link rel="shortcut icon" href="assets/media/logos/favicon.ico" />
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Roboto"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
|
||||
/>
|
||||
<link href="https://fonts.cdnfonts.com/css/open-sans" rel="stylesheet" />
|
||||
|
||||
<style>
|
||||
#canvas {
|
||||
/* overflow-x: scroll; */
|
||||
margin: 40px 10vw 40px 10vw;
|
||||
}
|
||||
#title {
|
||||
font-weight: 600;
|
||||
}
|
||||
.breadcrumb {
|
||||
background-color: white;
|
||||
padding: 0px 0px !important;
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
|
||||
.breadcrumb-item a {
|
||||
color: #3f4254;
|
||||
font-family: Poppins;
|
||||
font-size: 13px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: 21px;
|
||||
}
|
||||
|
||||
.breadcrumb-item.active {
|
||||
color: #b5b5c3;
|
||||
font-family: Poppins;
|
||||
font-size: 13px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: 21px;
|
||||
}
|
||||
.nav-tabs {
|
||||
border-bottom: 0px solid #000000 !important;
|
||||
}
|
||||
.nav-link {
|
||||
color: #637381;
|
||||
font-family: Public Sans;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
line-height: 22px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nav-link.active {
|
||||
color: #212b36 !important; /* Warna teks untuk tab yang aktif */
|
||||
border-bottom: 2px solid #0c518c !important; /* Garis bawah untuk tab yang aktif */
|
||||
font-family: Public Sans;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
line-height: 22px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th {
|
||||
color: #637381;
|
||||
font-family: Roboto;
|
||||
font-weight: 700 !important;
|
||||
font-size: 14px !important;
|
||||
padding-bottom: 5px !important;
|
||||
padding-left: 1px !important;
|
||||
border-bottom: 1pt dashed #e4e6ef !important;
|
||||
}
|
||||
tr {
|
||||
border-bottom: 1pt dashed #e4e6ef !important;
|
||||
font-family: Roboto;
|
||||
}
|
||||
td {
|
||||
color: #0e1e28;
|
||||
font-family: Roboto;
|
||||
font-style: normal;
|
||||
font-weight: 500 !important;
|
||||
font-size: 16px !important;
|
||||
line-height: 30px; /* 187.5% */
|
||||
letter-spacing: -0.32px;
|
||||
padding-left: 1px !important;
|
||||
padding-top: 16px !important;
|
||||
padding-bottom: 16px !important;
|
||||
}
|
||||
thead {
|
||||
border-bottom: 1pt dashed #e4e6ef !important;
|
||||
}
|
||||
.kesimpulan-desc {
|
||||
color: #0e1e28;
|
||||
font-family: Roboto;
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: normal;
|
||||
letter-spacing: -0.24px;
|
||||
}
|
||||
.label-text {
|
||||
background-color: grey;
|
||||
color: black;
|
||||
padding: 5px 20px 5px 20px !important;
|
||||
border-radius: 6px;
|
||||
font-family: Poppins !important;
|
||||
font-size: 11px !important;
|
||||
font-style: normal !important;
|
||||
font-weight: 500 !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
.label-text.fit {
|
||||
background: #c9f7f5;
|
||||
color: #1bc5bd;
|
||||
padding: 5px 20px 5px 20px !important;
|
||||
border-radius: 6px;
|
||||
font-family: Poppins !important;
|
||||
font-size: 11px !important;
|
||||
font-style: normal !important;
|
||||
font-weight: 500 !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
.label-text.unfit {
|
||||
background: #fff4de;
|
||||
color: #ffa800;
|
||||
padding: 5px 20px 5px 20px !important;
|
||||
border-radius: 6px;
|
||||
font-family: Poppins !important;
|
||||
font-size: 11px !important;
|
||||
font-style: normal !important;
|
||||
font-weight: 500 !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
|
||||
.iconify-btn {
|
||||
color: #637381 !important;
|
||||
width: 23px !important;
|
||||
height: 23px !important;
|
||||
margin-right: 1em;
|
||||
}
|
||||
.iconify-btn-blue {
|
||||
color: #0c518c !important;
|
||||
width: 23px !important;
|
||||
height: 23px !important;
|
||||
margin-right: 1em;
|
||||
}
|
||||
.modal-header {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
.modal-title {
|
||||
font-family: "Public Sans" !important;
|
||||
font-size: 18px !important;
|
||||
font-style: normal !important;
|
||||
font-weight: 700 !important;
|
||||
line-height: 28px !important;
|
||||
}
|
||||
.modal-dialog {
|
||||
border-radius: 8px;
|
||||
}
|
||||
.btn-print {
|
||||
border-radius: 6px !important;
|
||||
background-color: #f5f8fa !important;
|
||||
font-family: Roboto;
|
||||
font-size: 14px;
|
||||
margin-bottom: 12px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: normal;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.modal-xl {
|
||||
border-radius: 6px !important;
|
||||
max-width: 90vw !important;
|
||||
max-height: 95vh !important;
|
||||
width: 90vw !important;
|
||||
height: 95vh !important;
|
||||
}
|
||||
.header-print {
|
||||
background-color: #d9d9d9;
|
||||
}
|
||||
.modal-print-title {
|
||||
color: #000;
|
||||
font-family: "Open Sans";
|
||||
font-size: 28px;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
line-height: normal;
|
||||
}
|
||||
.close-print {
|
||||
color: red !important;
|
||||
width: 30px !important;
|
||||
height: 30px !important;
|
||||
}
|
||||
.form-label {
|
||||
font-family: Poppins !important;
|
||||
font-size: 14px !important;
|
||||
font-style: normal !important;
|
||||
font-weight: 600 !important;
|
||||
line-height: 24px !important; /* 171.429% */
|
||||
}
|
||||
.form-input {
|
||||
font-family: Poppins !important;
|
||||
font-size: 16px !important;
|
||||
font-style: normal !important;
|
||||
font-weight: 400 !important;
|
||||
line-height: 24px !important;
|
||||
}
|
||||
.btn-text {
|
||||
font-family: "Public Sans";
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
line-height: 24px;
|
||||
}
|
||||
.dot-text {
|
||||
position: relative;
|
||||
padding-left: 1.5em; /* Menambahkan padding untuk memberi ruang pada titik */
|
||||
}
|
||||
|
||||
.dot-text::before {
|
||||
content: "•"; /* Menambahkan titik di depan teks */
|
||||
position: absolute;
|
||||
left: 1em; /* Atur posisi titik */
|
||||
top: 0;
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
.information-title {
|
||||
color: #0e1e28;
|
||||
font-family: Poppins;
|
||||
font-size: 20px;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
line-height: normal;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<!--end::Head-->
|
||||
|
||||
<!--begin::Body-->
|
||||
|
||||
<body
|
||||
id="kt_body"
|
||||
class="header-fixed bg-white header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading"
|
||||
>
|
||||
<!--begin::Main-->
|
||||
<div class="d-flex flex-column flex-root bg-white" id="canvas">
|
||||
<div>
|
||||
<!-- breadcrumb & icon tanya START -->
|
||||
<div class="row">
|
||||
<div class="col-11">
|
||||
<h1 class="title" 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>
|
||||
|
||||
<div class="col-1 align-content-center">
|
||||
<!-- align-content-center -->
|
||||
<div class="d-flex justify-content-end">
|
||||
<a href="#">
|
||||
<i class="fas fa-info-circle text-primary"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- breadcrumb & icon tanya END -->
|
||||
</div>
|
||||
<div class="mt-10">
|
||||
<ul class="nav nav-tabs nav-tabs-line">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_1"
|
||||
>Peserta</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_2"
|
||||
>Kelainan global</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_3"
|
||||
>Kelainan Lab</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_4"
|
||||
>kelainan Non Lab</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_5"
|
||||
>kelainan Fisik</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#kt_tab_pane_6"
|
||||
>Kesimpulan & Saran</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_7"
|
||||
>Daftar Peserta</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center pt-10 pb-10">
|
||||
<h2 class="title" style="margin-bottom: 0">Kesimpulan</h2>
|
||||
</div>
|
||||
|
||||
<!-- Kelainan pemeriksaan lab -->
|
||||
<div class="card card-custom gutter-b" style="border-radius: 20px">
|
||||
<div style="padding-top: 12px">
|
||||
<h3 class="card-label dot-text text-black">
|
||||
3 Kelainan Pemeriksaan Lab terbesar :
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<table class="table table-hover table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" width="5%">NO</th>
|
||||
<th scope="col" width="70%">PEMERIKSAAN</th>
|
||||
<th scope="col" width="25%">PRESENTASE</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>Hipercholesterolemia</td>
|
||||
<td>44.5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>Hiperuricemia</td>
|
||||
<td>22.7</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>Peningkatan SGPT</td>
|
||||
<td>15.8</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Kelainan pemeriksaan lab -->
|
||||
|
||||
<!-- Kelainan pemeriksaan non lab -->
|
||||
<div class="card card-custom gutter-b" style="border-radius: 20px">
|
||||
<div style="padding-top: 12px">
|
||||
<h3 class="card-label dot-text text-black">
|
||||
3 Kelainan Pemeriksaan Non Lab terbesar :
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<table class="table table-hover table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" width="5%">NO</th>
|
||||
<th scope="col" width="70%">PEMERIKSAAN</th>
|
||||
<th scope="col" width="25%">PRESENTASE</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>Retriksi Ringan</td>
|
||||
<td>22.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>Gangguan Konduksi Ringan</td>
|
||||
<td>15.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>Obstruksi Sedang</td>
|
||||
<td>13.0</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Kelainan pemeriksaan non lab -->
|
||||
|
||||
<!-- Kelainan pemeriksaan Fisik -->
|
||||
<div class="card card-custom gutter-b" style="border-radius: 20px">
|
||||
<div style="padding-top: 12px">
|
||||
<h3 class="card-label dot-text text-black">
|
||||
3 Kelainan Pemeriksaan Fisik terbesar :
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<table class="table table-hover table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" width="5%">NO</th>
|
||||
<th scope="col" width="70%">PEMERIKSAAN</th>
|
||||
<th scope="col" width="25%">PRESENTASE</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>Obesitas Stage 1</td>
|
||||
<td>41.7</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>Pre Hipertensi</td>
|
||||
<td>39.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>Kelainan Refraksi</td>
|
||||
<td>35.2</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Kelainan pemeriksaan Fisik -->
|
||||
|
||||
<!-- Saran -->
|
||||
<div class="d-flex justify-content-center pt-10 pb-10">
|
||||
<h2 class="information-title title" style="margin-bottom: 0">Saran</h2>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="information-title mb-3">Tujuan MCU</h3>
|
||||
<div>
|
||||
<div class="dot-text">Olah raga teratur</div>
|
||||
<div class="dot-text">Penurunan berat badan</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="information-title mb-3">Kelainan Refraksi</h3>
|
||||
<div>
|
||||
<div class="mb-5">
|
||||
<div>1. Kelainan refraksi dengan kacamata</div>
|
||||
<div class="dot-text">
|
||||
Konsul dokter Scpesialis Mata untuk pemakaian kacamata/ lensa
|
||||
kontak
|
||||
</div>
|
||||
</div>
|
||||
<div>2. Kelainan refraksi tanpa kacamata</div>
|
||||
<div class="dot-text">Pemakaian kacamata/ lensa kontak</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="information-title mb-3">Tekanan Darah</h3>
|
||||
<div>
|
||||
<div class="mb-5">
|
||||
<div>1. Pre Hipertensi</div>
|
||||
<div class="dot-text">Olah raga teratur</div>
|
||||
<div class="dot-text">Cukup istirahat</div>
|
||||
<div class="dot-text">Pemeriksaan tekanan darah secara teratur</div>
|
||||
</div>
|
||||
<div class="mb-5">
|
||||
<div>2. Hipertensi stage 1 dan 2</div>
|
||||
<div class="dot-text">Olah raga teratur</div>
|
||||
<div class="dot-text">Cukup istirahat</div>
|
||||
<div class="dot-text">Batasi konsumsi garam</div>
|
||||
<div class="dot-text">Pemeriksaan tekanan darah secara teratur</div>
|
||||
<div class="dot-text">
|
||||
Pengobatan/ minum obat secara teratur (bila ybs sudah minum obat,
|
||||
hipertensi tetapi kadang-kadang atau tidak rutin)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="information-title mb-3">
|
||||
Peningkatan Profil lemak dan Hiperglikemia
|
||||
</h3>
|
||||
<div>
|
||||
<div class="dot-text">Diet rendah lemak, karbohidrat dan gula,</div>
|
||||
<div class="dot-text">Olahraga secara teraturs</div>
|
||||
<div class="dot-text">
|
||||
Program promosi kesehatan terutama untuk mencegah terjadinya dampak
|
||||
serius peningkatan lemak darah
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="information-title mb-3">Hiperuricemia</h3>
|
||||
<div>
|
||||
<div class="dot-text" s>
|
||||
Mengurangi asupan makanan/sayuran yang mengandung purin (melinjo,
|
||||
kangkung, jeroan, emping, dll)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Saran -->
|
||||
</div>
|
||||
<!--end::Main-->
|
||||
<script>
|
||||
var HOST_URL =
|
||||
"https://preview.keenthemes.com/metronic/theme/html/tools/preview";
|
||||
</script>
|
||||
<!--begin::Global Config(global config for global JS scripts)-->
|
||||
<script>
|
||||
var KTAppSettings = {
|
||||
breakpoints: {
|
||||
sm: 576,
|
||||
md: 768,
|
||||
lg: 992,
|
||||
xl: 1200,
|
||||
xxl: 1400,
|
||||
},
|
||||
colors: {
|
||||
theme: {
|
||||
base: {
|
||||
white: "#ffffff",
|
||||
primary: "#3699FF",
|
||||
secondary: "#E5EAEE",
|
||||
success: "#1BC5BD",
|
||||
info: "#8950FC",
|
||||
warning: "#FFA800",
|
||||
danger: "#F64E60",
|
||||
light: "#E4E6EF",
|
||||
dark: "#181C32",
|
||||
},
|
||||
light: {
|
||||
white: "#ffffff",
|
||||
primary: "#E1F0FF",
|
||||
secondary: "#EBEDF3",
|
||||
success: "#C9F7F5",
|
||||
info: "#EEE5FF",
|
||||
warning: "#FFF4DE",
|
||||
danger: "#FFE2E5",
|
||||
light: "#F3F6F9",
|
||||
dark: "#D6D6E0",
|
||||
},
|
||||
inverse: {
|
||||
white: "#ffffff",
|
||||
primary: "#ffffff",
|
||||
secondary: "#3F4254",
|
||||
success: "#ffffff",
|
||||
info: "#ffffff",
|
||||
warning: "#ffffff",
|
||||
danger: "#ffffff",
|
||||
light: "#464E5F",
|
||||
dark: "#ffffff",
|
||||
},
|
||||
},
|
||||
gray: {
|
||||
"gray-100": "#F3F6F9",
|
||||
"gray-200": "#EBEDF3",
|
||||
"gray-300": "#E4E6EF",
|
||||
"gray-400": "#D1D3E0",
|
||||
"gray-500": "#B5B5C3",
|
||||
"gray-600": "#7E8299",
|
||||
"gray-700": "#5E6278",
|
||||
"gray-800": "#3F4254",
|
||||
"gray-900": "#181C32",
|
||||
},
|
||||
},
|
||||
"font-family": "Poppins",
|
||||
};
|
||||
</script>
|
||||
<!--end::Global Config-->
|
||||
<!--begin::Global Theme Bundle(used by all pages)-->
|
||||
<script src="assets/plugins/global/plugins.bundle.js"></script>
|
||||
<script src="assets/plugins/custom/prismjs/prismjs.bundle.js"></script>
|
||||
<script src="assets/js/scripts.bundle.js"></script>
|
||||
<!--end::Global Theme Bundle-->
|
||||
|
||||
<!--begin::Page Vendors(used by this page)-->
|
||||
<script src="assets/plugins/custom/fullcalendar/fullcalendar.bundle.js"></script>
|
||||
<!--end::Page Vendors-->
|
||||
|
||||
<!--begin::Page Scripts(used by this page)-->
|
||||
<script src="assets/js/pages/widgets.js"></script>
|
||||
<!--end::Page Scripts-->
|
||||
<!-- echartjs.min.js -->
|
||||
<script src="assets/js/echarts-js/echart.min.js"></script>
|
||||
<!-- SCRIPT -->
|
||||
<script
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/iconify/2.0.0/iconify.min.js"
|
||||
integrity="sha512-lYMiwcB608+RcqJmP93CMe7b4i9G9QK1RbixsNu4PzMRJMsqr/bUrkXUuFzCNsRUo3IXNUr5hz98lINURv5CNA=="
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"
|
||||
></script>
|
||||
<script type="text/javascript">
|
||||
$.fn.redraw = function () {
|
||||
$(this).each(function () {
|
||||
var redraw = this.offsetHeight;
|
||||
});
|
||||
};
|
||||
function ShowModal(name, nolab) {
|
||||
console.log(name + nolab);
|
||||
$("#modal-list-print-title").text(name + "-" + nolab);
|
||||
$(".modal-list-print").modal("show");
|
||||
}
|
||||
function ShowModalPrint(data, title) {
|
||||
console.log(data);
|
||||
let a =
|
||||
"https://devone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_fo_001.rptdesign&__format=pdf&username=ADMIN&PID=132061?t=1713408676799";
|
||||
let b =
|
||||
"https://devone.aplikasi.web.id/birt/run?__report=report/one/external/rpt_mt_pramita_001.rptdesign&__format=pdf&username=adminsas%20&PID=77&tm=1713317444625";
|
||||
$(".modal-print-title").text(title);
|
||||
let tag =
|
||||
'<object id="object-print" width="100%" type="application/pdf" style="height: 80vh" ></object>';
|
||||
if (data === "1") {
|
||||
// $("#object-print").attr("data", a);
|
||||
tag =
|
||||
'<object id="object-print" width="100%" data="' +
|
||||
a +
|
||||
'" type="application/pdf" style="height: 80vh" ></object>';
|
||||
} else {
|
||||
// $("#object-print").attr("data", b);
|
||||
tag =
|
||||
'<object id="object-print" width="100%" data="' +
|
||||
b +
|
||||
'" type="application/pdf" style="height: 80vh" ></object>';
|
||||
}
|
||||
$("#object-print").replaceWith(tag);
|
||||
console.log(tag);
|
||||
|
||||
$(".modal-list-print").modal("hide");
|
||||
$(".modal-print").modal("show");
|
||||
}
|
||||
function CloseModalPrint() {
|
||||
// $("#object-print").removeAttr("data");
|
||||
// $("#object-print").redraw();
|
||||
$(".modal-list-print").modal("show");
|
||||
$(".modal-print").modal("hide");
|
||||
}
|
||||
|
||||
function ShowModalAkses(email, password, checked) {
|
||||
console.log("email" + email);
|
||||
console.log("password" + password);
|
||||
console.log("checked :" + checked);
|
||||
$(".modal-akses").modal("show");
|
||||
$('input[name="email"]').val(email);
|
||||
$('input[name="password"]').val(password);
|
||||
// $("#akses").attr("checked", checked);
|
||||
// $('input[type="checkbox"]').removeAttr("checked");
|
||||
$('input[name="akses"]').removeAttr("checked");
|
||||
let appChecked =
|
||||
'<span class="switch switch-sm switch-akses "><label><input id="akses" type="checkbox" name="akses" checked/><span></span></label></span>';
|
||||
let appNotChecked =
|
||||
'<span class="switch switch-sm switch-akses "><label><input id="akses" type="checkbox" name="akses" /><span></span></label></span>';
|
||||
|
||||
if (checked === "checked") {
|
||||
// $('input[name="akses"]').attr("checked");
|
||||
// $(".form-akses-switch").append(appChecked);
|
||||
$(".switch-akses").replaceWith(appChecked);
|
||||
} else {
|
||||
// $('input[name="akses"]').removeAttr("checked");
|
||||
// $('input[name="akses"]').removeAttr("checked");
|
||||
// $(".form-akses-switch").append(appNotChecked);
|
||||
$(".switch-akses").replaceWith(appNotChecked);
|
||||
}
|
||||
if (checked !== "checked") {
|
||||
$(".switch-akses").replaceWith(appNotChecked);
|
||||
}
|
||||
// $("#akses").load(window.location.href + " #akses");
|
||||
}
|
||||
$("#akses").change(function () {
|
||||
if (this.checked) {
|
||||
$('input[name="akses"]').attr("checked", "checked");
|
||||
} else {
|
||||
$('input[name="akses"]').removeAttr("checked");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
<!--end::Body-->
|
||||
</html>
|
||||
@@ -1,511 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Template Name: Metronic - Bootstrap 4 HTML, React, Angular 9 & VueJS Admin Dashboard Theme
|
||||
Author: KeenThemes
|
||||
Website: http://www.keenthemes.com/
|
||||
Contact: support@keenthemes.com
|
||||
Follow: www.twitter.com/keenthemes
|
||||
Dribbble: www.dribbble.com/keenthemes
|
||||
Like: www.facebook.com/keenthemes
|
||||
Purchase: https://1.envato.market/EA4JP
|
||||
Renew Support: https://1.envato.market/EA4JP
|
||||
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
|
||||
-->
|
||||
<html lang="en">
|
||||
<!--begin::Head-->
|
||||
<head>
|
||||
<base href="../" />
|
||||
<meta charset="utf-8" />
|
||||
<title>Company Portal | { title }</title>
|
||||
<meta name="description" content="Company Portal" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||||
/>
|
||||
<!--begin::Fonts-->
|
||||
<link rel="stylesheet" href="assets/css/googlefont/poppins.css" />
|
||||
<!--end::Fonts-->
|
||||
<!--begin::Page Custom Styles(used by this page)-->
|
||||
<link
|
||||
href="assets/css/pages/login/login-1.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!--end::Page Custom Styles-->
|
||||
<!--begin::Global Theme Styles(used by all pages)-->
|
||||
<link
|
||||
href="assets/plugins/global/plugins.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/plugins/custom/prismjs/prismjs.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
|
||||
<!--end::Global Theme Styles-->
|
||||
<!--begin::Layout Themes(used by all pages)-->
|
||||
<link
|
||||
href="assets/css/themes/layout/header/base/light.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/header/menu/light.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/brand/dark.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/aside/dark.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!--end::Layout Themes-->
|
||||
<link
|
||||
rel="shortcut icon"
|
||||
href="asset-corporate-portal/media/logo/logo-small.jpg"
|
||||
/>
|
||||
<!--end::Layout Themes SAS-->
|
||||
<link
|
||||
href="asset-corporate-portal/css/sas.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/css/bootstrap-select.min.css"
|
||||
/>
|
||||
|
||||
<style>
|
||||
.filter-option-inner-inner {
|
||||
margin-top: 1.2vh;
|
||||
color: var(--text-disabled);
|
||||
}
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn {
|
||||
color: var(--text-disabled);
|
||||
}
|
||||
|
||||
.bootstrap-select.btn-group .dropdown-menu {
|
||||
min-width: 100%;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
position: sticky;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
transform: translate3d(0px, 0px, 0px) !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<!--end::Head-->
|
||||
<!--begin::Body-->
|
||||
<body
|
||||
id="kt_body"
|
||||
class="bg-white header-fixed header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading"
|
||||
>
|
||||
<!--begin::Main-->
|
||||
|
||||
<div class="wrapperx p-5 h-100">
|
||||
<!-- person.png start -->
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<img
|
||||
src="asset-corporate-portal/media/person/person.png"
|
||||
style="display: block; width: 13vw"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-5">
|
||||
<div class="col-4">
|
||||
<button
|
||||
class="btn bg-primary-transparent text-center text-primary"
|
||||
style="width: 13vw; font-weight: 600"
|
||||
>
|
||||
Update Foto
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- person.png end -->
|
||||
|
||||
<div class="row mt-5">
|
||||
<!-- col 1 start -->
|
||||
<div class="col-4">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Sapaan</label
|
||||
>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-size="4"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
>
|
||||
<option value="default">Pilih Sapaan</option>
|
||||
<option value="mr">Tuan</option>
|
||||
<option value="mrs">Nyonya</option>
|
||||
<option value="ms">Nona</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Imbuhan Awal 1</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Imbuhan Awal 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Imbuhan Awal 2</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Imbuhan Awal 2"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- jenis kelamin -->
|
||||
<div class="form-row mt-5">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Jenis Kelamin</label
|
||||
>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-size="4"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
>
|
||||
<option value="default">Pilih Jenis Kelamin</option>
|
||||
<option value="mr">Tuan</option>
|
||||
<option value="mrs">Nyonya</option>
|
||||
<option value="ms">Nona</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- jenis kelamin -->
|
||||
<!-- gol darah -->
|
||||
<div class="form-row mt-5">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Golongan Darah</label
|
||||
>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-size="4"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
>
|
||||
<option value="default">Pilih Golongan Darah</option>
|
||||
<option value="mr">Tuan</option>
|
||||
<option value="mrs">Nyonya</option>
|
||||
<option value="ms">Nona</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- gol darah -->
|
||||
<!-- kewarganegaraan -->
|
||||
<div class="form-row mt-5">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Kewarganegaraan</label
|
||||
>
|
||||
<div class="form-control border-0 h-auto p-0 mt-3">
|
||||
<div class="form-group">
|
||||
<div style="display: flex; gap: 20px">
|
||||
<label style="display: flex; align-items: center; gap: 5px">
|
||||
<input type="radio" name="nationality" value="wni" />
|
||||
<p style="margin: 0">WNI</p>
|
||||
</label>
|
||||
<label style="display: flex; align-items: center; gap: 5px">
|
||||
<input type="radio" name="nationality" value="wna" />
|
||||
<p style="margin: 0">WNA</p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- kewarganegaraan -->
|
||||
|
||||
<!-- identitas -->
|
||||
<div class="form-row mt-5">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Imbuhan Awal 1</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Imbuhan Awal 1"
|
||||
/>
|
||||
</div>
|
||||
<!-- identitas -->
|
||||
</div>
|
||||
<!-- col 1 end -->
|
||||
<!-- col 2 start -->
|
||||
<div class="col-4">
|
||||
<!-- nama -->
|
||||
<div class="form-row">
|
||||
<label style="font-family: Poppins; font-weight: 600">Nama</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Input 3"
|
||||
/>
|
||||
</div>
|
||||
<!-- nama -->
|
||||
<!-- tanggal lahir -->
|
||||
<div class="form-row mt-5">
|
||||
<label style="font-family: Poppins; font-weight: 600"
|
||||
>Tanggal Lahir</label
|
||||
>
|
||||
<div class="input-group date bg-field border-0 rounded-lg">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
readonly
|
||||
placeholder="Pilih Tanggal"
|
||||
id="datepicker"
|
||||
/>
|
||||
<div class="input-group-prepend">
|
||||
<span
|
||||
class="input-group-text bg-field border-0 rounded-lg"
|
||||
id="calendar-icon"
|
||||
>
|
||||
<span
|
||||
class="iconify text-grey"
|
||||
data-icon="heroicons-solid:calendar"
|
||||
style="font-size: 20px"
|
||||
></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- tanggal lahir -->
|
||||
<!-- rhesus -->
|
||||
<div class="form-row mt-5">
|
||||
<label style="font-family: Poppins; font-weight: 600">Rhesus</label>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-size="5"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
>
|
||||
<option value="default">Pilih Rhesus</option>
|
||||
<option value="mr">Tuan</option>
|
||||
<option value="mrs">Nyonya</option>
|
||||
<option value="ms">Nona</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- rhesus -->
|
||||
<!-- etnis -->
|
||||
<div class="form-row mt-5">
|
||||
<label style="font-family: Poppins; font-weight: 600">Etnis</label>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-size="4"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
>
|
||||
<option value="default">Pilih Etnis</option>
|
||||
<option value="mr">Tuan</option>
|
||||
<option value="mrs">Nyonya</option>
|
||||
<option value="ms">Nona</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- etnis -->
|
||||
|
||||
<!-- no hp -->
|
||||
<div class="form-row mt-6">
|
||||
<div class="col">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Nomor HP</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Nomor HP"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- no hp -->
|
||||
</div>
|
||||
<!-- col 2 end -->
|
||||
<!-- col 3 start -->
|
||||
<div class="col-4">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Imbuhan Akhir 1</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Imbuhan Akhir 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Imbuhan Akhir 2</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Imbuhan Akhir 2"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- umur -->
|
||||
<div class="form-row mt-5">
|
||||
<div class="col">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Umur</label
|
||||
>
|
||||
<input
|
||||
type="number"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Tahun"
|
||||
/>
|
||||
</div>
|
||||
<div class="col mt-8">
|
||||
<input
|
||||
type="number"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Bulan"
|
||||
/>
|
||||
</div>
|
||||
<div class="col mt-8">
|
||||
<input
|
||||
type="number"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Hari"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- umur -->
|
||||
|
||||
<!-- pendidikan terakhir -->
|
||||
<div class="form-row mt-5">
|
||||
<div class="col">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Pendidikan Terakhir</label
|
||||
>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-size="4"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
>
|
||||
<option value="default">Pilih Pendidikan</option>
|
||||
<option value="mr">Tuan</option>
|
||||
<option value="mrs">Nyonya</option>
|
||||
<option value="ms">Nona</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- pendidikan terakhir -->
|
||||
|
||||
<!-- identitas pilihan -->
|
||||
<div class="form-row mt-5">
|
||||
<div class="col">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Identitas</label
|
||||
>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
data-size="4"
|
||||
>
|
||||
<option value="default">Pilih Identitas</option>
|
||||
<option value="mr">Tuan</option>
|
||||
<option value="mrs">Nyonya</option>
|
||||
<option value="ms">Nona</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- identitas pilihan -->
|
||||
|
||||
<!-- email -->
|
||||
<div class="form-row mt-6">
|
||||
<div class="col">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Email</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Email"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- email -->
|
||||
</div>
|
||||
<!-- col 3 end -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--end::Main-->
|
||||
<script src="asset-corporate-portal/js/ktappsetting.js"></script>
|
||||
<!-- iconify -->
|
||||
<script src="assets/js/iconify/iconify.min.js"></script>
|
||||
<!--end::Global Config-->
|
||||
<!--begin::Global Theme Bundle(used by all pages)-->
|
||||
<script src="assets/plugins/global/plugins.bundle.js"></script>
|
||||
<script src="assets/plugins/custom/prismjs/prismjs.bundle.js"></script>
|
||||
<script src="assets/js/scripts.bundle.js"></script>
|
||||
<script src="assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js"></script>
|
||||
|
||||
<script>
|
||||
function ShowLoading() {
|
||||
document
|
||||
.getElementById("demo")
|
||||
.setAttribute("style", "display:block !important;");
|
||||
document
|
||||
.getElementById("a")
|
||||
.setAttribute("style", "display:none !important;");
|
||||
}
|
||||
function ShowForm() {
|
||||
document
|
||||
.getElementById("demo")
|
||||
.setAttribute("style", "display:none !important;");
|
||||
document
|
||||
.getElementById("a")
|
||||
.setAttribute("style", "display:block !important;;");
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
// $(".selectpicker").selectpicker();
|
||||
$(".selectpicker").selectpicker({
|
||||
dropupAuto: false,
|
||||
});
|
||||
$("#datepicker").datepicker({
|
||||
format: "dd/mm/yyyy",
|
||||
});
|
||||
$("#calendar-icon").click(function () {
|
||||
$("#datepicker").datepicker("show");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!--end::Global Theme Bundle-->
|
||||
|
||||
<!--end::Page Scripts-->
|
||||
</body>
|
||||
<!--end::Body-->
|
||||
</html>
|
||||
@@ -1,273 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--begin::Head-->
|
||||
<head>
|
||||
<base href="../" />
|
||||
<meta charset="utf-8" />
|
||||
<title>Company Portal | { title }</title>
|
||||
<meta name="description" content="Company Portal" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||||
/>
|
||||
<!--begin::Fonts-->
|
||||
<link rel="stylesheet" href="assets/css/googlefont/poppins.css" />
|
||||
<!--end::Fonts-->
|
||||
<!--begin::Page Custom Styles(used by this page)-->
|
||||
<link
|
||||
href="assets/css/pages/login/login-1.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!--end::Page Custom Styles-->
|
||||
<!--begin::Global Theme Styles(used by all pages)-->
|
||||
<link
|
||||
href="assets/plugins/global/plugins.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/plugins/custom/prismjs/prismjs.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
|
||||
<!--end::Global Theme Styles-->
|
||||
<!--begin::Layout Themes(used by all pages)-->
|
||||
<link
|
||||
href="assets/css/themes/layout/header/base/light.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/header/menu/light.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/brand/dark.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/aside/dark.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!--end::Layout Themes-->
|
||||
<link
|
||||
rel="shortcut icon"
|
||||
href="asset-corporate-portal/media/logo/logo-small.jpg"
|
||||
/>
|
||||
<!--end::Layout Themes SAS-->
|
||||
<link
|
||||
href="asset-corporate-portal/css/sas.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/css/bootstrap-select.min.css"
|
||||
/>
|
||||
|
||||
<style>
|
||||
.filter-option-inner-inner {
|
||||
margin-top: 1.2vh;
|
||||
color: var(--text-disabled);
|
||||
}
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn {
|
||||
color: var(--text-disabled);
|
||||
}
|
||||
|
||||
.bootstrap-select.btn-group .dropdown-menu {
|
||||
min-width: 100%;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
position: sticky;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
transform: translate3d(0px, 0px, 0px) !important;
|
||||
}
|
||||
|
||||
/* mik */
|
||||
.input-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.input-label {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
transform: translateY(-50%);
|
||||
pointer-events: none;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.input-field:not(:placeholder-shown) + .input-label {
|
||||
top: 50%;
|
||||
font-size: 12px;
|
||||
color: var(--secondary-hover);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<!--end::Head-->
|
||||
<!--begin::Body-->
|
||||
<body
|
||||
id="kt_body"
|
||||
class="bg-white header-fixed header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading"
|
||||
>
|
||||
<!--begin::Main-->
|
||||
|
||||
<div class="wrapperx p-5 h-100">
|
||||
|
||||
<!--begin::Row 1-->
|
||||
<div class="form-row">
|
||||
<div class="col-3">
|
||||
<div class="container px-15">
|
||||
<div
|
||||
class="d-flex flex-column bg-primary-transparent rounded p-4 m-2 shadow"
|
||||
>
|
||||
<h4>Orders</h4>
|
||||
<h1 class="font-weight-bolder ml-auto">120.000.000</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="container px-15">
|
||||
<div
|
||||
class="d-flex flex-column bg-warning-transparent rounded p-4 m-2 shadow"
|
||||
>
|
||||
<h4>Tagihan</h4>
|
||||
<h1 class="font-weight-bolder ml-auto">85.000.000</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="container px-15">
|
||||
<div
|
||||
class="d-flex flex-column bg-success-transparent rounded p-4 m-2 shadow"
|
||||
>
|
||||
<h4>Pelunasan</h4>
|
||||
<h1 class="font-weight-bolder ml-auto">55.000.000</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="container px-15">
|
||||
<div
|
||||
class="d-flex flex-column bg-danger-transparent rounded p-4 m-2 shadow"
|
||||
>
|
||||
<h4>Hutang</h4>
|
||||
<h1 class="font-weight-bolder ml-auto">55.000.000</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Row 1-->
|
||||
</div>
|
||||
<!-- begin::Row 2 -->
|
||||
<div class="form-row mt-15">
|
||||
<div class="col">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr >
|
||||
<th scope="col" class="text-center text-black col-5" colspan="3">Tagihan</th>
|
||||
<th scope="col" class="text-center text-black col-4" colspan="2">Pelunasan</th>
|
||||
<th scope="col" class="text-center text-black col-3" rowspan="2">
|
||||
<div class="d-flex justify-content-center align-items-center h-100">
|
||||
<h3>Sisa</h3>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="col" class="text-center text-black">No/Tgl</th>
|
||||
<th scope="col" class="text-center text-black">Tgl Jatuh Tempo</th>
|
||||
<th scope="col" class="text-center text-black">Jumlah</th>
|
||||
<th scope="col" class="text-center text-black">No/Tgl</th>
|
||||
<th scope="col" class="text-center text-black">Jumlah</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center" rowspan="2">T/103/200/XYZ 20 MARET 2024</td>
|
||||
<td class="text-center" rowspan="2">20 MARET 2024</td>
|
||||
<td class="text-center" rowspan="2">20.000.000</td>
|
||||
<td class="text-center">T/103/200/XYZ 20 MARET 2024</td>
|
||||
<td class="text-center">10.000.000</td>
|
||||
<td class="text-center" rowspan="2">5.000.000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center">T/103/200/XYZ 20 MARET 2024</td>
|
||||
<td class="text-center">5.000.000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center" rowspan="2">T/103/200/XYZ 20 MARET 2024</td>
|
||||
<td class="text-center" rowspan="2">20 MARET 2024</td>
|
||||
<td class="text-center" rowspan="2">20.000.000</td>
|
||||
<td class="text-center">T/103/200/XYZ 20 MARET 2024</td>
|
||||
<td class="text-center">10.000.000</td>
|
||||
<td class="text-center" rowspan="2">5.000.000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center">T/103/200/XYZ 20 MARET 2024</td>
|
||||
<td class="text-center">5.000.000</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end::Row 2 -->
|
||||
|
||||
|
||||
|
||||
|
||||
<!--end::Main-->
|
||||
<script src="asset-corporate-portal/js/ktappsetting.js"></script>
|
||||
<!-- iconify -->
|
||||
<script src="assets/js/iconify/iconify.min.js"></script>
|
||||
<!--end::Global Config-->
|
||||
<!--begin::Global Theme Bundle(used by all pages)-->
|
||||
<script src="assets/plugins/global/plugins.bundle.js"></script>
|
||||
<script src="assets/plugins/custom/prismjs/prismjs.bundle.js"></script>
|
||||
<script src="assets/js/scripts.bundle.js"></script>
|
||||
<script src="assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js"></script>
|
||||
|
||||
<script>
|
||||
function ShowLoading() {
|
||||
document
|
||||
.getElementById("demo")
|
||||
.setAttribute("style", "display:block !important;");
|
||||
document
|
||||
.getElementById("a")
|
||||
.setAttribute("style", "display:none !important;");
|
||||
}
|
||||
function ShowForm() {
|
||||
document
|
||||
.getElementById("demo")
|
||||
.setAttribute("style", "display:none !important;");
|
||||
document
|
||||
.getElementById("a")
|
||||
.setAttribute("style", "display:block !important;;");
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
// $(".selectpicker").selectpicker();
|
||||
$(".selectpicker").selectpicker({
|
||||
dropupAuto: false,
|
||||
});
|
||||
$("#datepicker").datepicker({
|
||||
format: "dd/mm/yyyy",
|
||||
});
|
||||
$("#calendar-icon").click(function () {
|
||||
$("#datepicker").datepicker("show");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!--end::Global Theme Bundle-->
|
||||
|
||||
<!--end::Page Scripts-->
|
||||
</body>
|
||||
<!--end::Body-->
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,631 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Template Name: Metronic - Bootstrap 4 HTML, React, Angular 9 & VueJS Admin Dashboard Theme
|
||||
Author: KeenThemes
|
||||
Website: http://www.keenthemes.com/
|
||||
Contact: support@keenthemes.com
|
||||
Follow: www.twitter.com/keenthemes
|
||||
Dribbble: www.dribbble.com/keenthemes
|
||||
Like: www.facebook.com/keenthemes
|
||||
Purchase: https://1.envato.market/EA4JP
|
||||
Renew Support: https://1.envato.market/EA4JP
|
||||
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
|
||||
-->
|
||||
<html lang="en">
|
||||
<!--begin::Head-->
|
||||
<head>
|
||||
<base href="../" />
|
||||
<meta charset="utf-8" />
|
||||
<title>Company Portal | { title }</title>
|
||||
<meta name="description" content="Company Portal" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||||
/>
|
||||
<!--begin::Fonts-->
|
||||
<link rel="stylesheet" href="assets/css/googlefont/poppins.css" />
|
||||
<!--end::Fonts-->
|
||||
<!--begin::Page Custom Styles(used by this page)-->
|
||||
<link
|
||||
href="assets/css/pages/login/login-1.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!--end::Page Custom Styles-->
|
||||
<!--begin::Global Theme Styles(used by all pages)-->
|
||||
<link
|
||||
href="assets/plugins/global/plugins.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/plugins/custom/prismjs/prismjs.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
|
||||
<!--end::Global Theme Styles-->
|
||||
<!--begin::Layout Themes(used by all pages)-->
|
||||
<link
|
||||
href="assets/css/themes/layout/header/base/light.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/header/menu/light.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/brand/dark.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/aside/dark.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!--end::Layout Themes-->
|
||||
<link
|
||||
rel="shortcut icon"
|
||||
href="asset-corporate-portal/media/logo/logo-small.jpg"
|
||||
/>
|
||||
<!--end::Layout Themes SAS-->
|
||||
<link
|
||||
href="asset-corporate-portal/css/sas.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/css/bootstrap-select.min.css"
|
||||
/>
|
||||
|
||||
<style>
|
||||
.filter-option-inner-inner {
|
||||
margin-top: 1.2vh;
|
||||
color: var(--text-disabled);
|
||||
}
|
||||
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn {
|
||||
color: var(--text-disabled);
|
||||
}
|
||||
|
||||
.bootstrap-select.btn-group .dropdown-menu {
|
||||
min-width: 100%;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
position: sticky;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
transform: translate3d(0px, 0px, 0px) !important;
|
||||
}
|
||||
|
||||
/* mik */
|
||||
.input-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.input-label {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
transform: translateY(-50%);
|
||||
pointer-events: none;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.input-field:not(:placeholder-shown) + .input-label {
|
||||
top: 50%;
|
||||
font-size: 12px;
|
||||
color: var(--secondary-hover);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<!--end::Head-->
|
||||
<!--begin::Body-->
|
||||
<body
|
||||
id="kt_body"
|
||||
class="bg-white header-fixed header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading"
|
||||
>
|
||||
<style></style>
|
||||
<!--begin::Main-->
|
||||
|
||||
<div class="wrapperx p-5 h-100">
|
||||
<div class="row">
|
||||
<div class="col-lg-10">
|
||||
<!--begin::Row 1-->
|
||||
<div class="form-row">
|
||||
<div class="col-md-6 col-lg-2">
|
||||
<label
|
||||
for="input1"
|
||||
class="font-weight-bolder"
|
||||
style="font-family: Poppins"
|
||||
>Sapaan</label
|
||||
>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-size="4"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
>
|
||||
<option value="mr">Tn</option>
|
||||
<option value="mrs">Ny</option>
|
||||
<option value="ms">Nn</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6 col-lg-3">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Imbuhan Awal</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Imbuhan Awal 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-6 col-lg-5">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Nama
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Imbuhan Awal 2"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-6 col-lg-2">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Imbuhan Akhir</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Imbuhan Awal 2"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Row 1-->
|
||||
<!--begin::Row 2-->
|
||||
<div class="row mt-5">
|
||||
<div class="col-md-6">
|
||||
<!-- begin::Jenis Kelamin -->
|
||||
<div class="form-row">
|
||||
<label
|
||||
for="input1"
|
||||
style="font-family: Poppins; font-weight: 600"
|
||||
>Jenis Kelamin</label
|
||||
>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-size="4"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
>
|
||||
<option value="default">Pilih Jenis Kelamin</option>
|
||||
<option value="mr">Perempuan</option>
|
||||
<option value="mrs">Laki-Laki</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- end::Jenis Kelamin -->
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<!-- begin::Tanggal Lahir -->
|
||||
<div class="form-row">
|
||||
<label style="font-family: Poppins; font-weight: 600"
|
||||
>Tanggal Lahir</label
|
||||
>
|
||||
<div class="input-group date bg-field border-0 rounded-lg">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
readonly
|
||||
placeholder="Pilih Tanggal"
|
||||
id="datepicker"
|
||||
/>
|
||||
<div class="input-group-prepend">
|
||||
<span
|
||||
class="input-group-text bg-field border-0 rounded-lg"
|
||||
id="calendar-icon"
|
||||
>
|
||||
<span
|
||||
class="iconify text-grey"
|
||||
data-icon="heroicons-solid:calendar"
|
||||
style="font-size: 20px"
|
||||
></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end::Tanggal Lahir -->
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Row 2-->
|
||||
<!--begin::Row 3-->
|
||||
<div class="row mt-5">
|
||||
<div class="col-lg-6">
|
||||
<!-- begin::Umur -->
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<label
|
||||
for="input1"
|
||||
style="font-family: Poppins; font-weight: 600"
|
||||
>Umur</label
|
||||
>
|
||||
<div class="input-container">
|
||||
<input
|
||||
type="text"
|
||||
id="myInput"
|
||||
class="input-field form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
/>
|
||||
<label for="myInput" class="input-label">Tahun</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col mt-8">
|
||||
<div class="input-container">
|
||||
<input
|
||||
type="text"
|
||||
id="myInput"
|
||||
class="input-field form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
/>
|
||||
<label for="myInput" class="input-label">Bulan</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col mt-8">
|
||||
<div class="input-container">
|
||||
<input
|
||||
type="text"
|
||||
id="myInput"
|
||||
class="input-field form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
/>
|
||||
<label for="myInput" class="input-label">Hari</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end::Umur -->
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<!-- begin::Darah -->
|
||||
<div class="form-row">
|
||||
<!-- begin::Golongan Darah -->
|
||||
<div class="col">
|
||||
<label
|
||||
for="input1"
|
||||
style="font-family: Poppins; font-weight: 600"
|
||||
>Golongan Darah</label
|
||||
>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-size="4"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
>
|
||||
<option value="default">Pilih Golongan Darah</option>
|
||||
<option value="">O</option>
|
||||
<option value="">A</option>
|
||||
<option value="">B</option>
|
||||
<option value="">AB</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- end::Golongan Darah -->
|
||||
<!-- begin::Rhesus -->
|
||||
<div class="col">
|
||||
<label style="font-family: Poppins; font-weight: 600"
|
||||
>Rhesus</label
|
||||
>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-size="5"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
>
|
||||
<option value="default">Pilih Rhesus</option>
|
||||
<option value="">-</option>
|
||||
<option value="">+</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- end::Rhesus -->
|
||||
</div>
|
||||
<!-- end::Darah -->
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Row 3-->
|
||||
<!--begin::Row 4-->
|
||||
<div class="row mt-5">
|
||||
<!--begin::Pekerjaan-->
|
||||
<div class="col-md-6">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Pekerjaan</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Pekerjaan"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Pekerjaan-->
|
||||
<!--begin::Departemen-->
|
||||
<div class="col-md-6">
|
||||
<div class="form-row">
|
||||
<label
|
||||
for="input1"
|
||||
style="font-family: Poppins; font-weight: 600"
|
||||
>Departemen</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Departemen"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Departemen-->
|
||||
</div>
|
||||
<!--end::Row 4-->
|
||||
<!--begin::Row 5-->
|
||||
<div class="row mt-5">
|
||||
<!--begin::Posisi-->
|
||||
<div class="col-md-6">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600"
|
||||
>Posisi</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Posisi"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Posisi-->
|
||||
<!--Begin::Pendidikan Terakhir-->
|
||||
<div class="col-md-6">
|
||||
<div class="form-row">
|
||||
<label style="font-family: Poppins; font-weight: 600"
|
||||
>Pendidikan Terakhir</label
|
||||
>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-size="5"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
>
|
||||
<option value="default">Pilih Pendidikan Terakhir</option>
|
||||
<option value="mr">SMA/SLTA/Sederajat</option>
|
||||
<option value="mrs">D3</option>
|
||||
<option value="ms">Sarjana</option>
|
||||
<option value="ms">Magister</option>
|
||||
<option value="ms">Doktor</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Pendidikan Terakhir-->
|
||||
</div>
|
||||
<!--end::Row 5-->
|
||||
<!--begin::Row 6-->
|
||||
<div class="row mt-5">
|
||||
<!--begin::Kewarganegaraan-->
|
||||
<div class="col-md-6">
|
||||
<div class="form-row">
|
||||
<label
|
||||
for="input1"
|
||||
style="font-family: Poppins; font-weight: 600"
|
||||
>Kewarganegaraan</label
|
||||
>
|
||||
<div class="form-control border-0 h-auto p-0 mt-3">
|
||||
<div class="form-group">
|
||||
<div
|
||||
class="justify-content-between"
|
||||
style="display: flex; gap: 20px"
|
||||
>
|
||||
<label
|
||||
style="display: flex; align-items: center; gap: 5px"
|
||||
>
|
||||
<input type="radio" name="nationality" value="wni" />
|
||||
<p style="margin: 0">WNI</p>
|
||||
</label>
|
||||
<label
|
||||
style="display: flex; align-items: center; gap: 5px"
|
||||
>
|
||||
<input type="radio" name="nationality" value="wna" />
|
||||
<p style="margin: 0">WNA</p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Kewarganegaraan-->
|
||||
<!--Begin::Etnis-->
|
||||
<div class="col-md-6">
|
||||
<div class="form-row">
|
||||
<label style="font-family: Poppins; font-weight: 600"
|
||||
>Etnis</label
|
||||
>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-size="4"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
>
|
||||
<option value="default">Pilih Etnis</option>
|
||||
<option value="">Jawa</option>
|
||||
<option value="">Sunda</option>
|
||||
<option value="">Batak</option>
|
||||
<option value="">Betawi</option>
|
||||
<option value="">Dayak</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Etnis-->
|
||||
</div>
|
||||
<!--end::Row 6-->
|
||||
<!--begin::Row 7-->
|
||||
<div class="row mt-5">
|
||||
<!--begin::Identitas-->
|
||||
<div class="col-md-6">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<label
|
||||
for="input1"
|
||||
style="font-family: Poppins; font-weight: 600"
|
||||
>Identitas</label
|
||||
>
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
id="select1"
|
||||
data-live-search="true"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
data-size="4"
|
||||
>
|
||||
<option value="default">Pilih Identitas</option>
|
||||
<option value="">KTP</option>
|
||||
<option value="">SIM</option>
|
||||
<option value="">Paspor</option>
|
||||
<option value="">Kartu Pelajar</option>
|
||||
<option value="">Surat Keterangan</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Identitas-->
|
||||
<!--Begin::Nomor Identitas-->
|
||||
<div class="col-md-6">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<label
|
||||
for="input1"
|
||||
style="font-family: Poppins; font-weight: 600"
|
||||
>Nomor Identitas</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Nomor Identitas"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Nomor Identitas-->
|
||||
</div>
|
||||
<!--end::Row 7-->
|
||||
<!--begin::Row 8-->
|
||||
<div class="row mt-5">
|
||||
<!--begin::Nomor Hp-->
|
||||
<div class="col-md-6">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<label
|
||||
for="input1"
|
||||
style="font-family: Poppins; font-weight: 600"
|
||||
>Nomor HP</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Nomor HP"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Nomor Hp-->
|
||||
<!--Begin::Email-->
|
||||
<div class="col-md-6">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<label
|
||||
for="input1"
|
||||
style="font-family: Poppins; font-weight: 600"
|
||||
>Email</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
placeholder="Email"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Email-->
|
||||
</div>
|
||||
<!--end::Row 8-->
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<!-- person.png start -->
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<img
|
||||
src="asset-corporate-portal/media/person/person.png"
|
||||
style="display: block; width: 13vw"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-5">
|
||||
<div class="col">
|
||||
<button
|
||||
class="btn bg-primary-transparent text-center text-primary"
|
||||
style="width: 13vw; font-weight: 600"
|
||||
>
|
||||
Update Foto
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- person.png end -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--end::Main-->
|
||||
<script src="asset-corporate-portal/js/ktappsetting.js"></script>
|
||||
<!-- iconify -->
|
||||
<script src="assets/js/iconify/iconify.min.js"></script>
|
||||
<!--end::Global Config-->
|
||||
<!--begin::Global Theme Bundle(used by all pages)-->
|
||||
<script src="assets/plugins/global/plugins.bundle.js"></script>
|
||||
<script src="assets/plugins/custom/prismjs/prismjs.bundle.js"></script>
|
||||
<script src="assets/js/scripts.bundle.js"></script>
|
||||
<script src="assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js"></script>
|
||||
|
||||
<script>
|
||||
function ShowLoading() {
|
||||
document
|
||||
.getElementById("demo")
|
||||
.setAttribute("style", "display:block !important;");
|
||||
document
|
||||
.getElementById("a")
|
||||
.setAttribute("style", "display:none !important;");
|
||||
}
|
||||
function ShowForm() {
|
||||
document
|
||||
.getElementById("demo")
|
||||
.setAttribute("style", "display:none !important;");
|
||||
document
|
||||
.getElementById("a")
|
||||
.setAttribute("style", "display:block !important;;");
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
// $(".selectpicker").selectpicker();
|
||||
$(".selectpicker").selectpicker({
|
||||
dropupAuto: false,
|
||||
});
|
||||
$("#datepicker").datepicker({
|
||||
format: "dd/mm/yyyy",
|
||||
});
|
||||
$("#calendar-icon").click(function () {
|
||||
$("#datepicker").datepicker("show");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!--end::Global Theme Bundle-->
|
||||
|
||||
<!--end::Page Scripts-->
|
||||
</body>
|
||||
<!--end::Body-->
|
||||
</html>
|
||||
27
auth/jwt.go
27
auth/jwt.go
@@ -1,27 +0,0 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
echojwt "github.com/labstack/echo-jwt/v4"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
var IsLoggedIn = echojwt.WithConfig(
|
||||
echojwt.Config{
|
||||
SigningKey: []byte("--one_api-secret-2019-04-01"),
|
||||
TokenLookup: "cookie:token",
|
||||
ErrorHandler: JWTErrorChecker,
|
||||
},
|
||||
)
|
||||
|
||||
var IsAlreadyLogin = echojwt.WithConfig(
|
||||
echojwt.Config{
|
||||
SigningKey: []byte("--one_api-secret-2019-04-01"),
|
||||
ErrorHandler: JWTErrorChecker,
|
||||
},
|
||||
)
|
||||
|
||||
func JWTErrorChecker(c echo.Context, err error) error {
|
||||
return c.Redirect(http.StatusTemporaryRedirect, "/login")
|
||||
}
|
||||
@@ -60,10 +60,8 @@ func main() {
|
||||
handlers.SetupRoutesCorporate(app, appStore)
|
||||
// SETUP ROUT CLIENT
|
||||
handlers.SetupRoutesClient(app, appStore)
|
||||
|
||||
// SETUP ROUT DEV
|
||||
// handlers.SetupRoutesDev(app, appStore)
|
||||
|
||||
handlers.SetupRoutesDev(app, appStore)
|
||||
app.Logger.Fatal(app.Start(":5000"))
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ script GenerateChart(idDiv string, udata string) {
|
||||
var element = document.getElementById(idDiv);
|
||||
console.log("element ",element)
|
||||
if (element) {
|
||||
element.style.height = "450px";
|
||||
element.style.height = "400px";
|
||||
element.style.width = "100%";
|
||||
}
|
||||
|
||||
@@ -27,73 +27,4 @@ script GenerateChart(idDiv string, udata string) {
|
||||
// myChart_001.setOption(option_001);
|
||||
myChart[idDiv].setOption(option[idDiv]);
|
||||
});
|
||||
}
|
||||
|
||||
templ ShowChartFixed(idDiv string, udata string, width string, height string) {
|
||||
<div id={ idDiv } class="mx-auto"></div>
|
||||
@GenerateChartFixed(idDiv, udata, width, height)
|
||||
}
|
||||
|
||||
script GenerateChartFixed(idDiv string, udata string, width string, height string) {
|
||||
htmx.onLoad(function(elt) {
|
||||
// console.log("elt ",elt)
|
||||
var element = document.getElementById(idDiv);
|
||||
// console.log("element ",element)
|
||||
if (element) {
|
||||
element.style.height = height;
|
||||
element.style.width = width;
|
||||
}
|
||||
|
||||
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]);
|
||||
});
|
||||
}
|
||||
|
||||
templ ShowChartResponsiveWidth(idDiv string, udata string, height string) {
|
||||
<div id={ idDiv } class="mx-auto" style="width: 100%;"></div>
|
||||
@GenerateChartResponsive(idDiv, udata, height)
|
||||
}
|
||||
|
||||
script GenerateChartResponsive(idDiv string, udata string, height string) {
|
||||
htmx.onLoad(function(elt) {
|
||||
// console.log("elt ",elt)
|
||||
var element = document.getElementById(idDiv);
|
||||
// console.log("element ",element)
|
||||
if (element) {
|
||||
element.style.height = height;
|
||||
}
|
||||
|
||||
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);
|
||||
if (option[idDiv]['series']['radius']) {
|
||||
option[idDiv]['series']['radius'] = ['30%', '55%'];
|
||||
} else {
|
||||
option[idDiv]['series'][0]['radius'] = ['30%', '55%'];
|
||||
}
|
||||
|
||||
myChart[idDiv].setOption(option[idDiv]);
|
||||
|
||||
var resizeObserver = new ResizeObserver(function() {
|
||||
myChart[idDiv].resize();
|
||||
});
|
||||
|
||||
resizeObserver.observe(element);
|
||||
});
|
||||
}
|
||||
@@ -53,13 +53,13 @@ func ShowChart(idDiv string, udata string) templ.Component {
|
||||
|
||||
func GenerateChart(idDiv string, udata string) templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_GenerateChart_906c`,
|
||||
Function: `function __templ_GenerateChart_906c(idDiv, udata){htmx.onLoad(function(elt) {
|
||||
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 = "450px";
|
||||
element.style.height = "400px";
|
||||
element.style.width = "100%";
|
||||
}
|
||||
|
||||
@@ -76,160 +76,7 @@ func GenerateChart(idDiv string, udata string) templ.ComponentScript {
|
||||
myChart[idDiv].setOption(option[idDiv]);
|
||||
});
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_GenerateChart_906c`, idDiv, udata),
|
||||
CallInline: templ.SafeScriptInline(`__templ_GenerateChart_906c`, idDiv, udata),
|
||||
}
|
||||
}
|
||||
|
||||
func ShowChartFixed(idDiv string, udata string, width string, height 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)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(idDiv)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\chart\chart.templ`, Line: 33, Col: 19}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"mx-auto\"></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = GenerateChartFixed(idDiv, udata, width, height).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 GenerateChartFixed(idDiv string, udata string, width string, height string) templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_GenerateChartFixed_c5bf`,
|
||||
Function: `function __templ_GenerateChartFixed_c5bf(idDiv, udata, width, height){htmx.onLoad(function(elt) {
|
||||
// console.log("elt ",elt)
|
||||
var element = document.getElementById(idDiv);
|
||||
// console.log("element ",element)
|
||||
if (element) {
|
||||
element.style.height = height;
|
||||
element.style.width = width;
|
||||
}
|
||||
|
||||
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_GenerateChartFixed_c5bf`, idDiv, udata, width, height),
|
||||
CallInline: templ.SafeScriptInline(`__templ_GenerateChartFixed_c5bf`, idDiv, udata, width, height),
|
||||
}
|
||||
}
|
||||
|
||||
func ShowChartResponsiveWidth(idDiv string, udata string, height string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var5 == nil {
|
||||
templ_7745c5c3_Var5 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(idDiv)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\chart\chart.templ`, Line: 62, Col: 19}
|
||||
}
|
||||
_, 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=\"mx-auto\" style=\"width: 100%;\"></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = GenerateChartResponsive(idDiv, udata, height).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 GenerateChartResponsive(idDiv string, udata string, height string) templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_GenerateChartResponsive_fa78`,
|
||||
Function: `function __templ_GenerateChartResponsive_fa78(idDiv, udata, height){htmx.onLoad(function(elt) {
|
||||
// console.log("elt ",elt)
|
||||
var element = document.getElementById(idDiv);
|
||||
// console.log("element ",element)
|
||||
if (element) {
|
||||
element.style.height = height;
|
||||
}
|
||||
|
||||
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);
|
||||
if (option[idDiv]['series']['radius']) {
|
||||
option[idDiv]['series']['radius'] = ['30%', '55%'];
|
||||
} else {
|
||||
option[idDiv]['series'][0]['radius'] = ['30%', '55%'];
|
||||
}
|
||||
|
||||
myChart[idDiv].setOption(option[idDiv]);
|
||||
|
||||
var resizeObserver = new ResizeObserver(function() {
|
||||
myChart[idDiv].resize();
|
||||
});
|
||||
|
||||
resizeObserver.observe(element);
|
||||
});
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_GenerateChartResponsive_fa78`, idDiv, udata, height),
|
||||
CallInline: templ.SafeScriptInline(`__templ_GenerateChartResponsive_fa78`, idDiv, udata, height),
|
||||
Call: templ.SafeScript(`__templ_GenerateChart_4c73`, idDiv, udata),
|
||||
CallInline: templ.SafeScriptInline(`__templ_GenerateChart_4c73`, idDiv, udata),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ templ MainCustomDropdownInput(inp models.CustomDropdownv1Prm, listItem templ.Com
|
||||
name={ inp.Name }
|
||||
class="form-control bg-field selectpicker"
|
||||
data-live-search="true"
|
||||
data-style="bg-field btn-lg rounded-lg btn-custom-selectpicker"
|
||||
data-size="5"
|
||||
id={ inp.ID }
|
||||
>
|
||||
@@ -60,60 +59,3 @@ templ MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ CustomDropdownFilter(
|
||||
idCmp string,
|
||||
hxName string,
|
||||
hxInclude string,
|
||||
hxGet string,
|
||||
hxSwap string,
|
||||
hxTarget string,
|
||||
hxTrigger string,
|
||||
hxBeforeRequest templ.ComponentScript,
|
||||
hxAfterRequest templ.ComponentScript,
|
||||
listItem templ.Component) {
|
||||
<select
|
||||
class="form-control form-control-lg bg-field btn-lg rounded-lg selectpicker"
|
||||
data-live-search="true"
|
||||
data-size="5"
|
||||
data-style="btn-field btn-lg rounded-lg"
|
||||
data-live-search-placeholder="cari ..."
|
||||
id={ idCmp }
|
||||
name={ hxName }
|
||||
hx-include={ hxInclude }
|
||||
hx-get={ hxGet }
|
||||
hx-swap={ hxSwap }
|
||||
hx-target={ hxTarget }
|
||||
hx-trigger={ hxTrigger }
|
||||
hx-on::before-request={ hxBeforeRequest }
|
||||
hx-on::after-request={ hxAfterRequest }
|
||||
>
|
||||
@listItem
|
||||
</select>
|
||||
}
|
||||
|
||||
templ CustomDropdownForm(
|
||||
inp models.CustomDropdownV2Prm) {
|
||||
<div class="form-group">
|
||||
<label class="text-black" style="font-family: Poppins; font-weight: 600;">{ inp.Label } </label>
|
||||
<select
|
||||
if inp.ErrorMsg =="" {
|
||||
class="form-control form-control-lg bg-field btn-lg rounded-lg selectpicker"
|
||||
} else {
|
||||
class="form-control form-control-lg bg-field btn-lg rounded-lg selectpicker is-invalid"
|
||||
}
|
||||
data-live-search="true"
|
||||
data-size="5"
|
||||
title={ inp.Placeholder }
|
||||
data-style="btn-field btn-lg rounded-lg"
|
||||
data-live-search-placeholder="cari ..."
|
||||
name={ inp.Name }
|
||||
id={ inp.ID }
|
||||
>
|
||||
@inp.ListItem
|
||||
</select>
|
||||
<div class="invalid-feedback text-danger mt-3 ml-2">
|
||||
{ inp.ErrorMsg }
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -174,14 +174,14 @@ func MainCustomDropdownInput(inp models.CustomDropdownv1Prm, listItem templ.Comp
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"form-control bg-field selectpicker\" data-live-search=\"true\" data-style=\"bg-field btn-lg rounded-lg btn-custom-selectpicker\" data-size=\"5\" id=\"")
|
||||
_, 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: 35, Col: 14}
|
||||
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 {
|
||||
@@ -202,7 +202,7 @@ func MainCustomDropdownInput(inp models.CustomDropdownv1Prm, listItem templ.Comp
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 40, Col: 17}
|
||||
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 {
|
||||
@@ -239,7 +239,7 @@ func MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string,
|
||||
var templ_7745c5c3_Var15 string
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(name)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 48, Col: 14}
|
||||
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 {
|
||||
@@ -252,7 +252,7 @@ func MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string,
|
||||
var templ_7745c5c3_Var16 string
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(id)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 52, Col: 10}
|
||||
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 {
|
||||
@@ -265,7 +265,7 @@ func MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string,
|
||||
var templ_7745c5c3_Var17 string
|
||||
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 53, Col: 17}
|
||||
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 {
|
||||
@@ -278,7 +278,7 @@ func MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string,
|
||||
var templ_7745c5c3_Var18 string
|
||||
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 54, Col: 23}
|
||||
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 {
|
||||
@@ -291,7 +291,7 @@ func MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string,
|
||||
var templ_7745c5c3_Var19 string
|
||||
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(hxIndicator)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 55, Col: 29}
|
||||
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 {
|
||||
@@ -304,7 +304,7 @@ func MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string,
|
||||
var templ_7745c5c3_Var20 string
|
||||
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 56, Col: 25}
|
||||
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 {
|
||||
@@ -317,7 +317,7 @@ func MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string,
|
||||
var templ_7745c5c3_Var21 string
|
||||
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 57, Col: 25}
|
||||
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 {
|
||||
@@ -341,271 +341,3 @@ func MainCustomDropdownV1(name string, id string, hxTarget string, hxGet string,
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func CustomDropdownFilter(
|
||||
idCmp string,
|
||||
hxName string,
|
||||
hxInclude string,
|
||||
hxGet string,
|
||||
hxSwap string,
|
||||
hxTarget string,
|
||||
hxTrigger string,
|
||||
hxBeforeRequest templ.ComponentScript,
|
||||
hxAfterRequest templ.ComponentScript,
|
||||
listItem templ.Component) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var22 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var22 == nil {
|
||||
templ_7745c5c3_Var22 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest, hxAfterRequest)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<select class=\"form-control form-control-lg bg-field btn-lg rounded-lg selectpicker\" data-live-search=\"true\" data-size=\"5\" data-style=\"btn-field btn-lg rounded-lg\" data-live-search-placeholder=\"cari ...\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var23 string
|
||||
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(idCmp)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 81, Col: 12}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" name=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var24 string
|
||||
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(hxName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 82, Col: 15}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var25 string
|
||||
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 83, Col: 24}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var26 string
|
||||
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 84, Col: 16}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var27 string
|
||||
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 85, Col: 18}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var28 string
|
||||
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 86, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-trigger=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var29 string
|
||||
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 87, Col: 24}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var30 templ.ComponentScript = hxBeforeRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var30.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var31 templ.ComponentScript = hxAfterRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var31.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = listItem.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</select>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func CustomDropdownForm(
|
||||
inp models.CustomDropdownV2Prm) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var32 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var32 == nil {
|
||||
templ_7745c5c3_Var32 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"form-group\"><label class=\"text-black\" style=\"font-family: Poppins; font-weight: 600;\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var33 string
|
||||
templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Label)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 98, Col: 87}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</label> <select")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if inp.ErrorMsg == "" {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"form-control form-control-lg bg-field btn-lg rounded-lg selectpicker\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"form-control form-control-lg bg-field btn-lg rounded-lg selectpicker is-invalid\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" data-live-search=\"true\" data-size=\"5\" title=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var34 string
|
||||
templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Placeholder)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 107, Col: 26}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" data-style=\"btn-field btn-lg rounded-lg\" data-live-search-placeholder=\"cari ...\" name=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var35 string
|
||||
templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 110, Col: 18}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var36 string
|
||||
templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 111, Col: 14}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = inp.ListItem.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</select><div class=\"invalid-feedback text-danger mt-3 ml-2\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var37 string
|
||||
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 116, Col: 17}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package customradiobuttoninline
|
||||
|
||||
import "cpone/models"
|
||||
|
||||
templ MainCustomRadioButtonInput(inp models.CustomRadioButtonv1Prm) {
|
||||
<div class="mt-5">
|
||||
<label for="input1" style="font-family: Poppins; font-weight: 600">{ inp.Label }</label>
|
||||
<div class="form-control">
|
||||
<div class="form-group">
|
||||
<div style="display: flex; gap: 20px">
|
||||
<label style="display: flex; align-items: center; gap: 5px">
|
||||
<input type="radio" name="nationality" value={ inp.Value }/>
|
||||
<p style="margin: 0">{ inp.Text }</p>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="invalid-feedback text-danger mt-3 ml-2 mt-5">
|
||||
{ inp.ErrorMsg }
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -19,9 +19,9 @@ templ CustomTextFieldv2(inp models.CustomTextFieldv2Prm) {
|
||||
placeholder={ inp.Placeholder }
|
||||
value={ inp.Value }
|
||||
if inp.ErrorMsg =="" {
|
||||
class="form-control bg-field border-0 form-control-lg bg-field rounded-lg"
|
||||
class="form-control bg-field border-0 h-auto py-6 px-6 rounded-lg"
|
||||
} else {
|
||||
class="form-control bg-field border-1 form-control-lg bg-field rounded-lg is-invalid"
|
||||
class="form-control bg-field border-1 h-auto py-6 px-6 rounded-lg is-invalid"
|
||||
}
|
||||
/>
|
||||
<div class="invalid-feedback text-danger mt-3 ml-2">
|
||||
|
||||
@@ -123,12 +123,12 @@ func CustomTextFieldv2(inp models.CustomTextFieldv2Prm) templ.Component {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if inp.ErrorMsg == "" {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"form-control bg-field border-0 form-control-lg bg-field rounded-lg\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"form-control bg-field border-0 h-auto py-6 px-6 rounded-lg\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"form-control bg-field border-1 form-control-lg bg-field rounded-lg is-invalid\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" class=\"form-control bg-field border-1 h-auto py-6 px-6 rounded-lg is-invalid\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -28,58 +28,3 @@ templ Modal(modalID string, modalTitle string, modalBody templ.Component, modalA
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ModalXL(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-xl 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>
|
||||
}
|
||||
|
||||
templ ModalViewXL(modalID string, modalTitle string, modalBody 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-xl 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>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -83,143 +83,3 @@ func Modal(modalID string, modalTitle string, modalBody templ.Component, modalAc
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func ModalXL(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_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 class=\"modal fade\" style=\"display: none\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(modalID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\modal\modal.templ`, Line: 36, Col: 14}
|
||||
}
|
||||
_, 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("\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\" aria-hidden=\"true\"><div class=\"modal-dialog modal-xl 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_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(modalTitle)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\modal\modal.templ`, Line: 46, 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("</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
|
||||
})
|
||||
}
|
||||
|
||||
func ModalViewXL(modalID string, modalTitle string, modalBody 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_Var7 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var7 == nil {
|
||||
templ_7745c5c3_Var7 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"modal fade\" style=\"display: none\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(modalID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\modal\modal.templ`, Line: 65, Col: 14}
|
||||
}
|
||||
_, 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("\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\" aria-hidden=\"true\"><div class=\"modal-dialog modal-xl 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_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(modalTitle)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\modal\modal.templ`, Line: 75, Col: 18}
|
||||
}
|
||||
_, 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("</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></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
|
||||
})
|
||||
}
|
||||
|
||||
@@ -40,50 +40,6 @@ templ Navbar(dataUser models.User) {
|
||||
</div>
|
||||
}
|
||||
|
||||
templ NavbarWithLogo(dataUser models.User) {
|
||||
<div id="kt_header" class="header">
|
||||
<!--begin::Container-->
|
||||
<div class="container-fluid d-flex align-items-stretch justify-content-between">
|
||||
<!--begin::Header Menu Wrapper-->
|
||||
<div class="header-menu-wrapper header-menu-wrapper-left" id="kt_header_menu_wrapper">
|
||||
<a class="navbar-brand" href="#">
|
||||
<img
|
||||
src="/asset-corporate-portal/media/landingpage/logo.png"
|
||||
width="126"
|
||||
height="40"
|
||||
class="d-inline-block align-top"
|
||||
alt="Your Brand"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Header Menu Wrapper-->
|
||||
<!--begin::Topbar-->
|
||||
<div class="topbar">
|
||||
<!--begin::User-->
|
||||
<div class="topbar-item">
|
||||
<div
|
||||
class="btn btn-icon btn-icon-mobile w-auto btn-clean d-flex align-items-center btn-lg px-2"
|
||||
id="kt_quick_user_toggle"
|
||||
>
|
||||
<span
|
||||
class="text-muted font-weight-bold font-size-base d-none d-md-inline mr-1"
|
||||
>Hi,</span>
|
||||
<span
|
||||
class="text-dark-50 font-weight-bolder font-size-base d-none d-md-inline mr-3"
|
||||
>{ dataUser.Username }</span>
|
||||
<span class="bg-primary-transparent p-3" style="border-radius: 50%; width: 40px; height: 40px;">
|
||||
<span class="iconify text-primary" data-icon="gravity-ui:person"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::User-->
|
||||
</div>
|
||||
<!--end::Topbar-->
|
||||
</div>
|
||||
<!--end::Container-->
|
||||
</div>
|
||||
}
|
||||
|
||||
templ NavbarMenu(datamenu []models.Menu) {
|
||||
<div class="aside-menu-wrapper flex-column-fluid" id="kt_aside_menu_wrapper">
|
||||
<!--begin::Menu Container-->
|
||||
|
||||
@@ -53,7 +53,7 @@ func Navbar(dataUser models.User) templ.Component {
|
||||
})
|
||||
}
|
||||
|
||||
func NavbarWithLogo(dataUser models.User) templ.Component {
|
||||
func NavbarMenu(datamenu []models.Menu) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
@@ -66,43 +66,6 @@ func NavbarWithLogo(dataUser models.User) templ.Component {
|
||||
templ_7745c5c3_Var3 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"kt_header\" class=\"header\"><!--begin::Container--><div class=\"container-fluid d-flex align-items-stretch justify-content-between\"><!--begin::Header Menu Wrapper--><div class=\"header-menu-wrapper header-menu-wrapper-left\" id=\"kt_header_menu_wrapper\"><a class=\"navbar-brand\" href=\"#\"><img src=\"/asset-corporate-portal/media/landingpage/logo.png\" width=\"126\" height=\"40\" class=\"d-inline-block align-top\" alt=\"Your Brand\"></a></div><!--end::Header Menu Wrapper--><!--begin::Topbar--><div class=\"topbar\"><!--begin::User--><div class=\"topbar-item\"><div class=\"btn btn-icon btn-icon-mobile w-auto btn-clean d-flex align-items-center btn-lg px-2\" id=\"kt_quick_user_toggle\"><span class=\"text-muted font-weight-bold font-size-base d-none d-md-inline mr-1\">Hi,</span> <span class=\"text-dark-50 font-weight-bolder font-size-base d-none d-md-inline mr-3\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(dataUser.Username)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\navbar\navbar.templ`, Line: 73, Col: 26}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</span> <span class=\"bg-primary-transparent p-3\" style=\"border-radius: 50%; width: 40px; height: 40px;\"><span class=\"iconify text-primary\" data-icon=\"gravity-ui:person\"></span></span></div></div><!--end::User--></div><!--end::Topbar--></div><!--end::Container--></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func NavbarMenu(datamenu []models.Menu) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var5 == nil {
|
||||
templ_7745c5c3_Var5 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"aside-menu-wrapper flex-column-fluid\" id=\"kt_aside_menu_wrapper\"><!--begin::Menu Container--><div id=\"kt_aside_menu\" class=\"aside-menu my-4 \" data-menu-vertical=\"1\" data-menu-scroll=\"1\" data-menu-dropdown-timeout=\"500\"><!--begin::Menu Nav--><ul class=\"menu-nav \">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
package sidebaruserprofile
|
||||
|
||||
import (
|
||||
"cpone/component/customtextfield"
|
||||
"cpone/models"
|
||||
"cpone/component/modal"
|
||||
)
|
||||
|
||||
templ SidebarForm() {
|
||||
<div>
|
||||
<form
|
||||
id="form-ganti-password"
|
||||
class="form"
|
||||
hx-post="/corp/dashboard_pic/gantipassword"
|
||||
hx-target="#body-ganti-pass"
|
||||
hx-swap="outerHTML"
|
||||
hx-indicator=".formloading"
|
||||
hx-on::before-request={ HandleFormBeforeRequest() }
|
||||
hx-on::after-request={ HandleFormAfterGantiPass() }
|
||||
>
|
||||
@modalcomponent.Modal("modal-ganti-pass",
|
||||
"Ganti Password",
|
||||
ModalGantiPassword(),
|
||||
ActionFormGantiPassword(),
|
||||
CloseFormGantiPassword(),
|
||||
)
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ModalGantiPassword() {
|
||||
<div id="body-ganti-pass">
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "oldPassID",
|
||||
Name: "oldpassid",
|
||||
Type: "password",
|
||||
Placeholder: "Masukan password lama",
|
||||
Label: "Password Lama",
|
||||
})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "newPassID",
|
||||
Name: "newpassid",
|
||||
Type: "password",
|
||||
Placeholder: "Masukan password baru",
|
||||
Label: "Password Baru",
|
||||
})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "reNewPassID",
|
||||
Name: "renewpassid",
|
||||
Type: "password",
|
||||
Placeholder: "Masukan ulang password baru",
|
||||
Label: "Ulangi Password Baru",
|
||||
})
|
||||
</div>
|
||||
<script>
|
||||
document.addEventListener('htmx:afterSwap', function(event) {
|
||||
$('.selectpicker').selectpicker('refresh');
|
||||
})
|
||||
</script>
|
||||
}
|
||||
|
||||
|
||||
templ RetModalGantiPassword(
|
||||
oldPass models.CustomTextFieldv2Prm,
|
||||
newPass models.CustomTextFieldv2Prm,
|
||||
renewPass models.CustomTextFieldv2Prm,
|
||||
hxOnLoad templ.ComponentScript,
|
||||
) {
|
||||
<div id="body-ganti-pass" hx-on::load={ hxOnLoad }>
|
||||
@customtextfield.CustomTextFieldv2(oldPass)
|
||||
@customtextfield.CustomTextFieldv2(newPass)
|
||||
@customtextfield.CustomTextFieldv2(renewPass)
|
||||
</div>
|
||||
<script>
|
||||
document.addEventListener('htmx:afterSwap', function(event) {
|
||||
$('.selectpicker').selectpicker('refresh');
|
||||
})
|
||||
</script>
|
||||
}
|
||||
|
||||
templ ActionFormGantiPassword() {
|
||||
<div>
|
||||
<button
|
||||
hx-on::after-request={ JSHideModal("#modal-ganti-pass") }
|
||||
hx-post="/corp/dashboard_pic/tutupgantipassword"
|
||||
hx-target="#body-ganti-pass"
|
||||
hx-swap="outerHTML"
|
||||
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 CloseFormGantiPassword() {
|
||||
<button
|
||||
type="button"
|
||||
hx-on::after-request={ JSHideModal("#modal-ganti-pass") }
|
||||
hx-post="/corp/dashboard_pic/tutupgantipassword"
|
||||
hx-target="#body-ganti-pass"
|
||||
hx-swap="outerHTML"
|
||||
class="close btnactcancel"
|
||||
data-dismiss="modal"
|
||||
aria-label="Close"
|
||||
>
|
||||
<i aria-hidden="true" class="ki ki-close"></i>
|
||||
</button>
|
||||
}
|
||||
|
||||
script JSHideModal(modalID string) {
|
||||
$(modalID).modal('hide')
|
||||
}
|
||||
|
||||
script JSShowModal(modalID string) {
|
||||
$(modalID).modal('show')
|
||||
const btnActCancel = document.querySelectorAll('.btnactcancel');
|
||||
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
|
||||
|
||||
for (let i = 0; i < btnActCancel.length; i++) {
|
||||
btnActCancel[i].removeAttribute('disabled');
|
||||
}
|
||||
for (let i = 0; i < btnActSaveData.length; i++) {
|
||||
btnActSaveData[i].removeAttribute('disabled');
|
||||
}
|
||||
}
|
||||
|
||||
script HandleFormBeforeRequest() {
|
||||
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 HandleFormAfterGantiPass() {
|
||||
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');
|
||||
}
|
||||
}
|
||||
@@ -1,336 +0,0 @@
|
||||
// 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/component/customtextfield"
|
||||
"cpone/component/modal"
|
||||
"cpone/models"
|
||||
)
|
||||
|
||||
func SidebarForm() 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
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleFormBeforeRequest(), HandleFormAfterGantiPass())
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<form id=\"form-ganti-password\" class=\"form\" hx-post=\"/corp/dashboard_pic/gantipassword\" hx-target=\"#body-ganti-pass\" hx-swap=\"outerHTML\" hx-indicator=\".formloading\" hx-on::before-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 templ.ComponentScript = HandleFormBeforeRequest()
|
||||
_, 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("\" hx-on::after-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 templ.ComponentScript = HandleFormAfterGantiPass()
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = modalcomponent.Modal("modal-ganti-pass",
|
||||
"Ganti Password",
|
||||
ModalGantiPassword(),
|
||||
ActionFormGantiPassword(),
|
||||
CloseFormGantiPassword(),
|
||||
).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 ModalGantiPassword() 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=\"body-ganti-pass\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "oldPassID",
|
||||
Name: "oldpassid",
|
||||
Type: "password",
|
||||
Placeholder: "Masukan password lama",
|
||||
Label: "Password Lama",
|
||||
}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "newPassID",
|
||||
Name: "newpassid",
|
||||
Type: "password",
|
||||
Placeholder: "Masukan password baru",
|
||||
Label: "Password Baru",
|
||||
}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "reNewPassID",
|
||||
Name: "renewpassid",
|
||||
Type: "password",
|
||||
Placeholder: "Masukan ulang password baru",
|
||||
Label: "Ulangi Password Baru",
|
||||
}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><script>\r\n document.addEventListener('htmx:afterSwap', function(event) {\r\n $('.selectpicker').selectpicker('refresh');\r\n })\r\n </script>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func RetModalGantiPassword(
|
||||
oldPass models.CustomTextFieldv2Prm,
|
||||
newPass models.CustomTextFieldv2Prm,
|
||||
renewPass models.CustomTextFieldv2Prm,
|
||||
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_Var5 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var5 == nil {
|
||||
templ_7745c5c3_Var5 = 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=\"body-ganti-pass\" hx-on::load=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 templ.ComponentScript = hxOnLoad
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(oldPass).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(newPass).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(renewPass).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><script>\r\n document.addEventListener('htmx:afterSwap', function(event) {\r\n $('.selectpicker').selectpicker('refresh');\r\n })\r\n </script>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func ActionFormGantiPassword() templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var7 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var7 == nil {
|
||||
templ_7745c5c3_Var7 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JSHideModal("#modal-ganti-pass"))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-on::after-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 templ.ComponentScript = JSHideModal("#modal-ganti-pass")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"/corp/dashboard_pic/tutupgantipassword\" hx-target=\"#body-ganti-pass\" hx-swap=\"outerHTML\" 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 CloseFormGantiPassword() 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, JSHideModal("#modal-ganti-pass"))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button type=\"button\" hx-on::after-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var10 templ.ComponentScript = JSHideModal("#modal-ganti-pass")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"/corp/dashboard_pic/tutupgantipassword\" hx-target=\"#body-ganti-pass\" hx-swap=\"outerHTML\" 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 JSHideModal(modalID string) templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_JSHideModal_4530`,
|
||||
Function: `function __templ_JSHideModal_4530(modalID){$(modalID).modal('hide')
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_JSHideModal_4530`, modalID),
|
||||
CallInline: templ.SafeScriptInline(`__templ_JSHideModal_4530`, modalID),
|
||||
}
|
||||
}
|
||||
|
||||
func JSShowModal(modalID string) templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_JSShowModal_658d`,
|
||||
Function: `function __templ_JSShowModal_658d(modalID){$(modalID).modal('show')
|
||||
const btnActCancel = document.querySelectorAll('.btnactcancel');
|
||||
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
|
||||
|
||||
for (let i = 0; i < btnActCancel.length; i++) {
|
||||
btnActCancel[i].removeAttribute('disabled');
|
||||
}
|
||||
for (let i = 0; i < btnActSaveData.length; i++) {
|
||||
btnActSaveData[i].removeAttribute('disabled');
|
||||
}
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_JSShowModal_658d`, modalID),
|
||||
CallInline: templ.SafeScriptInline(`__templ_JSShowModal_658d`, modalID),
|
||||
}
|
||||
}
|
||||
|
||||
func HandleFormBeforeRequest() templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_HandleFormBeforeRequest_7bdf`,
|
||||
Function: `function __templ_HandleFormBeforeRequest_7bdf(){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_7bdf`),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_7bdf`),
|
||||
}
|
||||
}
|
||||
|
||||
func HandleFormAfterGantiPass() templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_HandleFormAfterGantiPass_cc6f`,
|
||||
Function: `function __templ_HandleFormAfterGantiPass_cc6f(){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_HandleFormAfterGantiPass_cc6f`),
|
||||
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterGantiPass_cc6f`),
|
||||
}
|
||||
}
|
||||
@@ -22,35 +22,26 @@ templ Navbaruserprofile(dataUser models.User) {
|
||||
<!--end::Header-->
|
||||
<!--begin::Separator-->
|
||||
<div class="separator separator-dashed my-7"></div>
|
||||
<div class="navi mt-2">
|
||||
<a
|
||||
class="btn btn-sm btn-light-primary font-weight-bolder py-2 px-5 block"
|
||||
style="width: 100%"
|
||||
data-toggle="modal"
|
||||
data-target="#modal-ganti-pass"
|
||||
>
|
||||
Change Password
|
||||
</a>
|
||||
</div>
|
||||
<div class="navi mt-2">
|
||||
<a
|
||||
class="btn btn-sm btn-light-primary font-weight-bolder py-2 px-5 block"
|
||||
hx-get="/login/signout"
|
||||
hx-indicator=".logoutloading"
|
||||
style="width: 100%"
|
||||
>
|
||||
<span class="htmx-indicator spinner-border spinner-border-sm logoutloading" role="status" aria-hidden="true"></span>
|
||||
Sign Out
|
||||
</a>
|
||||
<!--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>
|
||||
@SidebarForm()
|
||||
}
|
||||
|
||||
templ ProfileHeader(dataUser models.User) {
|
||||
<div class="d-flex mt-5">
|
||||
<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>
|
||||
@@ -63,6 +54,9 @@ templ ProfileHeader(dataUser models.User) {
|
||||
<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>
|
||||
}
|
||||
|
||||
@@ -33,11 +33,15 @@ func Navbaruserprofile(dataUser models.User) templ.Component {
|
||||
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><div class=\"navi mt-2\"><a class=\"btn btn-sm btn-light-primary font-weight-bolder py-2 px-5 block\" style=\"width: 100%\" data-toggle=\"modal\" data-target=\"#modal-ganti-pass\">Change Password\r</a></div><div class=\"navi mt-2\"><a class=\"btn btn-sm btn-light-primary font-weight-bolder py-2 px-5 block\" hx-get=\"/login/signout\" hx-indicator=\".logoutloading\" style=\"width: 100%\"><span class=\"htmx-indicator spinner-border spinner-border-sm logoutloading\" role=\"status\" aria-hidden=\"true\"></span> Sign Out\r</a></div></div><!--end::Content--></div>")
|
||||
_, 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 = SidebarForm().Render(ctx, templ_7745c5c3_Buffer)
|
||||
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
|
||||
}
|
||||
@@ -61,14 +65,14 @@ func ProfileHeader(dataUser models.User) templ.Component {
|
||||
templ_7745c5c3_Var2 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex 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\">")
|
||||
_, 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: `component\sidebar_user_profile\sidebar_user_profile.templ`, Line: 61, Col: 27}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `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 {
|
||||
@@ -81,13 +85,13 @@ func ProfileHeader(dataUser models.User) templ.Component {
|
||||
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: `component\sidebar_user_profile\sidebar_user_profile.templ`, Line: 64, Col: 27}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `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></div>")
|
||||
_, 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
|
||||
}
|
||||
|
||||
@@ -10,11 +10,7 @@ templ TableV3(thName []string, thWidth []string, trComponent templ.Component) {
|
||||
<thead>
|
||||
<tr class="rounded-lg bg-header-table">
|
||||
for i, item := range thName {
|
||||
if item == "AKSI" {
|
||||
<th scope="col" width={ thWidth[i] } class="text-center">{ item }</th>
|
||||
} else {
|
||||
<th scope="col" width={ thWidth[i] }>{ item }</th>
|
||||
}
|
||||
<th scope="col" width={ thWidth[i] }>{ item }</th>
|
||||
}
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -38,68 +38,35 @@ func TableV3(thName []string, thWidth []string, trComponent templ.Component) tem
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for i, item := range thName {
|
||||
if item == "AKSI" {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<th scope=\"col\" width=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(thWidth[i])
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 14, Col: 42}
|
||||
}
|
||||
_, 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=\"text-center\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(item)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 14, Col: 71}
|
||||
}
|
||||
_, 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
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<th scope=\"col\" width=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(thWidth[i])
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 16, Col: 42}
|
||||
}
|
||||
_, 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("\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(item)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 16, Col: 51}
|
||||
}
|
||||
_, 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("</th>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<th scope=\"col\" width=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(thWidth[i])
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 13, Col: 41}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(item)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 13, Col: 50}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</th>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</tr></thead> <tbody>")
|
||||
@@ -134,9 +101,9 @@ func DivEmptyV3() templ.Component {
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var6 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var6 == nil {
|
||||
templ_7745c5c3_Var6 = templ.NopComponent
|
||||
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var4 == nil {
|
||||
templ_7745c5c3_Var4 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div></div>")
|
||||
|
||||
@@ -41,7 +41,7 @@ templ CustomToastV2Show(title string, message string, typeToast string) {
|
||||
aria-atomic="true"
|
||||
id="notification-001"
|
||||
hx-swap-oob="true"
|
||||
hx-get="/home/hidetoast"
|
||||
hx-get="/dev/hidetoast"
|
||||
hx-trigger="load delay:3s"
|
||||
hx-target="this"
|
||||
style="border-radius: 8px 8px 8px 8px;"
|
||||
|
||||
@@ -56,7 +56,7 @@ func CustomToastV2Show(title string, message string, typeToast string) templ.Com
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"toast toast-top-right fade show\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" id=\"notification-001\" hx-swap-oob=\"true\" hx-get=\"/home/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
|
||||
}
|
||||
|
||||
12
go.mod
12
go.mod
@@ -4,19 +4,17 @@ go 1.21.0
|
||||
|
||||
require (
|
||||
github.com/a-h/templ v0.2.663
|
||||
github.com/fsnotify/fsnotify v1.7.0
|
||||
github.com/glebarez/go-sqlite v1.22.0
|
||||
github.com/go-sql-driver/mysql v1.8.1
|
||||
github.com/golang-jwt/jwt/v5 v5.0.0
|
||||
github.com/jmoiron/sqlx v1.4.0
|
||||
github.com/labstack/echo/v4 v4.12.0
|
||||
github.com/spf13/viper v1.18.2
|
||||
golang.org/x/text v0.14.0
|
||||
)
|
||||
|
||||
require (
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/go-sql-driver/mysql v1.8.1 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/jmoiron/sqlx v1.4.0 // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||
@@ -26,6 +24,7 @@ require (
|
||||
github.com/spf13/afero v1.11.0 // indirect
|
||||
github.com/spf13/cast v1.6.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/spf13/viper v1.18.2 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
go.uber.org/multierr v1.10.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
||||
@@ -37,8 +36,7 @@ require (
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
|
||||
github.com/google/uuid v1.5.0 // indirect
|
||||
github.com/labstack/echo-jwt/v4 v4.2.0
|
||||
github.com/labstack/gommon v0.4.2
|
||||
github.com/labstack/gommon v0.4.2 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
|
||||
44
go.sum
44
go.sum
@@ -3,13 +3,10 @@ filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4
|
||||
github.com/a-h/templ v0.2.663 h1:aa0WMm27InkYHGjimcM7us6hJ6BLhg98ZbfaiDPyjHE=
|
||||
github.com/a-h/templ v0.2.663/go.mod h1:SA7mtYwVEajbIXFRh3vKdYm/4FYyLQAtPH1+KxzGPA8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
||||
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
|
||||
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/glebarez/go-sqlite v1.22.0 h1:uAcMJhaA6r3LHMTFgP0SifzgXg46yJkgxqyuyec+ruQ=
|
||||
@@ -18,8 +15,6 @@ github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpv
|
||||
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
||||
github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE=
|
||||
github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=
|
||||
@@ -30,38 +25,33 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
|
||||
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/labstack/echo-jwt/v4 v4.2.0 h1:odSISV9JgcSCuhgQSV/6Io3i7nUmfM/QkBeR5GVJj5c=
|
||||
github.com/labstack/echo-jwt/v4 v4.2.0/go.mod h1:MA2RqdXdEn4/uEglx0HcUOgQSyBaTh5JcaHIan3biwU=
|
||||
github.com/labstack/echo/v4 v4.11.3 h1:Upyu3olaqSHkCjs1EJJwQ3WId8b8b1hxbogyommKktM=
|
||||
github.com/labstack/echo/v4 v4.11.3/go.mod h1:UcGuQ8V6ZNRmSweBIJkPvGfwCMIlFmiqrPqiEBfPYws=
|
||||
github.com/labstack/echo/v4 v4.12.0 h1:IKpw49IMryVB2p1a4dzwlhP1O2Tf2E0Ir/450lH+kI0=
|
||||
github.com/labstack/echo/v4 v4.12.0/go.mod h1:UP9Cr2DJXbOK3Kr9ONYzNowSh7HP0aG0ShAyycHSJvM=
|
||||
github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8=
|
||||
github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
|
||||
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
|
||||
github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU=
|
||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
||||
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
||||
github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
||||
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
|
||||
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
|
||||
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
|
||||
@@ -79,6 +69,7 @@ github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMV
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
@@ -87,34 +78,43 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
|
||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
|
||||
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
|
||||
go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
|
||||
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
|
||||
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
|
||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
|
||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
|
||||
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
|
||||
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
|
||||
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
|
||||
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
|
||||
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
|
||||
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
|
||||
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
||||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
modernc.org/libc v1.37.6 h1:orZH3c5wmhIQFTXF+Nt+eeauyd+ZIt2BX6ARe+kD+aw=
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
package corporate_handlers
|
||||
|
||||
import (
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
customtoastv2 "cpone/component/toastbootstrap"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type AccountService interface {
|
||||
ChangePasswordPIC(host string, token string, currPassword string, newPassword string) (models.ResponseStatus, error)
|
||||
ChangePasswordPAT(token string, currPassword string, newPassword string) (models.ResponseStatus, error)
|
||||
}
|
||||
|
||||
func NewAccountHandler(as AccountService) *AccountHandler {
|
||||
return &AccountHandler{
|
||||
AccountService: as,
|
||||
}
|
||||
}
|
||||
|
||||
type AccountHandler struct {
|
||||
AccountService AccountService
|
||||
}
|
||||
|
||||
func (as *AccountHandler) HandleChangePassword(c echo.Context) error {
|
||||
var response models.ResponseStatus
|
||||
userToken := c.Get("user").(*jwt.Token)
|
||||
token := userToken.Raw
|
||||
claims := userToken.Claims.(jwt.MapClaims)
|
||||
userGroup := claims["M_UserGroupDashboard"].(string)
|
||||
h := c.Request().Host
|
||||
|
||||
old_pass := c.FormValue("oldpassid")
|
||||
new_pass := c.FormValue("newpassid")
|
||||
re_new_pass := c.FormValue("renewpassid")
|
||||
// logger.Info("params", zap.Any("old", old_pass), zap.Any("new", new_pass), zap.Any("re-new", re_new_pass))
|
||||
|
||||
old_validation := ""
|
||||
new_validation := ""
|
||||
renew_validation := ""
|
||||
errorPop := ""
|
||||
|
||||
if strings.TrimSpace(old_pass) == "" {
|
||||
old_validation = "Tidak boleh kosong"
|
||||
errorPop = "Tidak boleh kosong"
|
||||
}
|
||||
if strings.TrimSpace(new_pass) == "" {
|
||||
new_validation = "Tidak boleh kosong"
|
||||
errorPop = "Tidak boleh kosong"
|
||||
}
|
||||
if strings.TrimSpace(re_new_pass) == "" {
|
||||
renew_validation = "Tidak boleh kosong"
|
||||
errorPop = "Tidak boleh kosong"
|
||||
}
|
||||
if strings.TrimSpace(new_pass) != strings.TrimSpace(re_new_pass) {
|
||||
new_validation = "Password tidak sama"
|
||||
renew_validation = "Password tidak sama"
|
||||
errorPop = "Password tidak sama"
|
||||
}
|
||||
|
||||
if old_validation != "" || new_validation != "" || renew_validation != "" {
|
||||
newBody := sidebaruserprofile.RetModalGantiPassword(
|
||||
models.CustomTextFieldv2Prm{
|
||||
ID: "oldPassID",
|
||||
Name: "oldpassid",
|
||||
Type: "password",
|
||||
Placeholder: "Masukan password lama",
|
||||
Label: "Password Lama",
|
||||
ErrorMsg: old_validation,
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
ID: "newPassID",
|
||||
Name: "newpassid",
|
||||
Type: "password",
|
||||
Placeholder: "Masukan password baru",
|
||||
Label: "Password Baru",
|
||||
ErrorMsg: new_validation,
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
ID: "reNewPassID",
|
||||
Name: "renewpassid",
|
||||
Type: "password",
|
||||
Placeholder: "Masukan ulang password baru",
|
||||
Label: "Ulangi Password Baru",
|
||||
ErrorMsg: renew_validation,
|
||||
},
|
||||
sidebaruserprofile.JSHideModal(""),
|
||||
)
|
||||
toast := customtoastv2.CustomToastV2Show("Warning", errorPop, "warning")
|
||||
return utils.ViewMulti(c, []templ.Component{toast, newBody})
|
||||
}
|
||||
|
||||
if userGroup == "pic" {
|
||||
resp, err := as.AccountService.ChangePasswordPIC(h, token, old_pass, new_pass)
|
||||
if err != nil {
|
||||
newBody := sidebaruserprofile.ModalGantiPassword()
|
||||
toast := customtoastv2.CustomToastV2Show("Warning", err.Error(), "warning")
|
||||
return utils.ViewMulti(c, []templ.Component{toast, newBody})
|
||||
}
|
||||
response = resp
|
||||
}
|
||||
|
||||
if userGroup == "patient" {
|
||||
resp, err := as.AccountService.ChangePasswordPAT(token, old_pass, new_pass)
|
||||
if err != nil {
|
||||
newBody := sidebaruserprofile.ModalGantiPassword()
|
||||
toast := customtoastv2.CustomToastV2Show("Warning", "Error ganti password pat", "warning")
|
||||
return utils.ViewMulti(c, []templ.Component{toast, newBody})
|
||||
}
|
||||
response = resp
|
||||
}
|
||||
|
||||
if response.Status == "ERR" {
|
||||
newBody := sidebaruserprofile.ModalGantiPassword()
|
||||
toast := customtoastv2.CustomToastV2Show("Warning", response.Message, "warning")
|
||||
return utils.ViewMulti(c, []templ.Component{toast, newBody})
|
||||
}
|
||||
|
||||
expire := time.Now().Add(-7 * 24 * time.Hour)
|
||||
cookie := new(http.Cookie)
|
||||
cookie.Name = "token"
|
||||
cookie.Value = ""
|
||||
cookie.Path = "/"
|
||||
cookie.Expires = expire
|
||||
cookie.HttpOnly = true
|
||||
c.SetCookie(cookie)
|
||||
|
||||
ret := `
|
||||
<script>
|
||||
$("#body-ganti-pass").modal('hide')
|
||||
console.log("signout")
|
||||
localStorage.removeItem("token")
|
||||
localStorage.removeItem("user")
|
||||
|
||||
setTimeout(() => {
|
||||
window.location.replace("/login");
|
||||
}, 200)
|
||||
</script>
|
||||
`
|
||||
|
||||
c.Response().Header().Set("HX-Trigger", "script")
|
||||
return c.String(http.StatusOK, ret)
|
||||
}
|
||||
|
||||
func (as *AccountHandler) HandleCloseChangePassword(c echo.Context) error {
|
||||
newBody := sidebaruserprofile.ModalGantiPassword()
|
||||
|
||||
return utils.View(c, newBody)
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
package corporate_handlers
|
||||
|
||||
import (
|
||||
breadcrumadmin "cpone/component/breadcrumbadmin"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
"cpone/component/pagination"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_dashboardpic "cpone/views/corporate/dashboardpic"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type DashboardPicServices interface {
|
||||
GetEmployeeAnalyticBreadcrumb(title string) (models.BreadCrumbV1, error)
|
||||
GetCorporateName(userID string) (string, error)
|
||||
DummyDataTest() ([]models.DashboardPic, error)
|
||||
ListingDashboardPic(email string, search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.DashboardPic, int, error)
|
||||
}
|
||||
|
||||
type DashboardPicHandler struct {
|
||||
DashboardPicServices DashboardPicServices
|
||||
}
|
||||
|
||||
func NewDashboardPicHandler(ea DashboardPicServices) *DashboardPicHandler {
|
||||
return &DashboardPicHandler{
|
||||
DashboardPicServices: ea,
|
||||
}
|
||||
}
|
||||
|
||||
func (ea *DashboardPicHandler) HandleShowEmployeeAnalyticScreen(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
listID := utils.GenerateRandomID("listid")
|
||||
paginationID := utils.GenerateRandomID("paginationid")
|
||||
|
||||
userCok := c.Get("user").(*jwt.Token)
|
||||
claims := userCok.Claims.(jwt.MapClaims)
|
||||
userID := claims["M_UserID"].(string)
|
||||
name := claims["M_StaffName"].(string)
|
||||
position := claims["M_UserGroupDashboard"].(string)
|
||||
email := claims["M_UserEmail"].(string)
|
||||
|
||||
title, err := ea.DashboardPicServices.GetCorporateName(userID)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("error get corporate name", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
convr, _ := strconv.Atoi(userID)
|
||||
|
||||
user := models.User{
|
||||
UserID: convr,
|
||||
Username: name,
|
||||
UserFullName: name,
|
||||
UserPosition: position,
|
||||
}
|
||||
|
||||
dataBreadcrumb, err := ea.DashboardPicServices.GetEmployeeAnalyticBreadcrumb(title)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error breadcrumb dev", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
defer logger.Sync()
|
||||
|
||||
navbaruser := navbarmenu.NavbarWithLogo(user)
|
||||
sidbaruser := sidebaruserprofile.Navbaruserprofile(user)
|
||||
breadcrumb := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadcrumb)
|
||||
|
||||
listingData, totalPage, err := ea.DashboardPicServices.ListingDashboardPic(email, "", "", "", 1, 10)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error get listing data", zap.Any("error", err), zap.Any("total", totalPage))
|
||||
return err
|
||||
}
|
||||
listingcomponent := corporate_dashboardpic.ListingData(listingData, listID)
|
||||
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
1,
|
||||
"/corp/dashboard_pic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID,
|
||||
"outerHTML", "", "",
|
||||
corporate_dashboardpic.BeforeRequestContent(),
|
||||
corporate_dashboardpic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
filtercomponent := corporate_dashboardpic.FilterListing(
|
||||
"/corp/dashboard_pic/filter",
|
||||
"input changed delay:500ms",
|
||||
"#searchID, #startdateID, #enddateID, #listID, #paginationID",
|
||||
"outerHTML",
|
||||
"#"+paginationID,
|
||||
corporate_dashboardpic.BeforeRequestContent(),
|
||||
corporate_dashboardpic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
content := corporate_dashboardpic.DashboardPic(
|
||||
listID,
|
||||
paginationID,
|
||||
breadcrumb,
|
||||
filtercomponent,
|
||||
listingcomponent,
|
||||
paginationcomponent,
|
||||
)
|
||||
css := corporate_dashboardpic.CSSDashboardPIC()
|
||||
js := corporate_dashboardpic.JSDashboardPIC()
|
||||
|
||||
view := corporate_dashboardpic.ShowDashboardPic(title, content, css, js, navbaruser, sidbaruser)
|
||||
return utils.View(c, view)
|
||||
}
|
||||
|
||||
func (ea *DashboardPicHandler) HandlePagination(c echo.Context) error {
|
||||
|
||||
pageparam := c.QueryParam("page")
|
||||
listID := c.QueryParam("listID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
search := c.QueryParam("search")
|
||||
startdate := c.QueryParam("startdate")
|
||||
enddate := c.QueryParam("enddate")
|
||||
|
||||
userCok := c.Get("user").(*jwt.Token)
|
||||
claims := userCok.Claims.(jwt.MapClaims)
|
||||
email := claims["M_UserEmail"].(string)
|
||||
|
||||
var retVal []templ.Component
|
||||
logger, _ := zap.NewProduction()
|
||||
page, err := strconv.Atoi(pageparam)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error convert page param")
|
||||
return err
|
||||
}
|
||||
|
||||
listdata, totalPage, err := ea.DashboardPicServices.ListingDashboardPic(email, search, startdate, enddate, page, 10)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error convert page param")
|
||||
return err
|
||||
}
|
||||
listcomponent := corporate_dashboardpic.ListingData(listdata, listID)
|
||||
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
page,
|
||||
"/corp/dashboard_pic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID,
|
||||
"outerHTML", "", "",
|
||||
corporate_dashboardpic.BeforeRequestContent(),
|
||||
corporate_dashboardpic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
retVal = append(retVal, listcomponent)
|
||||
retVal = append(retVal, paginationcomponent)
|
||||
return utils.ViewMulti(c, retVal)
|
||||
}
|
||||
|
||||
func (ea *DashboardPicHandler) HandleFilter(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
search := c.QueryParam("search")
|
||||
startdate := c.QueryParam("startdate")
|
||||
enddate := c.QueryParam("enddate")
|
||||
listID := c.QueryParam("listID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
|
||||
userCok := c.Get("user").(*jwt.Token)
|
||||
claims := userCok.Claims.(jwt.MapClaims)
|
||||
email := claims["M_UserEmail"].(string)
|
||||
|
||||
dataList, totalPage, err := ea.DashboardPicServices.ListingDashboardPic(email, search, startdate, enddate, 1, 10)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error Get Listing Data", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
listcomponent := corporate_dashboardpic.ListingData(dataList, listID)
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage, 1,
|
||||
"/corp/dashboard_pic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID, "outerHTML", "", "",
|
||||
corporate_dashboardpic.BeforeRequestContent(),
|
||||
corporate_dashboardpic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
var retval []templ.Component
|
||||
retval = append(retval, listcomponent)
|
||||
retval = append(retval, paginationcomponent)
|
||||
return utils.ViewMulti(c, retval)
|
||||
}
|
||||
|
||||
func (ea *DashboardPicHandler) HandleToDetail(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
id := c.Param("id")
|
||||
|
||||
logger.Info("params", zap.Any("id", id))
|
||||
|
||||
url := "/corp/dashboard_pic/detail/" + id
|
||||
c.Response().Header().Set("HX-Redirect", url)
|
||||
|
||||
return c.String(http.StatusOK, url)
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package corporate_handlers
|
||||
|
||||
import (
|
||||
breadcrumadmin "cpone/component/breadcrumbadmin"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_mcudetail "cpone/views/corporate/mcu"
|
||||
corporate_kesimpulan "cpone/views/corporate/mcu/mcutab/kesimpulan"
|
||||
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type McuDetailServices interface {
|
||||
GetBreadcrumb(id string) (models.BreadCrumbV1, error)
|
||||
GetTabNameList(id string) ([]models.McuTabModels, error)
|
||||
}
|
||||
|
||||
type McuDetailHandler struct {
|
||||
McuDetailServices McuDetailServices
|
||||
}
|
||||
|
||||
func NewMcuDetailHandler(mcud McuDetailServices) *McuDetailHandler {
|
||||
return &McuDetailHandler{
|
||||
McuDetailServices: mcud,
|
||||
}
|
||||
}
|
||||
|
||||
func (mcud *McuDetailHandler) HandlerShowMcuDetailScreen(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
id := c.Param("id")
|
||||
logger.Info("params", zap.Any("id", id))
|
||||
|
||||
userCok := c.Get("user").(*jwt.Token)
|
||||
claims := userCok.Claims.(jwt.MapClaims)
|
||||
name := claims["M_StaffName"].(string)
|
||||
position := claims["M_UserGroupDashboard"].(string)
|
||||
// logger.Info("jwt", zap.Any("name", name))
|
||||
|
||||
user := models.User{
|
||||
UserID: 1,
|
||||
Username: name,
|
||||
UserFullName: name,
|
||||
UserPosition: position,
|
||||
}
|
||||
|
||||
dataBreadcrumb, err := mcud.McuDetailServices.GetBreadcrumb(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error breadcrumb corp", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
breadcrumb := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadcrumb)
|
||||
navbaruser := navbarmenu.NavbarWithLogo(user)
|
||||
sidbaruser := sidebaruserprofile.Navbaruserprofile(user)
|
||||
|
||||
// test := []models.McuTabModels{}
|
||||
// tabname, err := mcud.McuDetailServices.GetTabNameList(id)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// logger.Info("List tab name", zap.Any("tav", tabname))
|
||||
|
||||
content := corporate_mcudetail.McuDetailScreen(
|
||||
breadcrumb,
|
||||
corporate_mcudetail.TabViewMcuDetail(id),
|
||||
// corporate_mcudetail.McuDetailTabView(id, tabname),
|
||||
)
|
||||
css := corporate_mcudetail.CSSMcuDetail(
|
||||
corporate_kesimpulan.CSSKesimpulan(),
|
||||
)
|
||||
js := corporate_mcudetail.JSMcuDetail()
|
||||
|
||||
view := corporate_mcudetail.ShowMcuDetail(
|
||||
dataBreadcrumb.Title,
|
||||
content,
|
||||
css,
|
||||
js,
|
||||
navbaruser,
|
||||
sidbaruser,
|
||||
)
|
||||
|
||||
return utils.View(c, view)
|
||||
}
|
||||
@@ -1,748 +0,0 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/component/pagination"
|
||||
customtoastv2 "cpone/component/toastbootstrap"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_daftarpeserta "cpone/views/corporate/mcu/mcutab/daftarpeserta"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type TabDaftarPesertaServices interface {
|
||||
SearchDaftarPesertaMCU(mcuID string, keyword string, page int, perPage int) ([]models.ModelMcuDaftarPeserta, int, error)
|
||||
GenerataPasswordMCU(mgmMCUID string, host string) (models.GeneratePasswordResponse, error)
|
||||
GetAkunPeserta(patientID string) (models.AuthPatient, error)
|
||||
GetListReportPesertaV4(orderheaderID string, staffname string) ([]models.TabViewReportMcu, error)
|
||||
GetListReportPesertaV5(orderheaderID string, mcuid string, staffname string) ([]models.TabViewReportMcu, error)
|
||||
ResetPasswordPeserta(token string, newPassword string, email string, authuserid string) (models.ResponseStatus, error)
|
||||
DetailTestdanPaket(orderheaderID string) ([]models.TableTestPaket, error)
|
||||
GetListAttachmentFile(orderheaderID string) ([]models.AttachmentFIle, error)
|
||||
}
|
||||
|
||||
type TabDaftarPesertaHandlers struct {
|
||||
TabDaftarPesertaServices TabDaftarPesertaServices
|
||||
}
|
||||
|
||||
func NewTabDaftarPesertaHandlers(tdp TabDaftarPesertaServices) *TabDaftarPesertaHandlers {
|
||||
return &TabDaftarPesertaHandlers{TabDaftarPesertaServices: tdp}
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleShowTabDaftarPeserta(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
table_id := utils.GenerateRandomID("table-id")
|
||||
pagination_id := utils.GenerateRandomID("pagination-id")
|
||||
|
||||
dialog_rpt_id := utils.GenerateRandomID("dialog-rpt-id")
|
||||
dialog_rptbody_id := utils.GenerateRandomID("dialog-rptbody-id")
|
||||
|
||||
dialog_akun_id := utils.GenerateRandomID("dialog-akun-id")
|
||||
dialog_akunbody_id := utils.GenerateRandomID("dialog-akunbody-id")
|
||||
|
||||
dialog_password_id := utils.GenerateRandomID("dialog-password-id")
|
||||
dialog_passbody_id := utils.GenerateRandomID("dialog-passbody-id")
|
||||
|
||||
dialog_attach_id := utils.GenerateRandomID("dialog-attach-id")
|
||||
dialog_attachbody_id := utils.GenerateRandomID("dialog-attachbody-id")
|
||||
|
||||
dialog_paket_id := utils.GenerateRandomID("dialog-paket-id")
|
||||
dialog_paketbody_id := utils.GenerateRandomID("dialog-paketbody-id")
|
||||
|
||||
id := c.Param("id")
|
||||
logger.Info("mgm_mcu", zap.Any("id", id))
|
||||
|
||||
data_peserta, total_peserta, err := tdp.TabDaftarPesertaServices.SearchDaftarPesertaMCU(id, "", 1, 10)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
hxinclude := "#search-daftar-peserta, #table-id, #pagination-id, #dialog-rpt-id, #dialog-rptbody-id, #dialog-akun-id, #dialog-akunbody-id, #dialog-password-id, #dialog-passbody-id, #dialog-attach-id, #dialog-attachbody-id, #dialog-paket-id, #dialog-paketbody-id"
|
||||
table := corporate_daftarpeserta.Table_DaftarPeserta(
|
||||
data_peserta, table_id,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openreport",
|
||||
"#"+dialog_rptbody_id, hxinclude, "outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/opendetail",
|
||||
"#"+dialog_paketbody_id, hxinclude, "outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openviewakun",
|
||||
"#"+dialog_akunbody_id, hxinclude, "outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openattachment",
|
||||
"#"+dialog_attachbody_id, hxinclude, "outerHTML",
|
||||
)
|
||||
page := pagination.PaginationV3(
|
||||
total_peserta, 1, "/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/changepage", pagination_id,
|
||||
"#search-daftar-peserta, #loading-parent, #loading-child, #loading-spinner, #loadingcontent"+hxinclude,
|
||||
"#content-dp", "outerHTML", "", "", corporate_daftarpeserta.BeforeRequestContent(), corporate_daftarpeserta.AfterRequestContent(),
|
||||
)
|
||||
dp_layout := corporate_daftarpeserta.Content(table, page)
|
||||
|
||||
filtercomp := corporate_daftarpeserta.Filter_DaftarPeserta(
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/filter",
|
||||
"#content-dp",
|
||||
"#search-daftar-peserta, #loading-parent, #loading-child, #loading-spinner, #loadingcontent"+hxinclude,
|
||||
"outerHTML", "input changed delay:500ms", corporate_daftarpeserta.BeforeRequestContent(), corporate_daftarpeserta.AfterRequestContent(),
|
||||
)
|
||||
|
||||
// dialog rpt peserta
|
||||
l_rpt := []models.TabViewReportMcu{}
|
||||
t_rpt := corporate_daftarpeserta.Tab_RPT(l_rpt)
|
||||
body_rpt := corporate_daftarpeserta.Body_RPT(dialog_rptbody_id, t_rpt, corporate_daftarpeserta.JSShowModal(""))
|
||||
close_rpt := corporate_daftarpeserta.Close_Modal("#" + dialog_rpt_id)
|
||||
aksi_rpt := corporate_daftarpeserta.Aksi_Modal("", "", "", "", true)
|
||||
dialog_rpt := corporate_daftarpeserta.Dialog_DaftarPeserta(
|
||||
"rptform", "xl",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/dialogreport",
|
||||
"#"+dialog_rptbody_id, "outerHTML", hxinclude, dialog_rpt_id,
|
||||
"Daftar RPT", body_rpt, close_rpt, aksi_rpt,
|
||||
)
|
||||
|
||||
// dialog generate password peserta
|
||||
text := "Apakah anda yakin untuk me-generate password untuk seluruh peserta"
|
||||
body_genpass := corporate_daftarpeserta.Body_GenPass(dialog_passbody_id, text, corporate_daftarpeserta.JSShowModal(""))
|
||||
close_genpass := corporate_daftarpeserta.Close_Modal("#" + dialog_password_id)
|
||||
aksi_genpass := corporate_daftarpeserta.Aksi_Modal(
|
||||
"#"+dialog_password_id,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/closegenpass",
|
||||
"#"+dialog_passbody_id, "outerHTML", false,
|
||||
)
|
||||
dialog_genpass := corporate_daftarpeserta.Dialog_DaftarPeserta(
|
||||
"genpassform", "",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/dialoggenpass",
|
||||
"#"+dialog_passbody_id, "outerHTML", hxinclude,
|
||||
dialog_password_id, "Generate Passsword Akun Peserta",
|
||||
body_genpass, close_genpass, aksi_genpass,
|
||||
)
|
||||
|
||||
// dialog reset akun peserta
|
||||
body_acc := corporate_daftarpeserta.Body_Account(
|
||||
dialog_akunbody_id,
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "ID Akun Peserta",
|
||||
Name: "akunpesertaid",
|
||||
Type: "hidden",
|
||||
ID: "akunpesertaidid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Email",
|
||||
Name: "akunpesertaemail",
|
||||
Type: "text",
|
||||
ID: "akunpesertaemailid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Password baru",
|
||||
Name: "akunpesertapassnew",
|
||||
Type: "password",
|
||||
ID: "akunpesertapassnewid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Ulangi password baru",
|
||||
Name: "akunpesertapasscek",
|
||||
Type: "password",
|
||||
ID: "akunpesertapasscekid",
|
||||
},
|
||||
corporate_daftarpeserta.JSShowModal(""),
|
||||
)
|
||||
close_acc := corporate_daftarpeserta.Close_Modal("#" + dialog_akun_id)
|
||||
aksi_acc := corporate_daftarpeserta.Aksi_Modal(
|
||||
"#"+dialog_akun_id,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/closeviewakun",
|
||||
"#"+dialog_akunbody_id, "outerHTML", false,
|
||||
)
|
||||
dialog_acc := corporate_daftarpeserta.Dialog_DaftarPeserta(
|
||||
"akunform", "",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/viewakun",
|
||||
"#"+dialog_akunbody_id, "outerHTML", hxinclude,
|
||||
dialog_akun_id, "Reset Password Akun Peserta", body_acc, close_acc, aksi_acc,
|
||||
)
|
||||
|
||||
// dialog detail paket dan test peserta
|
||||
l_detail, err := tdp.TabDaftarPesertaServices.DetailTestdanPaket("")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
t_detail := corporate_daftarpeserta.Table_DetailPaket(l_detail)
|
||||
body_paket := corporate_daftarpeserta.Body_Detail(dialog_paketbody_id, t_detail, corporate_daftarpeserta.JSShowModal(""))
|
||||
close_paket := corporate_daftarpeserta.Close_Modal("#" + dialog_paket_id)
|
||||
aksi_paket := corporate_daftarpeserta.Aksi_Modal(
|
||||
"#"+dialog_paket_id,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/closedetail",
|
||||
"#"+dialog_paketbody_id, "outerHTML", true,
|
||||
)
|
||||
|
||||
dialog_paket := corporate_daftarpeserta.Dialog_DaftarPeserta(
|
||||
"detailpaketform", "xl",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/dialogdetail",
|
||||
"#"+dialog_paketbody_id, "outerHTML", hxinclude,
|
||||
dialog_paket_id, "Detail Pemeriksaan", body_paket, close_paket, aksi_paket,
|
||||
)
|
||||
|
||||
// dialog file attachment peserta
|
||||
l_file, err := tdp.TabDaftarPesertaServices.GetListAttachmentFile("")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
t_file := corporate_daftarpeserta.Tab_Attachment(l_file)
|
||||
body_file := corporate_daftarpeserta.Body_Attachment(dialog_attachbody_id, t_file, corporate_daftarpeserta.JSShowModal(""))
|
||||
close_file := corporate_daftarpeserta.Close_Modal("#" + dialog_attach_id)
|
||||
aksi_file := corporate_daftarpeserta.Aksi_Modal(
|
||||
"#"+dialog_attach_id,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/closeattachment",
|
||||
"#"+dialog_attachbody_id, "outerHTML", true,
|
||||
)
|
||||
|
||||
dialog_file := corporate_daftarpeserta.Dialog_DaftarPeserta(
|
||||
"attachmentform", "xl",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/dialogattachment",
|
||||
"#"+dialog_attachbody_id, "outerHTML", hxinclude,
|
||||
dialog_attach_id, "Detail Attachment", body_file, close_file, aksi_file,
|
||||
)
|
||||
|
||||
tabdaftarpeserta := corporate_daftarpeserta.DaftarPesertaScreen(
|
||||
table_id,
|
||||
pagination_id,
|
||||
dialog_rpt_id,
|
||||
dialog_rptbody_id,
|
||||
dialog_rpt,
|
||||
dialog_akun_id,
|
||||
dialog_akunbody_id,
|
||||
dialog_acc,
|
||||
dialog_password_id,
|
||||
dialog_passbody_id,
|
||||
dialog_genpass,
|
||||
dialog_paket_id,
|
||||
dialog_paketbody_id,
|
||||
dialog_paket,
|
||||
dialog_attach_id,
|
||||
dialog_attachbody_id,
|
||||
dialog_file,
|
||||
dp_layout,
|
||||
filtercomp,
|
||||
)
|
||||
|
||||
return utils.View(c, tabdaftarpeserta)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandlePagination(c echo.Context) error {
|
||||
pageparam := c.QueryParam("page")
|
||||
table_id := c.QueryParam("table-id")
|
||||
pagination_id := c.QueryParam("pagination-id")
|
||||
keyword := c.QueryParam("searchdp")
|
||||
|
||||
mcu_id := c.Param("id")
|
||||
|
||||
dialog_rptbody_id := c.QueryParam("dialog-rptbody-id")
|
||||
dialog_paketbody_id := c.QueryParam("dialog-paketbody-id")
|
||||
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
|
||||
dialog_attachbody_id := c.QueryParam("dialog-attachbody-id")
|
||||
|
||||
page, err := strconv.Atoi(pageparam)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
peserta, total, err := tdp.TabDaftarPesertaServices.SearchDaftarPesertaMCU(mcu_id, keyword, page, 10)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
hxinclude := "#search-daftar-peserta, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #table-id, #pagination-id, #dialog-rpt-id, #dialog-rptbody-id, #dialog-akun-id, #dialog-akunbody-id, #dialog-password-id, #dialog-passbody-id, #dialog-attach-id, #dialog-attachbody-id, #dialog-paket-id, #dialog-paketbody-id"
|
||||
table := corporate_daftarpeserta.Table_DaftarPeserta(
|
||||
peserta, table_id,
|
||||
"/corp/dashboard_pic/detail/"+mcu_id+"/tabdaftarpeserta/openreport",
|
||||
"#"+dialog_rptbody_id, hxinclude, "outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+mcu_id+"/tabdaftarpeserta/opendetail",
|
||||
"#"+dialog_paketbody_id, hxinclude, "outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+mcu_id+"/tabdaftarpeserta/openviewakun",
|
||||
"#"+dialog_akunbody_id, hxinclude, "outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+mcu_id+"/tabdaftarpeserta/openattachment",
|
||||
"#"+dialog_attachbody_id, hxinclude, "outerHTML",
|
||||
)
|
||||
|
||||
paginat := pagination.PaginationV3(
|
||||
total, page, "/corp/dashboard_pic/detail/"+mcu_id+"/tabdaftarpeserta/changepage", pagination_id,
|
||||
hxinclude, "#content-dp", "outerHTML", "", "", corporate_daftarpeserta.BeforeRequestContent(), corporate_daftarpeserta.AfterRequestContent(),
|
||||
)
|
||||
|
||||
layout := corporate_daftarpeserta.Content(table, paginat)
|
||||
return utils.View(c, layout)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleFilter(c echo.Context) error {
|
||||
keyword := c.QueryParam("searchdp")
|
||||
mcuid := c.Param("id")
|
||||
table_id := c.QueryParam("table-id")
|
||||
paginat_id := c.QueryParam("pagination-id")
|
||||
|
||||
dialog_rptbody_id := c.QueryParam("dialog-rptbody-id")
|
||||
dialog_paketbody_id := c.QueryParam("dialog-paketbody-id")
|
||||
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
|
||||
dialog_attachbody_id := c.QueryParam("dialog-attachbody-id")
|
||||
|
||||
peserta, total, err := tdp.TabDaftarPesertaServices.SearchDaftarPesertaMCU(mcuid, keyword, 1, 10)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
hxinclude := "#search-daftar-peserta, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #table-id, #pagination-id, #dialog-rpt-id, #dialog-rptbody-id, #dialog-akun-id, #dialog-akunbody-id, #dialog-password-id, #dialog-passbody-id, #dialog-attach-id, #dialog-attachbody-id, #dialog-paket-id, #dialog-paketbody-id"
|
||||
table := corporate_daftarpeserta.Table_DaftarPeserta(
|
||||
peserta, table_id,
|
||||
"/corp/dashboard_pic/detail/"+mcuid+"/tabdaftarpeserta/openreport",
|
||||
"#"+dialog_rptbody_id, hxinclude, "outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+mcuid+"/tabdaftarpeserta/opendetail",
|
||||
"#"+dialog_paketbody_id, hxinclude, "outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+mcuid+"/tabdaftarpeserta/openviewakun",
|
||||
"#"+dialog_akunbody_id, hxinclude, "outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+mcuid+"/tabdaftarpeserta/openattachment",
|
||||
"#"+dialog_attachbody_id, hxinclude, "outerHTML",
|
||||
)
|
||||
|
||||
paginat := pagination.PaginationV3(
|
||||
total, 1, "/corp/dashboard_pic/detail/"+mcuid+"/tabdaftarpeserta/changepage", paginat_id,
|
||||
hxinclude, "#content-dp", "outerHTML", "", "", corporate_daftarpeserta.BeforeRequestContent(), corporate_daftarpeserta.AfterRequestContent(),
|
||||
)
|
||||
|
||||
content := corporate_daftarpeserta.Content(table, paginat)
|
||||
return utils.View(c, content)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleOpenReportDialog(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
user_token := c.Get("user").(*jwt.Token)
|
||||
claims := user_token.Claims.(jwt.MapClaims)
|
||||
staffname := claims["M_StaffName"].(string)
|
||||
|
||||
mcuid := c.Param("id")
|
||||
orderheaderid := c.QueryParam("idx")
|
||||
dialog_rpt_id := c.QueryParam("dialog-rpt-id")
|
||||
dialog_rptbody_id := c.QueryParam("dialog-rptbody-id")
|
||||
logger.Info("show rpt by: ", zap.Any("orderheaderid", orderheaderid))
|
||||
|
||||
// rpt_dialog, err := tdp.TabDaftarPesertaServices.GetListReportPesertaV4(orderheaderid, staffname)
|
||||
rpt_dialog, err := tdp.TabDaftarPesertaServices.GetListReportPesertaV5(orderheaderid, mcuid, staffname)
|
||||
if err != nil {
|
||||
logger.Error("Error get rpt", zap.Any("error: ", err))
|
||||
tab := corporate_daftarpeserta.Tab_RPT([]models.TabViewReportMcu{})
|
||||
mod := corporate_daftarpeserta.Body_RPT(dialog_rptbody_id, tab, corporate_daftarpeserta.JSShowModal("#"+dialog_rpt_id))
|
||||
return utils.View(c, mod)
|
||||
}
|
||||
|
||||
comp := corporate_daftarpeserta.Tab_RPT(rpt_dialog)
|
||||
body := corporate_daftarpeserta.Body_RPT(dialog_rptbody_id, comp, corporate_daftarpeserta.JSShowModal("#"+dialog_rpt_id))
|
||||
return utils.View(c, body)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleDialogGenPass(c echo.Context) error {
|
||||
id := c.Param("id")
|
||||
|
||||
dialog_rpt_id := c.QueryParam("dialog-rpt-id")
|
||||
dialog_rptbody_id := c.QueryParam("dialog-rptbody-id")
|
||||
|
||||
dialog_paket_id := c.QueryParam("dialog-paket-id")
|
||||
dialog_paketbody_id := c.QueryParam("dialog-paketbody-id")
|
||||
|
||||
dialog_akun_id := c.QueryParam("dialog-akun-id")
|
||||
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
|
||||
|
||||
dialog_attach_id := c.QueryParam("dialog-attach-id")
|
||||
dialog_attachbody_id := c.QueryParam("dialog-attachbody-id")
|
||||
|
||||
dialog_password_id := c.FormValue("dialog-password-id")
|
||||
dialog_passbody_id := c.FormValue("dialog-passbody-id")
|
||||
|
||||
table_id := c.FormValue("table-id")
|
||||
paginat_id := c.FormValue("pagination-id")
|
||||
pageparam := c.FormValue("currpage" + paginat_id)
|
||||
|
||||
msg := "Apakah anda yakin untuk me-generate password untuk seluruh peserta"
|
||||
resp, err := tdp.TabDaftarPesertaServices.GenerataPasswordMCU(id, "")
|
||||
if err != nil {
|
||||
body_pass := corporate_daftarpeserta.Body_GenPass(dialog_passbody_id, msg, corporate_daftarpeserta.JSShowModal(""))
|
||||
toast := customtoastv2.CustomToastV2Show("Warning", "Gagal generate password peserta", "warning")
|
||||
ret := []templ.Component{toast, body_pass}
|
||||
return utils.ViewMulti(c, ret)
|
||||
}
|
||||
|
||||
if resp.Status != "OK" {
|
||||
body_pass := corporate_daftarpeserta.Body_GenPass(dialog_passbody_id, msg, corporate_daftarpeserta.JSShowModal(""))
|
||||
toast := customtoastv2.CustomToastV2Show("Warning", "Gagal generate password peserta", "warning")
|
||||
ret := []templ.Component{toast, body_pass}
|
||||
return utils.ViewMulti(c, ret)
|
||||
}
|
||||
|
||||
aa := "/corp/dashboard_pic/detail/" + id + "/tabdaftarpeserta/reload?page=" + pageparam
|
||||
bb := "&table-id=" + table_id
|
||||
cc := "&pagination-id=" + paginat_id
|
||||
dd := "&dialog-rpt-id=" + dialog_rpt_id
|
||||
ee := "&dialog-rptbody-id=" + dialog_rptbody_id
|
||||
ff := "&dialog-password-id=" + dialog_password_id
|
||||
gg := "&dialog-passbody-id=" + dialog_passbody_id
|
||||
hh := "&dialog-akun-id=" + dialog_akun_id
|
||||
ii := "&dialog-akunbody-id=" + dialog_akunbody_id
|
||||
jj := "&dialog-attach-id=" + dialog_attach_id + "&dialog-attachbody-id=" + dialog_attachbody_id
|
||||
kk := "&dialog-paket-id=" + dialog_paket_id + "&dialog-paketbody-id" + dialog_paketbody_id
|
||||
ll := "&currpage" + paginat_id + "=" + pageparam
|
||||
link := aa + bb + cc + dd + ee + ff + gg + hh + ii + jj + kk + ll
|
||||
|
||||
body_pass := corporate_daftarpeserta.Body_GenPass(dialog_passbody_id, msg, corporate_daftarpeserta.JSGenPassReload("#"+dialog_password_id, link))
|
||||
|
||||
msg = "Success generate password.\n" + resp.Message + " password, telah dikirim melalui email peserta"
|
||||
toastt := customtoastv2.CustomToastV2Show("Success", msg, "success")
|
||||
ret := []templ.Component{toastt, body_pass}
|
||||
return utils.ViewMulti(c, ret)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleCloseDialogGenPass(c echo.Context) error {
|
||||
dialog_password_id := c.FormValue("dialog-password-id")
|
||||
dialog_passbody_id := c.FormValue("dialog-passbody-id")
|
||||
|
||||
msg := "Apakah anda yakin untuk me-generate password untuk seluruh peserta"
|
||||
body_pass := corporate_daftarpeserta.Body_GenPass(dialog_passbody_id, msg, corporate_daftarpeserta.JSHideModal("#"+dialog_password_id))
|
||||
return utils.View(c, body_pass)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleContentReload(c echo.Context) error {
|
||||
id := c.Param("id")
|
||||
keyword := c.FormValue("searchdp")
|
||||
|
||||
dialog_rptbody_id := c.QueryParam("dialog-rptbody-id")
|
||||
dialog_paketbody_id := c.QueryParam("dialog-paketbody-id")
|
||||
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
|
||||
dialog_attachbody_id := c.QueryParam("dialog-attachbody-id")
|
||||
|
||||
table_id := c.FormValue("table-id")
|
||||
pagination_id := c.FormValue("pagination-id")
|
||||
pageparam := c.FormValue("currpage" + pagination_id)
|
||||
currpage, err := strconv.Atoi(pageparam)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
peserta, total, err := tdp.TabDaftarPesertaServices.SearchDaftarPesertaMCU(id, keyword, currpage, 10)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
hxinclude := "#search-daftar-peserta, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #table-id, #pagination-id, #dialog-rpt-id, #dialog-rptbody-id, #dialog-akun-id, #dialog-akunbody-id, #dialog-password-id, #dialog-passbody-id, #dialog-attach-id, #dialog-attachbody-id, #dialog-paket-id, #dialog-paketbody-id"
|
||||
table := corporate_daftarpeserta.Table_DaftarPeserta(
|
||||
peserta, table_id,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openreport",
|
||||
"#"+dialog_rptbody_id, hxinclude, "outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/opendetail",
|
||||
"#"+dialog_paketbody_id, hxinclude, "outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openviewakun",
|
||||
"#"+dialog_akunbody_id, hxinclude, "outerHTML",
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openattachment",
|
||||
"#"+dialog_attachbody_id, hxinclude, "outerHTML",
|
||||
)
|
||||
|
||||
pagination := pagination.PaginationV3(
|
||||
total, currpage, "/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/changepage", pagination_id,
|
||||
hxinclude, "#content-dp", "outerHTML", "", "", corporate_daftarpeserta.BeforeRequestContent(), corporate_daftarpeserta.AfterRequestContent(),
|
||||
)
|
||||
|
||||
clayout := corporate_daftarpeserta.Content(table, pagination)
|
||||
return utils.View(c, clayout)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleOpenViewAkun(c echo.Context) error {
|
||||
patient_id := c.QueryParam("patid")
|
||||
dialog_akun_id := c.QueryParam("dialog-akun-id")
|
||||
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
|
||||
|
||||
akun, err := tdp.TabDaftarPesertaServices.GetAkunPeserta(patient_id)
|
||||
if err != nil {
|
||||
body := corporate_daftarpeserta.Body_Account(
|
||||
dialog_akunbody_id,
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "ID Akun Peserta",
|
||||
Name: "akunpesertaid",
|
||||
Type: "hidden",
|
||||
ID: "akunpesertaidid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Email",
|
||||
Name: "akunpesertaemail",
|
||||
Type: "text",
|
||||
ID: "akunpesertaemailid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Password baru",
|
||||
Name: "akunpesertapassnew",
|
||||
Type: "password",
|
||||
ID: "akunpesertapassnewid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Ulangi password baru",
|
||||
Name: "akunpesertapasscek",
|
||||
Type: "password",
|
||||
ID: "akunpesertapasscekid",
|
||||
},
|
||||
corporate_daftarpeserta.JSShowModal(""),
|
||||
)
|
||||
toast := customtoastv2.CustomToastV2Show("Warning", "Gagal mengambil data peserta", "warning")
|
||||
ret := []templ.Component{toast, body}
|
||||
return utils.ViewMulti(c, ret)
|
||||
}
|
||||
|
||||
body := corporate_daftarpeserta.Body_Account(
|
||||
dialog_akunbody_id,
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "ID Akun Peserta",
|
||||
Name: "akunpesertaid",
|
||||
Type: "hidden",
|
||||
ID: "akunpesertaidid",
|
||||
Value: strconv.Itoa(akun.AuthPatientID),
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Email",
|
||||
Name: "akunpesertaemail",
|
||||
Type: "text",
|
||||
ID: "akunpesertaemailid",
|
||||
Value: akun.AuthPatientEmail,
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Password baru",
|
||||
Name: "akunpesertapassnew",
|
||||
Type: "password",
|
||||
ID: "akunpesertapassnewid",
|
||||
Placeholder: "Masukan password baru",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Ulangi password baru",
|
||||
Name: "akunpesertapasscek",
|
||||
Type: "password",
|
||||
ID: "akunpesertapasscekid",
|
||||
Placeholder: "Masukan password baru",
|
||||
},
|
||||
corporate_daftarpeserta.JSShowModal("#"+dialog_akun_id),
|
||||
)
|
||||
return utils.View(c, body)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleCloseViewAkun(c echo.Context) error {
|
||||
dialog_akun_id := c.QueryParam("dialog-akun-id")
|
||||
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
|
||||
|
||||
body := corporate_daftarpeserta.Body_Account(
|
||||
dialog_akunbody_id,
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "ID Akun Peserta",
|
||||
Name: "akunpesertaid",
|
||||
Type: "hidden",
|
||||
ID: "akunpesertaidid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Email",
|
||||
Name: "akunpesertaemail",
|
||||
Type: "text",
|
||||
ID: "akunpesertaemailid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Password baru",
|
||||
Name: "akunpesertapassnew",
|
||||
Type: "password",
|
||||
ID: "akunpesertapassnewid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Ulangi password baru",
|
||||
Name: "akunpesertapasscek",
|
||||
Type: "password",
|
||||
ID: "akunpesertapasscekid",
|
||||
},
|
||||
corporate_daftarpeserta.JSHideModal("#"+dialog_akun_id),
|
||||
)
|
||||
return utils.View(c, body)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleAkun(c echo.Context) error {
|
||||
user_token := c.Get("user").(*jwt.Token)
|
||||
token := user_token.Raw
|
||||
|
||||
// patient_id := c.QueryParam("patid")
|
||||
dialog_akun_id := c.QueryParam("dialog-akun-id")
|
||||
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
|
||||
|
||||
akunID := c.FormValue("akunpesertaid")
|
||||
akunEmail := c.FormValue("akunpesertaemail")
|
||||
newPass := c.FormValue("akunpesertapassnew")
|
||||
newPasscek := c.FormValue("akunpesertapasscek")
|
||||
|
||||
formValidation := ""
|
||||
newValidation := ""
|
||||
cekValidation := ""
|
||||
|
||||
if strings.TrimSpace(newPass) == "" {
|
||||
formValidation = "Password tidak boleh kosong"
|
||||
newValidation = "Password tidak boleh kosong"
|
||||
}
|
||||
if strings.TrimSpace(newPasscek) == "" {
|
||||
formValidation = "Password tidak boleh kosong"
|
||||
cekValidation = "Password tidak boleh kosong"
|
||||
}
|
||||
if strings.TrimSpace(newPass) == "" && strings.TrimSpace(newPasscek) == "" {
|
||||
formValidation = "Password baru tidak boleh kosong"
|
||||
newValidation = "Password baru tidak boleh kosong"
|
||||
cekValidation = "Password baru tidak boleh kosong"
|
||||
}
|
||||
if strings.TrimSpace(newPass) != strings.TrimSpace(newPasscek) {
|
||||
formValidation = "Password tidak sama"
|
||||
newValidation = "Password tidak sama"
|
||||
cekValidation = "Password tidak sama"
|
||||
}
|
||||
|
||||
if formValidation != "" || newValidation != "" || cekValidation != "" {
|
||||
body := corporate_daftarpeserta.Body_Account(
|
||||
dialog_akunbody_id,
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "ID Akun Peserta",
|
||||
Name: "akunpesertaid",
|
||||
Type: "hidden",
|
||||
ID: "akunpesertaidid",
|
||||
Value: akunID,
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Email",
|
||||
Name: "akunpesertaemail",
|
||||
Type: "text",
|
||||
ID: "akunpesertaemailid",
|
||||
Value: akunEmail,
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Password baru",
|
||||
Name: "akunpesertapassnew",
|
||||
Type: "password",
|
||||
ID: "akunpesertapassnewid",
|
||||
ErrorMsg: newValidation,
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Ulangi password baru",
|
||||
Name: "akunpesertapasscek",
|
||||
Type: "password",
|
||||
ID: "akunpesertapasscekid",
|
||||
ErrorMsg: cekValidation,
|
||||
},
|
||||
corporate_daftarpeserta.JSShowModal(""),
|
||||
)
|
||||
toast := customtoastv2.CustomToastV2Show("Warning", formValidation, "warning")
|
||||
ret := []templ.Component{toast, body}
|
||||
return utils.ViewMulti(c, ret)
|
||||
}
|
||||
|
||||
resp, err := tdp.TabDaftarPesertaServices.ResetPasswordPeserta(token, newPass, akunEmail, akunID)
|
||||
body_err := corporate_daftarpeserta.Body_Account(
|
||||
dialog_akunbody_id,
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "ID Akun Peserta",
|
||||
Name: "akunpesertaid",
|
||||
Type: "hidden",
|
||||
ID: "akunpesertaidid",
|
||||
Value: akunID,
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Email",
|
||||
Name: "akunpesertaemail",
|
||||
Type: "text",
|
||||
ID: "akunpesertaemailid",
|
||||
Value: akunEmail,
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Password baru",
|
||||
Name: "akunpesertapassnew",
|
||||
Type: "password",
|
||||
ID: "akunpesertapassnewid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Ulangi password baru",
|
||||
Name: "akunpesertapasscek",
|
||||
Type: "password",
|
||||
ID: "akunpesertapasscekid",
|
||||
},
|
||||
corporate_daftarpeserta.JSShowModal(""),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
toastt := customtoastv2.CustomToastV2Show("Warning", err.Error(), "warning")
|
||||
return utils.ViewMulti(c, []templ.Component{toastt, body_err})
|
||||
}
|
||||
|
||||
if resp.Status == "ERR" {
|
||||
toastt := customtoastv2.CustomToastV2Show("Warning", resp.Message, "warning")
|
||||
return utils.ViewMulti(c, []templ.Component{toastt, body_err})
|
||||
}
|
||||
|
||||
body_scs := corporate_daftarpeserta.Body_Account(
|
||||
dialog_akunbody_id,
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "ID Akun Peserta",
|
||||
Name: "akunpesertaid",
|
||||
Type: "hidden",
|
||||
ID: "akunpesertaidid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Email",
|
||||
Name: "akunpesertaemail",
|
||||
Type: "text",
|
||||
ID: "akunpesertaemailid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Password baru",
|
||||
Name: "akunpesertapassnew",
|
||||
Type: "password",
|
||||
ID: "akunpesertapassnewid",
|
||||
},
|
||||
models.CustomTextFieldv2Prm{
|
||||
Label: "Ulangi password baru",
|
||||
Name: "akunpesertapasscek",
|
||||
Type: "password",
|
||||
ID: "akunpesertapasscekid",
|
||||
},
|
||||
corporate_daftarpeserta.JSHideModal("#"+dialog_akun_id),
|
||||
)
|
||||
toasttt := customtoastv2.CustomToastV2Show("Success", "Berhasil reset password peserta", "success")
|
||||
return utils.ViewMulti(c, []templ.Component{toasttt, body_scs})
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleOpenDetail(c echo.Context) error {
|
||||
idx := c.QueryParam("idx")
|
||||
dialog_paket_id := c.QueryParam("dialog-paket-id")
|
||||
dialog_paketbody_id := c.QueryParam("dialog-paketbody-id")
|
||||
|
||||
paket, err := tdp.TabDaftarPesertaServices.DetailTestdanPaket(idx)
|
||||
if err != nil {
|
||||
toastt := customtoastv2.CustomToastV2Show("Warning", "error get data", "error")
|
||||
tab := corporate_daftarpeserta.Table_DetailPaket([]models.TableTestPaket{})
|
||||
mod := corporate_daftarpeserta.Body_Detail(dialog_paketbody_id, tab, corporate_daftarpeserta.JSHideModal("#"+dialog_paket_id))
|
||||
return utils.ViewMulti(c, []templ.Component{toastt, mod})
|
||||
}
|
||||
|
||||
table := corporate_daftarpeserta.Table_DetailPaket(paket)
|
||||
body := corporate_daftarpeserta.Body_Detail(dialog_paketbody_id, table, corporate_daftarpeserta.JSShowModal("#"+dialog_paket_id))
|
||||
return utils.View(c, body)
|
||||
}
|
||||
|
||||
func (tdp *TabDaftarPesertaHandlers) HandleOpenAttachmentFile(c echo.Context) error {
|
||||
idx := c.QueryParam("idx")
|
||||
dialog_attach_id := c.QueryParam("dialog-attach-id")
|
||||
dialog_attachbody_id := c.QueryParam("dialog-attachbody-id")
|
||||
|
||||
file, err := tdp.TabDaftarPesertaServices.GetListAttachmentFile(idx)
|
||||
if err != nil {
|
||||
toastt := customtoastv2.CustomToastV2Show("Error", "error get data", "error")
|
||||
tab := corporate_daftarpeserta.Tab_Attachment([]models.AttachmentFIle{})
|
||||
mod := corporate_daftarpeserta.Body_Attachment(dialog_attachbody_id, tab, corporate_daftarpeserta.JSHideModal("#"+dialog_attach_id))
|
||||
return utils.ViewMulti(c, []templ.Component{toastt, mod})
|
||||
}
|
||||
|
||||
tab := corporate_daftarpeserta.Tab_Attachment(file)
|
||||
body := corporate_daftarpeserta.Body_Attachment(dialog_attachbody_id, tab, corporate_daftarpeserta.JSShowModal("#"+dialog_attach_id))
|
||||
return utils.View(c, body)
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/component/chart"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_kelainanfisik "cpone/views/corporate/mcu/mcutab/kelainanfisik"
|
||||
"strings"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type TabKelainanFisikServices interface {
|
||||
GetKelainanFisikBMI(mcuID string) (models.Piechart, error)
|
||||
GetKelainanFisikHipertensi(mcuID string) (models.Piechart, error)
|
||||
GetKelainanFisikRefraksi(mcuID string) (models.Piechart, error)
|
||||
GetKelainanFisikPresentase(mcuID string) (models.Barchart, error)
|
||||
GetKelFisikAlkohol(mcuID string) (models.Piechart, error)
|
||||
GetKelFisikMerokok(mcuID string) (models.Piechart, error)
|
||||
GetKelFisikOlahraga(mcuID string) (models.Piechart, error)
|
||||
GetChartRenderFisik(mcuID string) ([]models.McuTabModels, error)
|
||||
}
|
||||
|
||||
type TabKelainanFisikHandler struct {
|
||||
TabKelainanFisikServices TabKelainanFisikServices
|
||||
}
|
||||
|
||||
func NewTabKelainanFisikHandler(tkf TabKelainanFisikServices) *TabKelainanFisikHandler {
|
||||
return &TabKelainanFisikHandler{
|
||||
TabKelainanFisikServices: tkf,
|
||||
}
|
||||
}
|
||||
|
||||
func (tkf *TabKelainanFisikHandler) HandleShowTabKelainanFisik(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
logger.Info("Tab Kelainan Fisik")
|
||||
|
||||
id := c.Param("id")
|
||||
|
||||
chartsxs := []templ.Component{}
|
||||
chartsmd := []templ.Component{}
|
||||
chartslg := []templ.Component{}
|
||||
|
||||
tablist, err := tkf.TabKelainanFisikServices.GetChartRenderFisik(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, d := range tablist {
|
||||
chartsxs = append(chartsxs, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"xs", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
chartsmd = append(chartsmd, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"md", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
chartslg = append(chartslg, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"lg", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
}
|
||||
|
||||
content := corporate_kelainanfisik.KelainanFisikScreen(chartsxs, chartsmd, chartslg)
|
||||
return utils.View(c, content)
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/component/chart"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_kelainanglobal "cpone/views/corporate/mcu/mcutab/kelainanglobal"
|
||||
"strings"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type TabKelainanGlobalServices interface {
|
||||
GetKelainanFisik(mcuID string) (models.Barchart, error)
|
||||
GetKelainanGlobalV2(mcuID string) (models.Barchart, error)
|
||||
GetChartRenderGlobal(mcuID string) ([]models.McuTabModels, error)
|
||||
}
|
||||
|
||||
type TabKelainanGlobalHandler struct {
|
||||
TabKelainanGlobalServices TabKelainanGlobalServices
|
||||
}
|
||||
|
||||
func NewTabKelainanGlobalHandler(tkg TabKelainanGlobalServices) *TabKelainanGlobalHandler {
|
||||
return &TabKelainanGlobalHandler{
|
||||
TabKelainanGlobalServices: tkg,
|
||||
}
|
||||
}
|
||||
|
||||
func (tkg *TabKelainanGlobalHandler) HandleShowTabKelainanGlobal(c echo.Context) error {
|
||||
id := c.Param("id")
|
||||
|
||||
chartsxs := []templ.Component{}
|
||||
chartsmd := []templ.Component{}
|
||||
chartslg := []templ.Component{}
|
||||
|
||||
tablist, err := tkg.TabKelainanGlobalServices.GetChartRenderGlobal(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, d := range tablist {
|
||||
chartsxs = append(chartsxs, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"xs", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
chartsmd = append(chartsmd, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"md", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
chartslg = append(chartslg, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"lg", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
}
|
||||
|
||||
content := corporate_kelainanglobal.KelainanGlobal_Screen(chartsxs, chartsmd, chartslg)
|
||||
return utils.View(c, content)
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/component/chart"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
|
||||
corporate_kelainanlab "cpone/views/corporate/mcu/mcutab/kelainanlab"
|
||||
"strings"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type TabKelainanLabServices interface {
|
||||
GetDataPresentaseKelainanLab(mcuID string) (models.Barchart, error)
|
||||
GetHematologi(mcuID string) (models.BarchartV2, error)
|
||||
GetUrinalisa(mcuID string) (models.BarchartV2, error)
|
||||
GetGangguanFungsiHati(mcuID string) (models.BarchartV2, error)
|
||||
GetGangguanMetabolismeLemak(mcuID string) (models.BarchartV2, error)
|
||||
GetPeningkatanGlukosa(mcuID string) (models.BarchartV2, error)
|
||||
GetChartRenderLab(mcuID string) ([]models.McuTabModels, error)
|
||||
}
|
||||
|
||||
type TabKelainanLabHandler struct {
|
||||
TabKelainanLabServices TabKelainanLabServices
|
||||
}
|
||||
|
||||
func NewTabKelainanLabHandler(tkl TabKelainanLabServices) *TabKelainanLabHandler {
|
||||
return &TabKelainanLabHandler{
|
||||
TabKelainanLabServices: tkl,
|
||||
}
|
||||
}
|
||||
|
||||
func (tkl *TabKelainanLabHandler) HandleShowTabKelainanLab(c echo.Context) error {
|
||||
id := c.Param("id")
|
||||
|
||||
tablist, err := tkl.TabKelainanLabServices.GetChartRenderLab(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
chartsxs := []templ.Component{}
|
||||
chartsmd := []templ.Component{}
|
||||
chartslg := []templ.Component{}
|
||||
|
||||
for _, d := range tablist {
|
||||
chartsxs = append(chartsxs, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"xs", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
chartsmd = append(chartsmd, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"md", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
chartslg = append(chartslg, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"lg", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
}
|
||||
|
||||
content := corporate_kelainanlab.KelainanLabScreen(chartsxs, chartsmd, chartslg)
|
||||
|
||||
return utils.View(c, content)
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/component/chart"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_kelainannonlab "cpone/views/corporate/mcu/mcutab/kelainannonlab"
|
||||
"strings"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type TabKelainanNonLabServices interface {
|
||||
GetDataKelNonLab(mcuID string) (models.Barchart, error)
|
||||
GetThoraxPA(mcuID string) (models.BarchartV2, error)
|
||||
GetGangguanJantung(mcuID string) (models.BarchartV2, error)
|
||||
GetAutospirometri(mcuID string) (models.BarchartV2, error)
|
||||
GetPendengaran(mcuID string) (models.BarchartV2, error)
|
||||
GetChartRenderNonLab(mcuID string) ([]models.McuTabModels, error)
|
||||
}
|
||||
|
||||
type TabKelainanNonLabHandler struct {
|
||||
TabKelainanNonLabServices TabKelainanNonLabServices
|
||||
}
|
||||
|
||||
func NewTabKelainanNonLabHandler(tknl TabKelainanNonLabServices) *TabKelainanNonLabHandler {
|
||||
return &TabKelainanNonLabHandler{
|
||||
TabKelainanNonLabServices: tknl,
|
||||
}
|
||||
}
|
||||
|
||||
func (tknl *TabKelainanNonLabHandler) HandleShowTabKelainanNonLab(c echo.Context) error {
|
||||
id := c.Param("id")
|
||||
|
||||
chartsxs := []templ.Component{}
|
||||
chartsmd := []templ.Component{}
|
||||
chartslg := []templ.Component{}
|
||||
|
||||
tablist, err := tknl.TabKelainanNonLabServices.GetChartRenderNonLab(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, d := range tablist {
|
||||
chartsxs = append(chartsxs, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"xs", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
chartsmd = append(chartsmd, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"md", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
chartslg = append(chartslg, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"lg", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
}
|
||||
|
||||
content := corporate_kelainannonlab.KelainanNonlabScreen(chartsxs, chartsmd, chartslg)
|
||||
return utils.View(c, content)
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/component/chart"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_kepesertaan "cpone/views/corporate/mcu/mcutab/kepesertaan"
|
||||
"strings"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type TabKepersertaanServices interface {
|
||||
GetTotalKepesertaanMCU(mcuID string) (models.Piechart, error)
|
||||
GetKepesertaanByGender(mcuID string) (models.Piechart, error)
|
||||
GetKepesertaanByUmur(mcuID string) (models.Piechart, error)
|
||||
GetChartRenderPeserta(mcuID string) ([]models.McuTabModels, error)
|
||||
}
|
||||
|
||||
type TabKepersertaanHandler struct {
|
||||
TabKepersertaanServices TabKepersertaanServices
|
||||
}
|
||||
|
||||
func NewTabKepersertaanHandler(tkh TabKepersertaanServices) *TabKepersertaanHandler {
|
||||
return &TabKepersertaanHandler{
|
||||
TabKepersertaanServices: tkh,
|
||||
}
|
||||
}
|
||||
|
||||
func (tkh *TabKepersertaanHandler) HandleShowTabKepesertaan(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
logger.Info("Tab Kepesertaan")
|
||||
|
||||
id := c.Param("id")
|
||||
logger.Info("Params", zap.Any("id", id))
|
||||
|
||||
tablist, err := tkh.TabKepersertaanServices.GetChartRenderPeserta(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
chartsxs := []templ.Component{}
|
||||
chartsmd := []templ.Component{}
|
||||
chartslg := []templ.Component{}
|
||||
|
||||
for _, d := range tablist {
|
||||
chartsxs = append(chartsxs, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"xs", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
chartsmd = append(chartsmd, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"md", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
chartslg = append(chartslg, chart.ShowChartResponsiveWidth(
|
||||
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"lg", " ", "")),
|
||||
d.Mcu_ImageGrafikJsonRender,
|
||||
"450px",
|
||||
))
|
||||
}
|
||||
|
||||
content := corporate_kepesertaan.KepesertaanScreen(chartsxs, chartsmd, chartslg)
|
||||
return utils.View(c, content)
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_kesimpulan "cpone/views/corporate/mcu/mcutab/kesimpulan"
|
||||
"fmt"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type TabKesimpulanServices interface {
|
||||
GetListKesimpulanLab(id string) ([]models.ModelKesimpulanLab, error)
|
||||
GetListKesimpulanNonLab(id string) ([]models.ModelKesimpulanLab, error)
|
||||
GetListKesimpulanFisik(id string) ([]models.ModelKesimpulanLab, error)
|
||||
GetListKesimpulanLabV2(id string) ([]models.ModelKesimpulanLab, error)
|
||||
GetListKesimpulanNonLabV2(id string) ([]models.ModelKesimpulanLab, error)
|
||||
GetListKesimpulanFisikV2(id string) ([]models.ModelKesimpulanLab, error)
|
||||
}
|
||||
|
||||
type TabKesimpulanHandler struct {
|
||||
TabKesimpulanServices TabKesimpulanServices
|
||||
}
|
||||
|
||||
func NewTabKesimpulanHandler(us TabKesimpulanServices) *TabKesimpulanHandler {
|
||||
return &TabKesimpulanHandler{
|
||||
TabKesimpulanServices: us,
|
||||
}
|
||||
}
|
||||
|
||||
func (tkh *TabKesimpulanHandler) HandleShowTabKesimpulanScreen(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
tableID := utils.GenerateRandomID("table-id")
|
||||
id := c.Param("id")
|
||||
|
||||
dataLab, err := tkh.TabKesimpulanServices.GetListKesimpulanLabV2(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST LAB",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataLab)
|
||||
return err
|
||||
}
|
||||
// tableComponentLab := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Lab terbesar :", dataLab, tableID)
|
||||
tableComponentLab := corporate_kesimpulan.Table_Kesimpulan("3 Kelainan Pemeriksaan Lab terbesar :", dataLab, tableID)
|
||||
|
||||
dataNonLab, err := tkh.TabKesimpulanServices.GetListKesimpulanNonLabV2(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST NON LAB",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataNonLab)
|
||||
return err
|
||||
}
|
||||
tableComponentNonLab := corporate_kesimpulan.Table_Kesimpulan("3 Kelainan Pemeriksaan Non Lab terbesar :", dataNonLab, tableID)
|
||||
|
||||
dataFisik, err := tkh.TabKesimpulanServices.GetListKesimpulanFisikV2(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST FISIK",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataFisik)
|
||||
return err
|
||||
}
|
||||
tableComponentFisik := corporate_kesimpulan.Table_Kesimpulan("3 Kelainan Pemeriksaan Fisik terbesar :", dataFisik, tableID)
|
||||
|
||||
// content := corporate_mcudetail.MainKesimpulan(
|
||||
// tableID,
|
||||
// tableComponentLab,
|
||||
// tableComponentNonLab,
|
||||
// tableComponentFisik,
|
||||
// )
|
||||
|
||||
content := corporate_kesimpulan.KesimpulanScreen(tableID, tableComponentLab, tableComponentNonLab, tableComponentFisik)
|
||||
|
||||
return utils.View(c, content)
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/component/pagination"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_keuangan "cpone/views/corporate/mcu/mcutab/keuangan"
|
||||
"strconv"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type TabKeuanganServices interface {
|
||||
GetTotalOrderKeuangan(mcuID string) (int, error)
|
||||
GetTotalCardData(mcuID string) (models.TotalBillCard, error)
|
||||
GetListingDataKeuangan(mcuID string, currentpage int, rowperpage int) ([]models.KeuanganModel, int, error)
|
||||
}
|
||||
|
||||
type TabKeuanganHandler struct {
|
||||
TabKeuanganServices TabKeuanganServices
|
||||
}
|
||||
|
||||
func NewTabKeuanganHandler(tk TabKeuanganServices) *TabKeuanganHandler {
|
||||
return &TabKeuanganHandler{
|
||||
TabKeuanganServices: tk,
|
||||
}
|
||||
}
|
||||
|
||||
func (tk *TabKeuanganHandler) HandleShowTabKeuangan(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
logger.Info("handler keuangan")
|
||||
tableID := utils.GenerateRandomID("table-id")
|
||||
paginationID := utils.GenerateRandomID("pagination-id")
|
||||
|
||||
id := c.Param("id")
|
||||
logger.Info("Params", zap.Any("id", id))
|
||||
|
||||
dataTable, totalPage, err := tk.TabKeuanganServices.GetListingDataKeuangan(id, 1, 10)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("error get list data keuangan", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
tablecompo := corporate_keuangan.Table_Keuangan(dataTable, tableID)
|
||||
|
||||
pagination := pagination.PaginationV3(
|
||||
totalPage,
|
||||
1,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabkeuangan/changepage",
|
||||
paginationID,
|
||||
"#table-id, #pagination-id, #loading-parent, #loading-child, #loading-spinner, #loadingcontent",
|
||||
"#content-uang",
|
||||
"outerHTML", "", "",
|
||||
corporate_keuangan.BeforeRequestContent(),
|
||||
corporate_keuangan.AfterRequestContent(),
|
||||
)
|
||||
|
||||
totalOrder, err := tk.TabKeuanganServices.GetTotalOrderKeuangan(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("error get total order keuangan", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
totalBill, err := tk.TabKeuanganServices.GetTotalCardData(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("error get total bill keuangan", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
totalOrderF := utils.FormatRibuan(int(totalOrder))
|
||||
totalTagihan := utils.FormatRibuan(int(totalBill.TotalTagihan))
|
||||
totalPelunasan := utils.FormatRibuan(int(totalBill.TotalPelunasan))
|
||||
totalHutang := utils.FormatRibuan(int(totalBill.TotalHutang))
|
||||
|
||||
content := corporate_keuangan.Tab_Keuangan(
|
||||
tableID, paginationID,
|
||||
corporate_keuangan.Summary_Card(totalOrderF, totalTagihan, totalPelunasan, totalHutang),
|
||||
corporate_keuangan.Content(tablecompo, pagination),
|
||||
)
|
||||
|
||||
return utils.View(c, content)
|
||||
}
|
||||
|
||||
func (tk *TabKeuanganHandler) HandleChangePage(c echo.Context) error {
|
||||
pageparam := c.QueryParam("page")
|
||||
tableID := c.QueryParam("table-id")
|
||||
paginationID := c.QueryParam("pagination-id")
|
||||
|
||||
id := c.Param("id")
|
||||
|
||||
page, err := strconv.Atoi(pageparam)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
tableData, totalPage, err := tk.TabKeuanganServices.GetListingDataKeuangan(id, page, 10)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
tablecomp := corporate_keuangan.Table_Keuangan(tableData, tableID)
|
||||
pagination := pagination.PaginationV3(
|
||||
totalPage,
|
||||
page,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabkeuangan/changepage",
|
||||
paginationID,
|
||||
"#table-id, #pagination-id, #loading-parent, #loading-child, #loading-spinner, #loadingcontent",
|
||||
"#content-uang",
|
||||
"outerHTML", "", "",
|
||||
corporate_keuangan.BeforeRequestContent(),
|
||||
corporate_keuangan.AfterRequestContent(),
|
||||
)
|
||||
|
||||
tabdanpagi := corporate_keuangan.Content(tablecomp, pagination)
|
||||
return utils.View(c, tabdanpagi)
|
||||
}
|
||||
@@ -1,25 +1,13 @@
|
||||
package corporate_handlers
|
||||
|
||||
import (
|
||||
breadcrumadmin "cpone/component/breadcrumbadmin"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
"cpone/component/pagination"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_patient "cpone/views/corporate/patient"
|
||||
"strconv"
|
||||
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type PatientService interface {
|
||||
GetDashboardPatientBreadcrumb(title string) (models.BreadCrumbV1, error)
|
||||
GetListtingData(email string, currentpage int, rowperpage int) ([]models.DashboardPatient, int, error)
|
||||
GetPatientData(email string) (string, error)
|
||||
GetListReportPesertaV4(orderheaderID string, staffname string) ([]models.TabViewReportMcu, error)
|
||||
}
|
||||
|
||||
func NewPatientHandler(us PatientService) *PatientHandler {
|
||||
@@ -32,214 +20,7 @@ type PatientHandler struct {
|
||||
PatientService PatientService
|
||||
}
|
||||
|
||||
func (ph *PatientHandler) LoadLocalData(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
listID := c.QueryParam("listID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
dialogID := c.QueryParam("dialogID")
|
||||
dialogBodyID := c.QueryParam("dialogBodyID")
|
||||
userEmail := c.QueryParam("userEmail")
|
||||
logger.Info("params", zap.Any("email", userEmail))
|
||||
|
||||
title, err := ph.PatientService.GetPatientData(userEmail)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error get user", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
dataBreadcrumb, err := ph.PatientService.GetDashboardPatientBreadcrumb(title)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error breadcrumb", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
defer logger.Sync()
|
||||
breadcrumb := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadcrumb)
|
||||
|
||||
listingdata, totalPage, err := ph.PatientService.GetListtingData(userEmail, 1, 10)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("error get listing data", zap.Any("error", err), zap.Any("total", totalPage))
|
||||
return err
|
||||
}
|
||||
listingcomponent := corporate_patient.ListingData(listingdata,
|
||||
listID,
|
||||
"/corp/dashboard_pat/open",
|
||||
"#"+dialogBodyID,
|
||||
"#listID, #paginationID, #dialogID, #dialogBodyID, #userEmail",
|
||||
"outerHTML",
|
||||
)
|
||||
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
1,
|
||||
"/corp/dashboard_pat/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogID, #dialogBodyID, #userEmail",
|
||||
"#contentlayout",
|
||||
"outerHTML", "", "",
|
||||
corporate_patient.BeforeRequestContent(),
|
||||
corporate_patient.AfterRequestContent(),
|
||||
)
|
||||
|
||||
tabData := []models.TabViewReportMcu{}
|
||||
tabcomponent := corporate_patient.TabReportView(tabData)
|
||||
|
||||
bodyModal := corporate_patient.ModalBody(
|
||||
dialogBodyID,
|
||||
tabcomponent,
|
||||
corporate_patient.JsShowModal(""),
|
||||
)
|
||||
|
||||
bodyClose := corporate_patient.ModalClose(
|
||||
"/corp/dashboard_pat/closemodal",
|
||||
"#"+dialogBodyID,
|
||||
"outerHTML",
|
||||
"#"+dialogID,
|
||||
)
|
||||
|
||||
modalDialog := corporate_patient.DialogReport(
|
||||
"",
|
||||
"/corp/dashboard_pat/dialog",
|
||||
"#"+dialogBodyID,
|
||||
"outerHTML",
|
||||
"#listID, #paginationID, #dialogID, #userEmail, #dialogBodyID"+paginationID,
|
||||
dialogID,
|
||||
title,
|
||||
bodyModal,
|
||||
bodyClose,
|
||||
)
|
||||
|
||||
content := corporate_patient.ContentP(listingcomponent, paginationcomponent)
|
||||
|
||||
view := corporate_patient.ContentPage(
|
||||
breadcrumb,
|
||||
content,
|
||||
modalDialog,
|
||||
)
|
||||
|
||||
return utils.View(c, view)
|
||||
}
|
||||
|
||||
func (ph *PatientHandler) HandleShowPatient(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
listID := utils.GenerateRandomID("listid")
|
||||
paginationID := utils.GenerateRandomID("paginationid")
|
||||
dialogID := utils.GenerateRandomID("dialogid")
|
||||
dialogBodyID := utils.GenerateRandomID("dialogbodyid")
|
||||
|
||||
userCok := c.Get("user").(*jwt.Token)
|
||||
claims := userCok.Claims.(jwt.MapClaims)
|
||||
name := claims["M_StaffName"].(string)
|
||||
position := claims["M_UserGroupDashboard"].(string)
|
||||
logger.Info("jwt", zap.Any("name", name))
|
||||
|
||||
user := models.User{
|
||||
UserID: 1,
|
||||
Username: name,
|
||||
UserFullName: name,
|
||||
UserPosition: position,
|
||||
}
|
||||
|
||||
navbaruser := navbarmenu.NavbarWithLogo(user)
|
||||
sidbaruser := sidebaruserprofile.Navbaruserprofile(user)
|
||||
|
||||
content := corporate_patient.DashboardPat(
|
||||
listID,
|
||||
paginationID,
|
||||
dialogID,
|
||||
dialogBodyID,
|
||||
)
|
||||
css := corporate_patient.CSSDashboardPat()
|
||||
js := corporate_patient.JSDashboardPat()
|
||||
|
||||
view := corporate_patient.ShowDashboardPat("Dashboard Pasien", content, css, js, navbaruser, sidbaruser)
|
||||
return utils.View(c, view)
|
||||
}
|
||||
|
||||
func (ph *PatientHandler) HandleChangePage(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
pageparam := c.QueryParam("page")
|
||||
listID := c.QueryParam("listID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
dialogBodyID := c.QueryParam("dialogBodyID")
|
||||
userEmail := c.QueryParam("userEmail")
|
||||
logger.Info("params", zap.Any("userEmail", userEmail))
|
||||
|
||||
// var retval []templ.Component
|
||||
page, err := strconv.Atoi(pageparam)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("error convert page param")
|
||||
return err
|
||||
}
|
||||
|
||||
listData, totalPage, err := ph.PatientService.GetListtingData(userEmail, page, 10)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("error get data listing")
|
||||
return err
|
||||
}
|
||||
listcomponent := corporate_patient.ListingData(listData,
|
||||
listID,
|
||||
"/corp/dashboard_pat/open",
|
||||
"#"+dialogBodyID,
|
||||
"#listID, #paginationID, #dialogID, #dialogBodyID, #userEmail",
|
||||
"outerHTML",
|
||||
)
|
||||
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
page,
|
||||
"/corp/dashboard_pat/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogID, #dialogBodyID, #userEmail, #currPage"+paginationID,
|
||||
"#contentlayout",
|
||||
"outerHTML", "", "",
|
||||
corporate_patient.BeforeRequestContent(),
|
||||
corporate_patient.AfterRequestContent(),
|
||||
)
|
||||
|
||||
// retval = append(retval, listcomponent)
|
||||
// retval = append(retval, paginationcomponent)
|
||||
// return utils.ViewMulti(c, retval)
|
||||
|
||||
content := corporate_patient.ContentP(listcomponent, paginationcomponent)
|
||||
return utils.View(c, content)
|
||||
}
|
||||
|
||||
func (ph *PatientHandler) HandleOpenReport(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
id := c.QueryParam("id")
|
||||
dialogID := c.QueryParam("dialogID")
|
||||
dialogBodyID := c.QueryParam("dialogBodyID")
|
||||
logger.Info("params", zap.Any("id", id))
|
||||
|
||||
userCok := c.Get("user").(*jwt.Token)
|
||||
claims := userCok.Claims.(jwt.MapClaims)
|
||||
staffname := claims["M_StaffName"].(string)
|
||||
|
||||
newtabdata, err := ph.PatientService.GetListReportPesertaV4(id, staffname)
|
||||
if err != nil {
|
||||
tab := corporate_patient.TabReportView([]models.TabViewReportMcu{})
|
||||
mod := corporate_patient.ModalBody(
|
||||
dialogBodyID,
|
||||
tab,
|
||||
corporate_patient.JsShowModal(""),
|
||||
)
|
||||
return utils.View(c, mod)
|
||||
}
|
||||
|
||||
tabcomponent := corporate_patient.TabReportView(newtabdata)
|
||||
modalBody := corporate_patient.ModalBody(
|
||||
dialogBodyID,
|
||||
tabcomponent,
|
||||
corporate_patient.JsShowModal("#"+dialogID),
|
||||
)
|
||||
|
||||
return utils.View(c, modalBody)
|
||||
func (uh *PatientHandler) ShowPatient(c echo.Context) error {
|
||||
helo := corporate_patient.Show()
|
||||
return utils.View(c, helo)
|
||||
}
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
package dev_handlers
|
||||
|
||||
import (
|
||||
breadcrumadmin "cpone/component/breadcrumbadmin"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
"cpone/models"
|
||||
"cpone/services"
|
||||
"cpone/utils"
|
||||
dev_detailmcu "cpone/views/dev/mcu"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type DetailMcuServices interface {
|
||||
GetBreadcrumb(title string) (models.BreadCrumbV1, error)
|
||||
}
|
||||
|
||||
type DetailMcuHandler struct {
|
||||
DetailMcuServices DetailMcuServices
|
||||
}
|
||||
|
||||
func NewDetailMcuHandler(dmcu DetailMcuServices) *DetailMcuHandler {
|
||||
return &DetailMcuHandler{
|
||||
DetailMcuServices: dmcu,
|
||||
}
|
||||
}
|
||||
|
||||
func (dmcu *DetailMcuHandler) HandleShowDetailMcuScreen(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
title := "PT. Sadhana Abiyasa Sampoerna"
|
||||
|
||||
id := c.Param("id")
|
||||
logger.Info("params", zap.Any("id", id))
|
||||
|
||||
user, err := services.GetUserLogin()
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error get user dev", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
dataBreadcrumb, err := dmcu.DetailMcuServices.GetBreadcrumb(title)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error breadcrumb dev", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
breadcrumb := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadcrumb)
|
||||
navbaruser := navbarmenu.NavbarWithLogo(user)
|
||||
sidbaruser := sidebaruserprofile.Navbaruserprofile(user)
|
||||
|
||||
content := dev_detailmcu.DetailMcuScreen(
|
||||
breadcrumb,
|
||||
dev_detailmcu.TabViewDetailMcu(id),
|
||||
)
|
||||
css := dev_detailmcu.CSSDetailMcu()
|
||||
js := dev_detailmcu.JSDetailMcu()
|
||||
|
||||
view := dev_detailmcu.ShowDetailMcu(
|
||||
title,
|
||||
content,
|
||||
css,
|
||||
js,
|
||||
navbaruser,
|
||||
sidbaruser,
|
||||
)
|
||||
|
||||
return utils.View(c, view)
|
||||
}
|
||||
@@ -1,192 +0,0 @@
|
||||
package dev_handlers
|
||||
|
||||
import (
|
||||
breadcrumadmin "cpone/component/breadcrumbadmin"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
"cpone/component/pagination"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
"cpone/models"
|
||||
"cpone/services"
|
||||
"cpone/utils"
|
||||
dev_employeeanalytic "cpone/views/dev/employeeanalytic"
|
||||
"strconv"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type EmployeeAnalyticServices interface {
|
||||
GetEmployeeAnalyticBreadcrumb(title string) (models.BreadCrumbV1, error)
|
||||
DummyDataTest() ([]models.DashboardPic, error)
|
||||
ListingEmployeeAnalytic(search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.DashboardPic, int, error)
|
||||
}
|
||||
|
||||
type EmployeeAnalyticHandler struct {
|
||||
EmployeeAnalyticServices EmployeeAnalyticServices
|
||||
}
|
||||
|
||||
func NewEmployeeAnalyticHandler(ea EmployeeAnalyticServices) *EmployeeAnalyticHandler {
|
||||
return &EmployeeAnalyticHandler{
|
||||
EmployeeAnalyticServices: ea,
|
||||
}
|
||||
}
|
||||
|
||||
func (ea *EmployeeAnalyticHandler) HandleShowEmployeeAnalyticScreen(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
title := "PT. Sadhana Abiyasa Sampoerna"
|
||||
|
||||
listID := utils.GenerateRandomID("listid")
|
||||
paginationID := utils.GenerateRandomID("paginationid")
|
||||
|
||||
user, err := services.GetUserLogin()
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error get user dev", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
dataBreadcrumb, err := ea.EmployeeAnalyticServices.GetEmployeeAnalyticBreadcrumb(title)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error breadcrumb dev", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
defer logger.Sync()
|
||||
|
||||
navbaruser := navbarmenu.NavbarWithLogo(user)
|
||||
sidbaruser := sidebaruserprofile.Navbaruserprofile(user)
|
||||
breadcrumb := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadcrumb)
|
||||
|
||||
listingData, totalPage, err := ea.EmployeeAnalyticServices.ListingEmployeeAnalytic("", "", "", 1, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error get listing data", zap.Any("error", err), zap.Any("total", totalPage))
|
||||
return err
|
||||
}
|
||||
listingcomponent := dev_employeeanalytic.ListingData(listingData, listID)
|
||||
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
1,
|
||||
"/dev/dashboard_pic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID,
|
||||
"outerHTML", "", "",
|
||||
dev_employeeanalytic.BeforeRequestContent(),
|
||||
dev_employeeanalytic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
filtercomponent := dev_employeeanalytic.FilterListing(
|
||||
"/dev/dashboard_pic/filter",
|
||||
"input changed delay:500ms",
|
||||
"#searchID, #startdateID, #enddateID, #listID, #paginationID",
|
||||
"outerHTML",
|
||||
"#"+paginationID,
|
||||
dev_employeeanalytic.BeforeRequestContent(),
|
||||
dev_employeeanalytic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
content := dev_employeeanalytic.EmployeeAnalyticScreen(
|
||||
listID,
|
||||
paginationID,
|
||||
breadcrumb,
|
||||
filtercomponent,
|
||||
listingcomponent,
|
||||
paginationcomponent,
|
||||
)
|
||||
css := dev_employeeanalytic.CSSEmployeeAnalytic()
|
||||
js := dev_employeeanalytic.JSEmployeeAnalytic()
|
||||
|
||||
view := dev_employeeanalytic.ShowEmployeeAnalytic(title, content, css, js, navbaruser, sidbaruser)
|
||||
return utils.View(c, view)
|
||||
}
|
||||
|
||||
func (ea *EmployeeAnalyticHandler) HandlePagination(c echo.Context) error {
|
||||
|
||||
pageparam := c.QueryParam("page")
|
||||
listID := c.QueryParam("listID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
search := c.QueryParam("search")
|
||||
startdate := c.QueryParam("startdate")
|
||||
enddate := c.QueryParam("enddate")
|
||||
|
||||
var retVal []templ.Component
|
||||
logger, _ := zap.NewProduction()
|
||||
page, err := strconv.Atoi(pageparam)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error convert page param")
|
||||
return err
|
||||
}
|
||||
|
||||
listdata, totalPage, err := ea.EmployeeAnalyticServices.ListingEmployeeAnalytic(search, startdate, enddate, page, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error convert page param")
|
||||
return err
|
||||
}
|
||||
listcomponent := dev_employeeanalytic.ListingData(listdata, listID)
|
||||
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
page,
|
||||
"/dev/dashboard_pic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID,
|
||||
"outerHTML", "", "",
|
||||
dev_employeeanalytic.BeforeRequestContent(),
|
||||
dev_employeeanalytic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
retVal = append(retVal, listcomponent)
|
||||
retVal = append(retVal, paginationcomponent)
|
||||
return utils.ViewMulti(c, retVal)
|
||||
}
|
||||
|
||||
func (ea *EmployeeAnalyticHandler) HandleFilter(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
search := c.QueryParam("search")
|
||||
startdate := c.QueryParam("startdate")
|
||||
enddate := c.QueryParam("enddate")
|
||||
listID := c.QueryParam("listID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
|
||||
dataList, totalPage, err := ea.EmployeeAnalyticServices.ListingEmployeeAnalytic(search, startdate, enddate, 1, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error Get Listing Data", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
listcomponent := dev_employeeanalytic.ListingData(dataList, listID)
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage, 1,
|
||||
"/dev/dashboard_pic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID, "outerHTML", "", "",
|
||||
dev_employeeanalytic.BeforeRequestContent(),
|
||||
dev_employeeanalytic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
var retval []templ.Component
|
||||
retval = append(retval, listcomponent)
|
||||
retval = append(retval, paginationcomponent)
|
||||
return utils.ViewMulti(c, retval)
|
||||
}
|
||||
|
||||
func (ea *EmployeeAnalyticHandler) HandleIntoDetail(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
id := c.Param("id")
|
||||
|
||||
logger.Info("params", zap.Any("id", id))
|
||||
|
||||
url := "/dev/detail/" + id
|
||||
c.Response().Header().Set("HX-Redirect", url)
|
||||
|
||||
return nil
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,88 +0,0 @@
|
||||
package dev_handlers
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
dev_kesimpulan "cpone/views/dev/kesimpulan"
|
||||
"fmt"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type KesimpulanService interface {
|
||||
GetListKesimpulanLab(id string) ([]models.ModelKesimpulanLab, error)
|
||||
GetListKesimpulanNonLab(id string) ([]models.ModelKesimpulanLab, error)
|
||||
GetListKesimpulanFisik(id string) ([]models.ModelKesimpulanLab, error)
|
||||
}
|
||||
|
||||
func NewKesimpulanHandler(us KesimpulanService) *KesimpulanHandler {
|
||||
return &KesimpulanHandler{
|
||||
KesimpulanService: us,
|
||||
}
|
||||
}
|
||||
|
||||
type KesimpulanHandler struct {
|
||||
KesimpulanService KesimpulanService
|
||||
}
|
||||
|
||||
func (h *KesimpulanHandler) HandleShowKesimpulanScreen(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
tableID := utils.GenerateRandomID("tablebody")
|
||||
id := c.Param("id")
|
||||
|
||||
// table component
|
||||
dataLab, err := h.KesimpulanService.GetListKesimpulanLab(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST LAB",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataLab)
|
||||
return err
|
||||
}
|
||||
|
||||
logger.Info("CEK DATA",
|
||||
zap.Any("data lab", dataLab))
|
||||
|
||||
tableComponentLab := dev_kesimpulan.CardTableKesimpulan("3 Kelainan Pemeriksaan Lab terbesar :", dataLab, tableID)
|
||||
|
||||
// table component non lab
|
||||
dataNonLab, err := h.KesimpulanService.GetListKesimpulanNonLab(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST NON LAB",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataNonLab)
|
||||
return err
|
||||
}
|
||||
|
||||
logger.Info("CEK DATA",
|
||||
zap.Any("data lab", dataNonLab))
|
||||
tableComponentNonLab := dev_kesimpulan.CardTableKesimpulan("3 Kelainan Pemeriksaan Non Lab terbesar :", dataNonLab, tableID)
|
||||
|
||||
// table component fisik
|
||||
dataFisik, err := h.KesimpulanService.GetListKesimpulanFisik(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST FISIK",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataFisik)
|
||||
return err
|
||||
}
|
||||
|
||||
logger.Info("CEK DATA",
|
||||
zap.Any("data lab", dataFisik))
|
||||
tableComponentFisik := dev_kesimpulan.CardTableKesimpulan("3 Kelainan Pemeriksaan Fisik terbesar :", dataFisik, tableID)
|
||||
|
||||
content := dev_kesimpulan.MainKesimpulan(tableID,
|
||||
tableComponentLab,
|
||||
tableComponentNonLab,
|
||||
tableComponentFisik)
|
||||
|
||||
view := dev_kesimpulan.ShowKesimpulan("KESIMPULAN", content, dev_kesimpulan.CssKesimpulan(), dev_kesimpulan.JsKesimpulan())
|
||||
return utils.View(c, view)
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package dev_handlers
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
dev_mcudaftarpeserta "cpone/views/dev/mcu/daftarpeserta"
|
||||
"fmt"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type McuDaftarPesertaServices interface {
|
||||
GetListMcuDaftarPeserta(id string, currentPage int, rowPerPage int) ([]models.ModelMcuDaftarPeserta, int, error)
|
||||
}
|
||||
|
||||
type McuDaftarPesertaHandler struct {
|
||||
McuDaftarPesertaServices McuDaftarPesertaServices
|
||||
}
|
||||
|
||||
func NewMcuDaftarPeserta(mdp McuDaftarPesertaServices) *McuDaftarPesertaHandler {
|
||||
return &McuDaftarPesertaHandler{
|
||||
McuDaftarPesertaServices: mdp,
|
||||
}
|
||||
}
|
||||
|
||||
func (mdp *McuDaftarPesertaHandler) HandleGetMcuDaftarPeserta(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
id := c.Param("id")
|
||||
|
||||
// get listing data
|
||||
dataMcuDaftarPeserta, totalPage, err := mdp.McuDaftarPesertaServices.GetListMcuDaftarPeserta(id, 1, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST LAB",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataMcuDaftarPeserta)
|
||||
return err
|
||||
}
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("PESERTA",
|
||||
zap.Any("totalpage", totalPage),
|
||||
)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (mdp *McuDaftarPesertaHandler) HandleShowMcuDaftarPeserta(c echo.Context) error {
|
||||
title := "Daftar Peserta"
|
||||
|
||||
content := dev_mcudaftarpeserta.McuDaftarPesertaScreen()
|
||||
css := dev_mcudaftarpeserta.CSSMcuDaftarPeserta()
|
||||
js := dev_mcudaftarpeserta.JsMcuDaftarPeserta()
|
||||
|
||||
view := dev_mcudaftarpeserta.ShowMcuDafterPeserta(
|
||||
title,
|
||||
content,
|
||||
css,
|
||||
js,
|
||||
)
|
||||
|
||||
return utils.View(c, view)
|
||||
}
|
||||
@@ -1,954 +0,0 @@
|
||||
package dev_handlers
|
||||
|
||||
import (
|
||||
breadcrumadmin "cpone/component/breadcrumbadmin"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
"cpone/component/pagination"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
customtoastv2 "cpone/component/toastbootstrap"
|
||||
"cpone/models"
|
||||
"cpone/services"
|
||||
"cpone/utils"
|
||||
dev_mdbahanview "cpone/views/dev/mdbahan"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type MdBahanServices interface {
|
||||
GetListMdBahan(
|
||||
search string,
|
||||
stationID string,
|
||||
currentPage int,
|
||||
rowPerPage int) ([]models.Bahan, int, error)
|
||||
GetMdBahanBreadCrumb(title string) (models.BreadCrumbV1, error)
|
||||
GetListSampleStation(isFilter bool) ([]models.TmpSampleStation, error)
|
||||
AddMdBahan(code string, name string, stationid string) (bool, error)
|
||||
EditMdBahan(id string, code string, name string, stationid string) (bool, error)
|
||||
GetMdBahanByID(id string) (models.Bahan, error)
|
||||
DeleteMdBahan(id string) (bool, error)
|
||||
}
|
||||
|
||||
func NewMdBahanHandler(us MdBahanServices) *MdBahanHandler {
|
||||
return &MdBahanHandler{
|
||||
MdBahanServices: us,
|
||||
}
|
||||
}
|
||||
|
||||
type MdBahanHandler struct {
|
||||
MdBahanServices MdBahanServices
|
||||
}
|
||||
|
||||
func (lh *MdBahanHandler) HandleShowMdBahanScreen(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
dataMenu, err := services.GetMenu()
|
||||
paginationID := utils.GenerateRandomID("paginationID")
|
||||
modalAddID := utils.GenerateRandomID("modalAdd")
|
||||
modalAddBodyID := utils.GenerateRandomID("modalAddbody")
|
||||
modalEditID := utils.GenerateRandomID("modalEdit")
|
||||
modalEditBodyID := utils.GenerateRandomID("modalEditbody")
|
||||
modalDeleteID := utils.GenerateRandomID("modalDelete")
|
||||
modalDeleteBodyID := utils.GenerateRandomID("modalDeletebody")
|
||||
tableBahanID := utils.GenerateRandomID("BahanID")
|
||||
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR BREADCRUMB DEV",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
//get user login
|
||||
dataUser, err := services.GetUserLogin()
|
||||
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR BREADCRUMB DEV",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
return err
|
||||
}
|
||||
dataBreadCrumb, err := lh.MdBahanServices.GetMdBahanBreadCrumb("Bahan")
|
||||
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR BREADCRUMB DEV",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
//Breadcrumb component
|
||||
breadcrumbComponent := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadCrumb)
|
||||
// navbar menu
|
||||
navbarmenuComponent := navbarmenu.NavbarMenu(dataMenu)
|
||||
|
||||
// navbar user
|
||||
navbaruserComponent := navbarmenu.Navbar(dataUser)
|
||||
|
||||
// sidebar
|
||||
sidebaruserprofileComponent := sidebaruserprofile.Navbaruserprofile(dataUser)
|
||||
bahanList, totalPage, err := lh.MdBahanServices.GetListMdBahan("", "0", 1, 5)
|
||||
defer logger.Sync()
|
||||
logger.Info("GET DATA BAHAN",
|
||||
zap.Any("data", bahanList),
|
||||
zap.Any("err", err),
|
||||
zap.Any("totalPage", totalPage),
|
||||
)
|
||||
stationListFilter, err := lh.MdBahanServices.GetListSampleStation(true)
|
||||
defer logger.Sync()
|
||||
logger.Info("GET STATION LIST Filter",
|
||||
zap.Any("err", err),
|
||||
)
|
||||
stationList, err := lh.MdBahanServices.GetListSampleStation(false)
|
||||
defer logger.Sync()
|
||||
logger.Info("GET STATION LIST ",
|
||||
zap.Any("err", err),
|
||||
)
|
||||
|
||||
//Bahan Table
|
||||
// #dialogDeleteBodyID, #dialogDeleteID
|
||||
mdBahanTable := dev_mdbahanview.TableBahan(
|
||||
bahanList,
|
||||
tableBahanID,
|
||||
"/dev/md/bahan/openedit",
|
||||
"#"+modalEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/md/bahan/opendelete",
|
||||
"#"+modalDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogDeleteBodyID, #dialogDeleteID, #dialogEditBodyID, #dialogEditID")
|
||||
|
||||
//FIlter table
|
||||
mdBahanFilter := dev_mdbahanview.MdBahanFilter(
|
||||
"/dev/md/bahan/filter",
|
||||
"input changed delay:500ms",
|
||||
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
|
||||
"outerHTML",
|
||||
"#"+paginationID,
|
||||
stationListFilter,
|
||||
stationListFilter[0].T_SampleStationID,
|
||||
dev_mdbahanview.BeforeRequestContent(),
|
||||
dev_mdbahanview.AfterRequestContent(),
|
||||
)
|
||||
|
||||
//Pagination
|
||||
|
||||
mdbahanPagination := pagination.PaginationV3(
|
||||
totalPage, 1,
|
||||
"/dev/md/bahan/pagination",
|
||||
paginationID,
|
||||
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
|
||||
"#"+paginationID,
|
||||
"outerHTML",
|
||||
"",
|
||||
"",
|
||||
dev_mdbahanview.BeforeRequestContent(),
|
||||
dev_mdbahanview.AfterRequestContent(),
|
||||
)
|
||||
//Form Add
|
||||
modalAddBody := dev_mdbahanview.BodyFormBahan(
|
||||
"",
|
||||
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
|
||||
Name: "kodebahan",
|
||||
Placeholder: "Kode Bahan",
|
||||
Type: "text"},
|
||||
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
|
||||
Name: "namabahan",
|
||||
Placeholder: "Nama Bahan",
|
||||
Type: "text"},
|
||||
models.CustomDropdownV2Prm{
|
||||
Name: "stationid",
|
||||
Label: "Sample Station",
|
||||
ListItem: dev_mdbahanview.ListItemStation(stationList, 0),
|
||||
},
|
||||
modalAddBodyID,
|
||||
dev_mdbahanview.JsShowModal(""),
|
||||
)
|
||||
modalAddAction := dev_mdbahanview.ActionFormBahan("/dev/md/bahan/closeaddform", "#"+modalAddBodyID, "outerHTML", "#"+modalAddID)
|
||||
modalAddBtnCls := dev_mdbahanview.BtnCloseFormBahan("/dev/md/bahan/closeaddform", "#"+modalAddBodyID, "outerHTML", "#"+modalAddID)
|
||||
modalAddBahan := dev_mdbahanview.BahanForm(models.BahanFormComponent{
|
||||
IDComponent: "",
|
||||
Link: "/dev/md/bahan/add",
|
||||
HxTarget: "#" + modalAddBodyID,
|
||||
HxSwap: "outerHTML",
|
||||
HxInclude: "#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage" + paginationID,
|
||||
ModalID: modalAddID,
|
||||
ModalTitle: "New-Bahan",
|
||||
DialogBody: modalAddBody,
|
||||
DialogAction: modalAddAction,
|
||||
ButtonCLose: modalAddBtnCls,
|
||||
})
|
||||
|
||||
//Form Edit
|
||||
modalEditBody := dev_mdbahanview.BodyFormBahan(
|
||||
"",
|
||||
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
|
||||
Name: "kodebahan",
|
||||
Placeholder: "Kode Bahan",
|
||||
Type: "text"},
|
||||
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
|
||||
Name: "namabahan",
|
||||
Placeholder: "Nama Bahan",
|
||||
Type: "text"},
|
||||
models.CustomDropdownV2Prm{
|
||||
Name: "stationid",
|
||||
Label: "Sample Station",
|
||||
ListItem: dev_mdbahanview.ListItemStation(stationList, 0),
|
||||
},
|
||||
modalEditBodyID,
|
||||
dev_mdbahanview.JsShowModal(""),
|
||||
)
|
||||
modalEditAction := dev_mdbahanview.ActionFormBahan("/dev/md/bahan/closeeditform", "#"+modalEditBodyID, "outerHTML", "#"+modalEditID)
|
||||
modalEditBtnCls := dev_mdbahanview.BtnCloseFormBahan("/dev/md/bahan/closeeditform", "#"+modalEditBodyID, "outerHTML", "#"+modalEditID)
|
||||
modalEditBahan := dev_mdbahanview.BahanForm(models.BahanFormComponent{
|
||||
IDComponent: "",
|
||||
Link: "/dev/md/bahan/edit",
|
||||
HxTarget: "#" + modalEditBodyID,
|
||||
HxSwap: "outerHTML",
|
||||
HxInclude: "#filter-name, #filter-station, #tableID, #paginationID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage" + paginationID,
|
||||
ModalID: modalEditID,
|
||||
ModalTitle: "Edit-Bahan",
|
||||
DialogBody: modalEditBody,
|
||||
DialogAction: modalEditAction,
|
||||
ButtonCLose: modalEditBtnCls,
|
||||
})
|
||||
|
||||
//Form Delete
|
||||
modalDeleteBody := dev_mdbahanview.DeleteConfirmationBody(
|
||||
"",
|
||||
modalDeleteBodyID,
|
||||
"Apakah anda yakin menghapus bahan berikut ?",
|
||||
[]string{"Kode", "Nama Bahan", "Sample Station"},
|
||||
[]string{"", "", ""}, dev_mdbahanview.JsShowModal(""))
|
||||
modalDeleteAction := dev_mdbahanview.ActionFormBahanDelete("/dev/md/bahan/closedeleteform", "#"+modalDeleteBodyID, "outerHTML", "#"+modalDeleteID)
|
||||
modalDeleteBtnCls := dev_mdbahanview.BtnCloseFormBahan("/dev/md/bahan/closedeleteform", "#"+modalDeleteBodyID, "outerHTML", "#"+modalDeleteID)
|
||||
modalDeleteBahan := dev_mdbahanview.BahanForm(models.BahanFormComponent{
|
||||
IDComponent: "",
|
||||
Link: "/dev/md/bahan/delete",
|
||||
HxTarget: "#" + modalDeleteBodyID,
|
||||
HxSwap: "outerHTML",
|
||||
HxInclude: "#filter-name, #filter-station, #tableID, #paginationID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage" + paginationID,
|
||||
ModalID: modalDeleteID,
|
||||
ModalTitle: "Delete-Bahan",
|
||||
DialogBody: modalDeleteBody,
|
||||
DialogAction: modalDeleteAction,
|
||||
ButtonCLose: modalDeleteBtnCls,
|
||||
})
|
||||
|
||||
mdBahanScreen := dev_mdbahanview.MdBahanScreen(
|
||||
tableBahanID,
|
||||
paginationID,
|
||||
modalAddID,
|
||||
modalAddBodyID,
|
||||
modalEditID,
|
||||
modalEditBodyID,
|
||||
modalDeleteID,
|
||||
modalDeleteBodyID,
|
||||
breadcrumbComponent,
|
||||
mdBahanTable,
|
||||
mdBahanFilter,
|
||||
mdbahanPagination,
|
||||
modalAddBahan,
|
||||
modalEditBahan,
|
||||
modalDeleteBahan)
|
||||
cssMdBahan := dev_mdbahanview.CssMdUserGroup()
|
||||
jsMdBahan := dev_mdbahanview.JsMdBahan()
|
||||
|
||||
view := dev_mdbahanview.ShowMdBahanScreen(
|
||||
"Md Bahan",
|
||||
mdBahanScreen,
|
||||
cssMdBahan,
|
||||
jsMdBahan,
|
||||
navbarmenuComponent,
|
||||
navbaruserComponent,
|
||||
sidebaruserprofileComponent)
|
||||
return utils.View(c, view)
|
||||
}
|
||||
|
||||
func (lh *MdBahanHandler) HandleFilterMdBahan(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
var retval []templ.Component
|
||||
filtername := c.QueryParam("filtername")
|
||||
filterstation := c.QueryParam("filterstation")
|
||||
dialogEditBodyID := c.QueryParam("dialogEditBodyID")
|
||||
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
|
||||
tableID := c.QueryParam("tableID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
bahanList, totalPage, err := lh.MdBahanServices.GetListMdBahan(filtername, filterstation, 1, 5)
|
||||
defer logger.Sync()
|
||||
logger.Info("GET DATA BAHAN",
|
||||
zap.Any("data", bahanList),
|
||||
zap.Any("err", err),
|
||||
zap.Any("totalPage", totalPage),
|
||||
)
|
||||
//Bahan Table
|
||||
|
||||
mdBahanTable := dev_mdbahanview.TableBahan(
|
||||
bahanList,
|
||||
tableID,
|
||||
"/dev/md/bahan/openedit",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/md/bahan/opendelete",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
|
||||
//Pagination
|
||||
|
||||
mdbahanPagination := pagination.PaginationV3(
|
||||
totalPage, 1,
|
||||
"/dev/md/bahan/pagination",
|
||||
paginationID,
|
||||
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
|
||||
"#"+paginationID,
|
||||
"outerHTML",
|
||||
"",
|
||||
"",
|
||||
dev_mdbahanview.BeforeRequestContent(),
|
||||
dev_mdbahanview.AfterRequestContent(),
|
||||
)
|
||||
retval = append(retval, mdBahanTable)
|
||||
retval = append(retval, mdbahanPagination)
|
||||
return utils.ViewMulti(c, retval)
|
||||
}
|
||||
func (lh *MdBahanHandler) HandlePaginationMdBahan(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
var retval []templ.Component
|
||||
pageparam := c.QueryParam("page")
|
||||
|
||||
filtername := c.QueryParam("filtername")
|
||||
filterstation := c.QueryParam("filterstation")
|
||||
tableID := c.QueryParam("tableID")
|
||||
dialogEditBodyID := c.QueryParam("dialogEditBodyID")
|
||||
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
page, err := strconv.Atoi(pageparam)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR CONVERT PAGE PARAM",
|
||||
zap.Any("page", page),
|
||||
zap.Any("error ", err),
|
||||
)
|
||||
return err
|
||||
}
|
||||
bahanList, totalPage, err := lh.MdBahanServices.GetListMdBahan(filtername, filterstation, page, 5)
|
||||
defer logger.Sync()
|
||||
logger.Info("GET DATA BAHAN",
|
||||
zap.Any("data", bahanList),
|
||||
zap.Any("err", err),
|
||||
zap.Any("totalPage", totalPage),
|
||||
)
|
||||
//Bahan Table
|
||||
|
||||
mdBahanTable := dev_mdbahanview.TableBahan(
|
||||
bahanList,
|
||||
tableID,
|
||||
"/dev/md/bahan/openedit",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/md/bahan/opendelete",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
|
||||
//Pagination
|
||||
|
||||
mdbahanPagination := pagination.PaginationV3(
|
||||
totalPage, page,
|
||||
"/dev/md/bahan/pagination",
|
||||
paginationID,
|
||||
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
|
||||
"#"+paginationID,
|
||||
"outerHTML",
|
||||
"",
|
||||
"",
|
||||
dev_mdbahanview.BeforeRequestContent(),
|
||||
dev_mdbahanview.AfterRequestContent(),
|
||||
)
|
||||
retval = append(retval, mdBahanTable)
|
||||
retval = append(retval, mdbahanPagination)
|
||||
return utils.ViewMulti(c, retval)
|
||||
}
|
||||
func (lh *MdBahanHandler) HandleCloseFormAddMdBahan(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
stationList, err := lh.MdBahanServices.GetListSampleStation(false)
|
||||
defer logger.Sync()
|
||||
logger.Info("GET DATA STATIOn",
|
||||
zap.Any("err", err),
|
||||
)
|
||||
dialogAddBodyID := c.FormValue("dialogAddBodyID")
|
||||
dialogAddID := c.FormValue("dialogAddID")
|
||||
|
||||
modalAddBody := dev_mdbahanview.BodyFormBahan(
|
||||
"",
|
||||
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
|
||||
Name: "kodebahan",
|
||||
Placeholder: "Kode Bahan",
|
||||
Type: "text"},
|
||||
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
|
||||
Name: "namabahan",
|
||||
Placeholder: "Nama Bahan",
|
||||
Type: "text"},
|
||||
models.CustomDropdownV2Prm{
|
||||
Name: "stationid",
|
||||
Label: "Sample Station",
|
||||
ListItem: dev_mdbahanview.ListItemStation(stationList, 0),
|
||||
},
|
||||
dialogAddBodyID,
|
||||
dev_mdbahanview.JsHideModal("#"+dialogAddID),
|
||||
)
|
||||
return utils.View(c, modalAddBody)
|
||||
}
|
||||
func (lh *MdBahanHandler) HandleAddMdBahan(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
code := c.FormValue("kodebahan")
|
||||
name := c.FormValue("namabahan")
|
||||
stationIDPrm := c.FormValue("stationid")
|
||||
tableID := c.FormValue("tableID")
|
||||
paginationID := c.FormValue("paginationID")
|
||||
filtername := c.FormValue("filtername")
|
||||
filterstation := c.FormValue("filterstation")
|
||||
currPagePrm := c.FormValue("currpage" + paginationID)
|
||||
dialogAddBodyID := c.FormValue("dialogAddBodyID")
|
||||
// searchID := c.FormValue("searchID")
|
||||
dialogAddID := c.FormValue("dialogAddID")
|
||||
dialogEditBodyID := c.FormValue("dialogEditBodyID")
|
||||
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
|
||||
currPage, err := strconv.Atoi(currPagePrm)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
stationID, err := strconv.Atoi(stationIDPrm)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
formValidation := ""
|
||||
codeValidation := ""
|
||||
nameValidation := ""
|
||||
stationValidation := ""
|
||||
|
||||
if strings.TrimSpace(code) == "" {
|
||||
formValidation = "Code bahan tidak boleh kosong"
|
||||
codeValidation = "Code bahan tidak boleh kosong"
|
||||
nameValidation = ""
|
||||
stationValidation = ""
|
||||
}
|
||||
if strings.TrimSpace(name) == "" {
|
||||
formValidation = "Nama bahan tidak boleh kosong"
|
||||
codeValidation = ""
|
||||
stationValidation = ""
|
||||
nameValidation = "Nama bahan tidak boleh kosong"
|
||||
}
|
||||
if stationID == 0 {
|
||||
formValidation = "Pilih salah satu station"
|
||||
codeValidation = ""
|
||||
nameValidation = ""
|
||||
stationValidation = "Pilih salah satu station"
|
||||
}
|
||||
if strings.TrimSpace(code) == "" && strings.TrimSpace(name) == "" {
|
||||
formValidation = "Code,nama, dan station bahan tidak boleh kosong"
|
||||
codeValidation = "Code bahan tidak boleh kosong"
|
||||
stationValidation = "Pilih salah satu station"
|
||||
nameValidation = "Nama bahan tidak boleh kosong"
|
||||
|
||||
}
|
||||
stationList, err := lh.MdBahanServices.GetListSampleStation(false)
|
||||
defer logger.Sync()
|
||||
logger.Info("GET DATA STATIOn",
|
||||
zap.Any("err", err),
|
||||
)
|
||||
if formValidation != "" || codeValidation != "" || nameValidation != "" || stationValidation != "" {
|
||||
newForm := dev_mdbahanview.BodyFormBahan(
|
||||
"",
|
||||
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
|
||||
Name: "kodebahan",
|
||||
Placeholder: "Kode Bahan",
|
||||
Value: code,
|
||||
ErrorMsg: codeValidation,
|
||||
Type: "text"},
|
||||
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
|
||||
Name: "namabahan",
|
||||
Placeholder: "Nama Bahan",
|
||||
ErrorMsg: nameValidation,
|
||||
Value: name,
|
||||
Type: "text"},
|
||||
models.CustomDropdownV2Prm{
|
||||
Name: "stationid",
|
||||
Label: "Sample Station",
|
||||
ErrorMsg: stationValidation,
|
||||
ListItem: dev_mdbahanview.ListItemStation(stationList, stationID),
|
||||
},
|
||||
dialogAddBodyID,
|
||||
dev_mdbahanview.JsShowModal(""),
|
||||
)
|
||||
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Warning", formValidation, "warning"), newForm})
|
||||
}
|
||||
_, err = lh.MdBahanServices.AddMdBahan(code, name, stationIDPrm)
|
||||
if err != nil {
|
||||
newForm := dev_mdbahanview.BodyFormBahan(
|
||||
"",
|
||||
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
|
||||
Name: "kodebahan",
|
||||
Placeholder: "Kode Bahan",
|
||||
Value: code,
|
||||
Type: "text"},
|
||||
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
|
||||
Name: "namabahan",
|
||||
Placeholder: "Nama Bahan",
|
||||
Value: name,
|
||||
Type: "text"},
|
||||
models.CustomDropdownV2Prm{
|
||||
Name: "stationid",
|
||||
Label: "Sample Station",
|
||||
ListItem: dev_mdbahanview.ListItemStation(stationList, int(stationID)),
|
||||
},
|
||||
dialogAddBodyID,
|
||||
dev_mdbahanview.JsShowModal(""),
|
||||
)
|
||||
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Gagal", err.Error(), "danger"), newForm})
|
||||
}
|
||||
|
||||
bahanList, totalPage, err := lh.MdBahanServices.GetListMdBahan(filtername, filterstation, currPage, 5)
|
||||
defer logger.Sync()
|
||||
logger.Info("GET DATA BAHAN",
|
||||
zap.Any("data", bahanList),
|
||||
zap.Any("err", err),
|
||||
zap.Any("totalPage", totalPage),
|
||||
)
|
||||
//Bahan Table
|
||||
mdBahanTable := dev_mdbahanview.TableBahan(
|
||||
bahanList,
|
||||
tableID,
|
||||
"/dev/md/bahan/openedit",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/md/bahan/opendelete",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
|
||||
|
||||
//Pagination
|
||||
|
||||
mdbahanPagination := pagination.PaginationV3(
|
||||
totalPage, currPage,
|
||||
"/dev/md/bahan/pagination",
|
||||
paginationID,
|
||||
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
|
||||
"#"+paginationID,
|
||||
"outerHTML",
|
||||
"",
|
||||
"true",
|
||||
dev_mdbahanview.BeforeRequestContent(),
|
||||
dev_mdbahanview.AfterRequestContent(),
|
||||
)
|
||||
//Form Add
|
||||
modalAddBody := dev_mdbahanview.BodyFormBahan(
|
||||
"",
|
||||
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
|
||||
Name: "kodebahan",
|
||||
Placeholder: "Kode Bahan",
|
||||
Type: "text"},
|
||||
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
|
||||
Name: "namabahan",
|
||||
Placeholder: "Nama Bahan",
|
||||
Type: "text"},
|
||||
models.CustomDropdownV2Prm{
|
||||
Name: "stationid",
|
||||
Label: "Sample Station",
|
||||
ListItem: dev_mdbahanview.ListItemStation(stationList, 0),
|
||||
},
|
||||
dialogAddBodyID,
|
||||
dev_mdbahanview.JsHideModal("#"+dialogAddID),
|
||||
)
|
||||
|
||||
toastSuccess := customtoastv2.CustomToastV2Show("Success", "Success add bahan ", "success")
|
||||
retval := []templ.Component{toastSuccess, mdBahanTable, mdbahanPagination, modalAddBody}
|
||||
// time.Sleep(20 * time.Second)
|
||||
return utils.ViewMulti(c, retval)
|
||||
}
|
||||
func (lh *MdBahanHandler) HandleOpenEditMdBahan(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
id := c.QueryParam("id")
|
||||
dialogEditID := c.QueryParam("dialogEditID")
|
||||
dialogEditBodyID := c.QueryParam("dialogEditBodyID")
|
||||
stationList, err := lh.MdBahanServices.GetListSampleStation(false)
|
||||
defer logger.Sync()
|
||||
logger.Info("GET DATA STATION",
|
||||
zap.Any("err", err),
|
||||
)
|
||||
dataBahan, err := lh.MdBahanServices.GetMdBahanByID(id)
|
||||
if err != nil {
|
||||
newForm := dev_mdbahanview.BodyFormBahan(
|
||||
id,
|
||||
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
|
||||
Name: "kodebahan",
|
||||
Placeholder: "Kode Bahan",
|
||||
Type: "text"},
|
||||
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
|
||||
Name: "namabahan",
|
||||
Placeholder: "Nama Bahan",
|
||||
Type: "text"},
|
||||
models.CustomDropdownV2Prm{
|
||||
Name: "stationid",
|
||||
Label: "Sample Station",
|
||||
ListItem: dev_mdbahanview.ListItemStation(stationList, dataBahan.T_BahanT_SampleStationID),
|
||||
},
|
||||
dialogEditBodyID,
|
||||
dev_mdbahanview.JsHideModal(""),
|
||||
)
|
||||
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Error", "Get data bahan error", "danger"), newForm})
|
||||
}
|
||||
newForm := dev_mdbahanview.BodyFormBahan(
|
||||
id,
|
||||
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
|
||||
Name: "kodebahan",
|
||||
Placeholder: "Kode Bahan",
|
||||
Value: dataBahan.T_BahanCode,
|
||||
Type: "text"},
|
||||
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
|
||||
Name: "namabahan",
|
||||
Placeholder: "Nama Bahan",
|
||||
Value: dataBahan.T_BahanName,
|
||||
Type: "text"},
|
||||
models.CustomDropdownV2Prm{
|
||||
Name: "stationid",
|
||||
Label: "Sample Station",
|
||||
ListItem: dev_mdbahanview.ListItemStation(stationList, dataBahan.T_BahanT_SampleStationID),
|
||||
},
|
||||
dialogEditBodyID,
|
||||
dev_mdbahanview.JsShowModal("#"+dialogEditID),
|
||||
)
|
||||
return utils.View(c, newForm)
|
||||
}
|
||||
func (lh *MdBahanHandler) HandleCloseFormEditMdBahan(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
stationList, err := lh.MdBahanServices.GetListSampleStation(false)
|
||||
dialogEditID := c.FormValue("dialogEditID")
|
||||
dialogEditBodyID := c.FormValue("dialogEditBodyID")
|
||||
defer logger.Sync()
|
||||
logger.Info("GET DATA STATION",
|
||||
zap.Any("err", err),
|
||||
zap.Any("dialogeditbodyid", dialogEditBodyID),
|
||||
)
|
||||
|
||||
modalAddBody := dev_mdbahanview.BodyFormBahan(
|
||||
"",
|
||||
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
|
||||
Name: "kodebahan",
|
||||
Placeholder: "Kode Bahan",
|
||||
Type: "text"},
|
||||
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
|
||||
Name: "namabahan",
|
||||
Placeholder: "Nama Bahan",
|
||||
Type: "text"},
|
||||
models.CustomDropdownV2Prm{
|
||||
Name: "stationid",
|
||||
Label: "Sample Station",
|
||||
ListItem: dev_mdbahanview.ListItemStation(stationList, 0),
|
||||
},
|
||||
dialogEditBodyID,
|
||||
dev_mdbahanview.JsHideModal("#"+dialogEditID),
|
||||
)
|
||||
return utils.View(c, modalAddBody)
|
||||
}
|
||||
func (lh *MdBahanHandler) HandleEditMdBahan(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
code := c.FormValue("kodebahan")
|
||||
name := c.FormValue("namabahan")
|
||||
id := c.FormValue("bahanid")
|
||||
stationIDPrm := c.FormValue("stationid")
|
||||
tableID := c.FormValue("tableID")
|
||||
paginationID := c.FormValue("paginationID")
|
||||
filtername := c.FormValue("filtername")
|
||||
filterstation := c.FormValue("filterstation")
|
||||
currPagePrm := c.FormValue("currpage" + paginationID)
|
||||
// dialogAddBodyID := c.FormValue("dialogAddBodyID")
|
||||
// searchID := c.FormValue("searchID")
|
||||
dialogEditID := c.FormValue("dialogEditID")
|
||||
dialogEditBodyID := c.FormValue("dialogEditBodyID")
|
||||
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
|
||||
currPage, err := strconv.Atoi(currPagePrm)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
stationID, err := strconv.Atoi(stationIDPrm)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
formValidation := ""
|
||||
codeValidation := ""
|
||||
nameValidation := ""
|
||||
stationValidation := ""
|
||||
|
||||
if strings.TrimSpace(code) == "" {
|
||||
formValidation = "Code bahan tidak boleh kosong"
|
||||
codeValidation = "Code bahan tidak boleh kosong"
|
||||
nameValidation = ""
|
||||
stationValidation = ""
|
||||
}
|
||||
if strings.TrimSpace(name) == "" {
|
||||
formValidation = "Nama bahan tidak boleh kosong"
|
||||
codeValidation = ""
|
||||
stationValidation = ""
|
||||
nameValidation = "Nama bahan tidak boleh kosong"
|
||||
}
|
||||
if stationID == 0 {
|
||||
formValidation = "Pilih salah satu station"
|
||||
codeValidation = ""
|
||||
nameValidation = ""
|
||||
stationValidation = "Pilih salah satu station"
|
||||
}
|
||||
if strings.TrimSpace(code) == "" && strings.TrimSpace(name) == "" {
|
||||
formValidation = "Code,nama, dan station bahan tidak boleh kosong"
|
||||
codeValidation = "Code bahan tidak boleh kosong"
|
||||
stationValidation = "Pilih salah satu station"
|
||||
nameValidation = "Nama bahan tidak boleh kosong"
|
||||
|
||||
}
|
||||
stationList, err := lh.MdBahanServices.GetListSampleStation(false)
|
||||
defer logger.Sync()
|
||||
logger.Info("GET DATA STATIOn",
|
||||
zap.Any("err", err),
|
||||
)
|
||||
if formValidation != "" || codeValidation != "" || nameValidation != "" || stationValidation != "" {
|
||||
newForm := dev_mdbahanview.BodyFormBahan(
|
||||
id,
|
||||
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
|
||||
Name: "kodebahan",
|
||||
Placeholder: "Kode Bahan",
|
||||
Value: code,
|
||||
ErrorMsg: codeValidation,
|
||||
Type: "text"},
|
||||
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
|
||||
Name: "namabahan",
|
||||
Placeholder: "Nama Bahan",
|
||||
ErrorMsg: nameValidation,
|
||||
Value: name,
|
||||
Type: "text"},
|
||||
models.CustomDropdownV2Prm{
|
||||
Name: "stationid",
|
||||
Label: "Sample Station",
|
||||
ErrorMsg: stationValidation,
|
||||
ListItem: dev_mdbahanview.ListItemStation(stationList, stationID),
|
||||
},
|
||||
dialogEditBodyID,
|
||||
dev_mdbahanview.JsShowModal(""),
|
||||
)
|
||||
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Warning", formValidation, "warning"), newForm})
|
||||
}
|
||||
_, err = lh.MdBahanServices.EditMdBahan(id, code, name, stationIDPrm)
|
||||
if err != nil {
|
||||
newForm := dev_mdbahanview.BodyFormBahan(
|
||||
id,
|
||||
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
|
||||
Name: "kodebahan",
|
||||
Placeholder: "Kode Bahan",
|
||||
Value: code,
|
||||
Type: "text"},
|
||||
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
|
||||
Name: "namabahan",
|
||||
Placeholder: "Nama Bahan",
|
||||
Value: name,
|
||||
Type: "text"},
|
||||
models.CustomDropdownV2Prm{
|
||||
Name: "stationid",
|
||||
Label: "Sample Station",
|
||||
ListItem: dev_mdbahanview.ListItemStation(stationList, int(stationID)),
|
||||
},
|
||||
dialogEditBodyID,
|
||||
dev_mdbahanview.JsShowModal(""),
|
||||
)
|
||||
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Gagal", err.Error(), "danger"), newForm})
|
||||
}
|
||||
|
||||
bahanList, totalPage, err := lh.MdBahanServices.GetListMdBahan(filtername, filterstation, currPage, 5)
|
||||
defer logger.Sync()
|
||||
logger.Info("GET DATA BAHAN",
|
||||
zap.Any("data", bahanList),
|
||||
zap.Any("err", err),
|
||||
zap.Any("totalPage", totalPage),
|
||||
)
|
||||
//Bahan Table
|
||||
mdBahanTable := dev_mdbahanview.TableBahan(
|
||||
bahanList,
|
||||
tableID,
|
||||
"/dev/md/bahan/openedit",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/md/bahan/opendelete",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
|
||||
|
||||
//Pagination
|
||||
|
||||
mdbahanPagination := pagination.PaginationV3(
|
||||
totalPage, currPage,
|
||||
"/dev/md/bahan/pagination",
|
||||
paginationID,
|
||||
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
|
||||
"#"+paginationID,
|
||||
"outerHTML",
|
||||
"",
|
||||
"true",
|
||||
dev_mdbahanview.BeforeRequestContent(),
|
||||
dev_mdbahanview.AfterRequestContent(),
|
||||
)
|
||||
//Form Add
|
||||
modalAddBody := dev_mdbahanview.BodyFormBahan(
|
||||
"",
|
||||
models.CustomTextFieldv2Prm{Label: "Kode Bahan",
|
||||
Name: "kodebahan",
|
||||
Placeholder: "Kode Bahan",
|
||||
Type: "text"},
|
||||
models.CustomTextFieldv2Prm{Label: "Nama Bahan",
|
||||
Name: "namabahan",
|
||||
Placeholder: "Nama Bahan",
|
||||
Type: "text"},
|
||||
models.CustomDropdownV2Prm{
|
||||
Name: "stationid",
|
||||
Label: "Sample Station",
|
||||
ListItem: dev_mdbahanview.ListItemStation(stationList, 0),
|
||||
},
|
||||
dialogEditBodyID,
|
||||
dev_mdbahanview.JsHideModal("#"+dialogEditID),
|
||||
)
|
||||
|
||||
toastSuccess := customtoastv2.CustomToastV2Show("Success", "Success edit bahan ", "success")
|
||||
retval := []templ.Component{toastSuccess, mdBahanTable, mdbahanPagination, modalAddBody}
|
||||
// time.Sleep(20 * time.Second)
|
||||
return utils.ViewMulti(c, retval)
|
||||
}
|
||||
func (lh *MdBahanHandler) HandleOpenDeleteMdBahan(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
id := c.QueryParam("id")
|
||||
dialogDeleteID := c.QueryParam("dialogDeleteID")
|
||||
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
|
||||
|
||||
dataBahan, err := lh.MdBahanServices.GetMdBahanByID(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("GET DATA BAHAN",
|
||||
zap.Any("err", err),
|
||||
)
|
||||
newForm := dev_mdbahanview.DeleteConfirmationBody(
|
||||
"",
|
||||
dialogDeleteBodyID,
|
||||
"Apakah anda yakin menghapus bahan berikut ?",
|
||||
[]string{"Kode", "Nama Bahan", "Sample Station"},
|
||||
[]string{"", "", ""}, dev_mdbahanview.JsShowModal(""))
|
||||
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Error", "Get data bahan error", "danger"), newForm})
|
||||
}
|
||||
newForm := dev_mdbahanview.DeleteConfirmationBody(
|
||||
strconv.Itoa(dataBahan.T_BahanID),
|
||||
dialogDeleteBodyID,
|
||||
"Apakah anda yakin menghapus bahan berikut ?",
|
||||
[]string{"Kode", "Nama Bahan", "Sample Station"},
|
||||
[]string{dataBahan.T_BahanCode, dataBahan.T_BahanName, dataBahan.T_SampleStationName}, dev_mdbahanview.JsShowModal("#"+dialogDeleteID))
|
||||
return utils.View(c, newForm)
|
||||
}
|
||||
func (lh *MdBahanHandler) HandleCloseDeleteMdBahan(c echo.Context) error {
|
||||
|
||||
dialogDeleteID := c.FormValue("dialogDeleteID")
|
||||
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
|
||||
newForm := dev_mdbahanview.DeleteConfirmationBody(
|
||||
"",
|
||||
dialogDeleteBodyID,
|
||||
"Apakah anda yakin menghapus bahan berikut ?",
|
||||
[]string{"Kode", "Nama Bahan", "Sample Station"},
|
||||
[]string{"", "", ""}, dev_mdbahanview.JsHideModal("#"+dialogDeleteID))
|
||||
return utils.View(c, newForm)
|
||||
}
|
||||
|
||||
func (lh *MdBahanHandler) HandleDeleteMdBahan(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
id := c.FormValue("bahanid")
|
||||
|
||||
tableID := c.FormValue("tableID")
|
||||
paginationID := c.FormValue("paginationID")
|
||||
filtername := c.FormValue("filtername")
|
||||
filterstation := c.FormValue("filterstation")
|
||||
currPagePrm := c.FormValue("currpage" + paginationID)
|
||||
// dialogAddBodyID := c.FormValue("dialogAddBodyID")
|
||||
// searchID := c.FormValue("searchID")
|
||||
dialogDeleteID := c.FormValue("dialogDeleteID")
|
||||
dialogEditBodyID := c.FormValue("dialogEditBodyID")
|
||||
dialogDeleteBodyID := c.FormValue("dialogDeleteBodyID")
|
||||
currPage, err := strconv.Atoi(currPagePrm)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = lh.MdBahanServices.DeleteMdBahan(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERR DELETE MD BAHAN",
|
||||
zap.Any("err", err),
|
||||
)
|
||||
newForm := dev_mdbahanview.DeleteConfirmationBody(
|
||||
"",
|
||||
dialogDeleteBodyID,
|
||||
"Apakah anda yakin menghapus bahan berikut ?",
|
||||
[]string{"Kode", "Nama Bahan", "Sample Station"},
|
||||
[]string{"", "", ""}, dev_mdbahanview.JsShowModal(""))
|
||||
return utils.ViewMulti(c, []templ.Component{customtoastv2.CustomToastV2Show("Error", "Get data bahan error", "danger"), newForm})
|
||||
}
|
||||
bahanList, totalPage, err := lh.MdBahanServices.GetListMdBahan(filtername, filterstation, currPage, 5)
|
||||
defer logger.Sync()
|
||||
logger.Info("GET DATA BAHAN",
|
||||
zap.Any("data", bahanList),
|
||||
zap.Any("err", err),
|
||||
zap.Any("totalPage", totalPage),
|
||||
)
|
||||
//Bahan Table
|
||||
mdBahanTable := dev_mdbahanview.TableBahan(
|
||||
bahanList,
|
||||
tableID,
|
||||
"/dev/md/bahan/openedit",
|
||||
"#"+dialogEditBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"/dev/md/bahan/opendelete",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogEditBodyID, #dialogEditID, #dialogDeleteBodyID, #dialogDeleteID")
|
||||
|
||||
//Pagination
|
||||
|
||||
mdbahanPagination := pagination.PaginationV3(
|
||||
totalPage, currPage,
|
||||
"/dev/md/bahan/pagination",
|
||||
paginationID,
|
||||
"#filter-name, #filter-station, #tableID, #paginationID, #dialogAddID, #dialogAddBodyID, #dialogEditID, #dialogEditBodyID, #dialogDeleteBodyID, #dialogDeleteID, #currpage"+paginationID,
|
||||
"#"+paginationID,
|
||||
"outerHTML",
|
||||
"",
|
||||
"true",
|
||||
dev_mdbahanview.BeforeRequestContent(),
|
||||
dev_mdbahanview.AfterRequestContent(),
|
||||
)
|
||||
|
||||
toastSuccess := customtoastv2.CustomToastV2Show("Success", "Berhasil hapus bahan", "success")
|
||||
newForm := dev_mdbahanview.DeleteConfirmationBody(
|
||||
"",
|
||||
dialogDeleteBodyID,
|
||||
"Apakah anda yakin menghapus bahan berikut ?",
|
||||
[]string{"Kode", "Nama Bahan", "Sample Station"},
|
||||
[]string{"", "", ""}, dev_mdbahanview.JsHideModal("#"+dialogDeleteID))
|
||||
return utils.ViewMulti(c, []templ.Component{toastSuccess, mdBahanTable, mdbahanPagination, newForm})
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,6 @@ package public_handlers
|
||||
import (
|
||||
public_services "cpone/services/public"
|
||||
public_landingpage "cpone/views/public/landingpage"
|
||||
"net/http"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"go.uber.org/zap"
|
||||
@@ -57,7 +56,7 @@ func (uh *LandingPageHandler) ShowLandingPage(c echo.Context) error {
|
||||
)
|
||||
// fmt.Printf("%+v\n", udata)
|
||||
|
||||
helo := public_landingpage.ShowLandingPage("HOME",
|
||||
helo := public_landingpage.ShowLandingPage("Hello World",
|
||||
public_landingpage.MainLandingPage(public_landingpage.ListMedicalService(udata),
|
||||
public_landingpage.ListAdvantage(adData), public_landingpage.ListPromotion(lpData),
|
||||
public_landingpage.FooterSection(ftNav)),
|
||||
@@ -66,12 +65,6 @@ func (uh *LandingPageHandler) ShowLandingPage(c echo.Context) error {
|
||||
return uh.View(c, helo)
|
||||
}
|
||||
|
||||
func (uh *LandingPageHandler) HandleBtnLogin(c echo.Context) error {
|
||||
c.Response().Header().Set("HX-Redirect", "/login")
|
||||
|
||||
return c.String(http.StatusOK, "/login")
|
||||
}
|
||||
|
||||
func (uh *LandingPageHandler) View(c echo.Context, cmp templ.Component) error {
|
||||
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
|
||||
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
package public_handlers
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
public_login "cpone/views/public/login"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type LoginService interface {
|
||||
CheckIsAccountCpone(email string) (string, error)
|
||||
CheckAccountHasLocation(email string) (bool, error)
|
||||
MultiSignInV2(username string, password string) (models.Response, error)
|
||||
}
|
||||
|
||||
func NewLoginHandler(us LoginService) *LoginHandler {
|
||||
@@ -29,321 +20,14 @@ type LoginHandler struct {
|
||||
LoginService LoginService
|
||||
}
|
||||
|
||||
// func (uh *LoginHandler) ShowLogin(c echo.Context) error {
|
||||
// helo := client_Login.Show()
|
||||
// return utils.View(c, helo)
|
||||
// }
|
||||
|
||||
func (lh *LoginHandler) HandlerShowLogin(c echo.Context) error {
|
||||
|
||||
si := public_login.ShowLogin("Login ", public_login.MainLogin(true), public_login.CssLogin(), public_login.JsLogin())
|
||||
si := public_login.ShowLogin("Login ", public_login.MainLogin(), public_login.CssLogin(), public_login.JsLogin())
|
||||
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
func (lh *LoginHandler) HandleSignIn(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
// host := c.Request().Host
|
||||
username := c.FormValue("username")
|
||||
password := c.FormValue("password")
|
||||
defer logger.Sync()
|
||||
logger.Info("Params", zap.Any("username", username), zap.Any("pass", password))
|
||||
|
||||
resp, err := lh.LoginService.MultiSignInV2(username, password)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error", zap.Any("error multi signin", err))
|
||||
|
||||
si := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
|
||||
return utils.View(c, si)
|
||||
}
|
||||
if resp.Status == "ERR" {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error", zap.Any("ERR", resp.Status))
|
||||
|
||||
si := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("valid", zap.Any("value", resp))
|
||||
|
||||
var url string
|
||||
switch resp.Data.Type {
|
||||
case "cpone":
|
||||
url = "/one-ui"
|
||||
case "pic":
|
||||
url = "/corp/dashboard_pic"
|
||||
case "patient":
|
||||
url = "/corp/dashboard_pat"
|
||||
default:
|
||||
url = "/one-ui"
|
||||
}
|
||||
|
||||
user, err := json.Marshal(resp.Data.User)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error", zap.Error(err))
|
||||
|
||||
si := public_login.ShowLogin("Login ", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
cookie := new(http.Cookie)
|
||||
cookie.Name = "token"
|
||||
cookie.Value = resp.Data.Token
|
||||
cookie.Path = "/"
|
||||
cookie.HttpOnly = true
|
||||
|
||||
c.SetCookie(cookie)
|
||||
|
||||
userString := string(user)
|
||||
store := `
|
||||
<script>
|
||||
console.log("store token");
|
||||
const token = "` + resp.Data.Token + `";
|
||||
const user = JSON.stringify(` + userString + `);
|
||||
localStorage.setItem("token", token);
|
||||
localStorage.setItem("user", user);
|
||||
|
||||
htmx.on("htmx:configRequest", (e)=> {
|
||||
e.detail.headers["Authorization"] = "Bearer ` + resp.Data.Token + `"
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
htmx.ajax('GET', '/login/redirect?url=` + url + `')
|
||||
}, 200)
|
||||
</script>
|
||||
`
|
||||
c.Response().Header().Set("HX-Trigger", "script")
|
||||
return c.String(http.StatusOK, store)
|
||||
}
|
||||
|
||||
func (lh *LoginHandler) HandleRedirect(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
url := c.QueryParam("url")
|
||||
token := c.Request().Header.Get("Authorization")
|
||||
logger.Info("params", zap.Any("url", url), zap.Any("token", token))
|
||||
|
||||
c.Response().Header().Set("HX-Redirect", url)
|
||||
return c.String(http.StatusOK, url)
|
||||
}
|
||||
|
||||
func (lh *LoginHandler) HandleSignOut(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
logger.Info("Logout")
|
||||
expire := time.Now().Add(-7 * 24 * time.Hour)
|
||||
cookie := new(http.Cookie)
|
||||
cookie.Name = "token"
|
||||
cookie.Value = ""
|
||||
cookie.Path = "/"
|
||||
cookie.Expires = expire
|
||||
cookie.HttpOnly = true
|
||||
|
||||
c.SetCookie(cookie)
|
||||
|
||||
ret := `
|
||||
<script>
|
||||
console.log("signout")
|
||||
localStorage.removeItem("token")
|
||||
localStorage.removeItem("user")
|
||||
|
||||
setTimeout(() => {
|
||||
window.location.replace("/login");
|
||||
}, 200)
|
||||
</script>
|
||||
`
|
||||
c.Response().Header().Set("HX-Trigger", "script")
|
||||
return c.String(http.StatusOK, ret)
|
||||
}
|
||||
|
||||
func (lh *LoginHandler) HandleAutoLoginPage(c echo.Context) error {
|
||||
userToken := c.Get("user").(*jwt.Token)
|
||||
token := userToken.Raw
|
||||
claims := userToken.Claims.(jwt.MapClaims)
|
||||
userGroup := claims["M_UserGroupDashboard"].(string)
|
||||
|
||||
cookie := new(http.Cookie)
|
||||
cookie.Name = "token"
|
||||
cookie.Value = token
|
||||
cookie.Path = "/"
|
||||
cookie.HttpOnly = true
|
||||
c.SetCookie(cookie)
|
||||
|
||||
var url string
|
||||
switch userGroup {
|
||||
case "cpone":
|
||||
url = "/one-ui"
|
||||
case "pic":
|
||||
url = "/corp/dashboard_pic"
|
||||
case "patient":
|
||||
url = "/corp/dashboard_pat"
|
||||
default:
|
||||
url = "/one-ui"
|
||||
}
|
||||
|
||||
redirect := `
|
||||
<script>
|
||||
setTimeout(() => {
|
||||
htmx.ajax('GET', '/login/redirect?url=` + url + `', {
|
||||
headers: {
|
||||
Authorization: 'Bearer ` + token + `'
|
||||
}
|
||||
})
|
||||
}, 200)
|
||||
</script>
|
||||
`
|
||||
c.Response().Header().Set("HX-Trigger", "script")
|
||||
return c.String(http.StatusOK, redirect)
|
||||
}
|
||||
|
||||
func (lh *LoginHandler) HandleSignInV2(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
username := c.FormValue("username")
|
||||
password := c.FormValue("password")
|
||||
defer logger.Sync()
|
||||
|
||||
utype, err := lh.LoginService.CheckIsAccountCpone(username)
|
||||
if err != nil {
|
||||
logger.Info("[ERROR]", zap.Any("error check type account : ", err))
|
||||
|
||||
si := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
// logger.Info("[INFO]", zap.Any("type account : ", utype))
|
||||
// if utype == "cpone" {
|
||||
if utype != "" {
|
||||
url := "/one-ui/test/vuex/one-login-v2"
|
||||
c.Response().Header().Set("HX-Redirect", url)
|
||||
return c.String(http.StatusOK, utype)
|
||||
}
|
||||
|
||||
// resp, err := lh.LoginService.MultiSignIn(username, password, "")
|
||||
resp, err := lh.LoginService.MultiSignInV2(username, password)
|
||||
if err != nil {
|
||||
logger.Info("[ERROR]", zap.Any("error multi sigin: ", err))
|
||||
|
||||
si := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
if resp.Status == "ERR" {
|
||||
logger.Info("[ERROR]", zap.Any("error: ", resp.Status))
|
||||
|
||||
si := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
|
||||
return utils.View(c, si)
|
||||
}
|
||||
defer logger.Sync()
|
||||
|
||||
var url string
|
||||
switch resp.Data.Type {
|
||||
case "pic":
|
||||
url = "/corp/dashboard_pic"
|
||||
case "patient":
|
||||
url = "/corp/dashboard_pat"
|
||||
default:
|
||||
url = "/one-ui"
|
||||
}
|
||||
|
||||
user, err := json.Marshal(resp.Data.User)
|
||||
if err != nil {
|
||||
logger.Info("Error", zap.Error(err))
|
||||
|
||||
si := public_login.ShowLogin("Login ", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
|
||||
return utils.View(c, si)
|
||||
}
|
||||
|
||||
cookie := new(http.Cookie)
|
||||
cookie.Name = "token"
|
||||
cookie.Value = resp.Data.Token
|
||||
cookie.Path = "/"
|
||||
cookie.HttpOnly = true
|
||||
c.SetCookie(cookie)
|
||||
|
||||
user_str := string(user)
|
||||
store := `
|
||||
<script>
|
||||
console.log("store token");
|
||||
const token = "` + resp.Data.Token + `";
|
||||
const user = JSON.stringify(` + user_str + `);
|
||||
localStorage.setItem("token", token);
|
||||
localStorage.setItem("user", user);
|
||||
|
||||
htmx.on("htmx:configRequest", (e)=> {
|
||||
e.detail.headers["Authorization"] = "Bearer ` + resp.Data.Token + `"
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
htmx.ajax('GET', '/login/redirect?url=` + url + `')
|
||||
}, 200)
|
||||
</script>
|
||||
`
|
||||
|
||||
c.Response().Header().Set("HX-Trigger", "script")
|
||||
return c.String(http.StatusOK, store)
|
||||
}
|
||||
|
||||
func (lh *LoginHandler) HandleSignInV3(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
username := c.FormValue("username")
|
||||
password := c.FormValue("password")
|
||||
|
||||
// check is type cpone and exist in location
|
||||
resp, err := lh.LoginService.MultiSignInV2(username, password)
|
||||
if err != nil {
|
||||
logger.Error("[ERROR]", zap.Any("multi signin process: ", err))
|
||||
ret := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
|
||||
return utils.View(c, ret)
|
||||
}
|
||||
|
||||
if resp.Status == "ERR" {
|
||||
logger.Error("[ERROR]", zap.Any("response signin process error: ", resp.Status))
|
||||
ret := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
|
||||
return utils.View(c, ret)
|
||||
}
|
||||
defer logger.Sync()
|
||||
|
||||
var url string
|
||||
switch resp.Data.Type {
|
||||
case "pic":
|
||||
url = "/corp/dashboard_pic"
|
||||
case "patient":
|
||||
url = "/corp/dashboard_pat"
|
||||
default:
|
||||
url = "/one-ui"
|
||||
}
|
||||
|
||||
user, err := json.Marshal(resp.Data.User)
|
||||
if err != nil {
|
||||
logger.Error("[ERROR]", zap.Any("process marshal response user", err))
|
||||
ret := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
|
||||
return utils.View(c, ret)
|
||||
}
|
||||
|
||||
cookie := new(http.Cookie)
|
||||
cookie.Name = "token"
|
||||
cookie.Value = resp.Data.Token
|
||||
cookie.Path = "/"
|
||||
cookie.HttpOnly = true
|
||||
c.SetCookie(cookie)
|
||||
|
||||
user_str := string(user)
|
||||
// logger.Info("[INFO]", zap.Any("user data ", user_str))
|
||||
store := `
|
||||
<script>
|
||||
console.log("store token");
|
||||
const token = "` + resp.Data.Token + `";
|
||||
const user = JSON.stringify(` + user_str + `);
|
||||
localStorage.setItem("token", token);
|
||||
localStorage.setItem("user", user);
|
||||
|
||||
htmx.on("htmx:configRequest", (e)=> {
|
||||
e.detail.headers["Authorization"] = "Bearer ` + resp.Data.Token + `"
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
htmx.ajax('GET', '/login/redirect?url=` + url + `')
|
||||
}, 200)
|
||||
</script>
|
||||
`
|
||||
c.Response().Header().Set("HX-Trigger", "script")
|
||||
return c.String(http.StatusOK, store)
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package public_handlers
|
||||
|
||||
import (
|
||||
customtoastv2 "cpone/component/toastbootstrap"
|
||||
"cpone/utils"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func HandlerHideToast(c echo.Context) error {
|
||||
toastComponent := customtoastv2.CustomToastV2Hide()
|
||||
|
||||
si := toastComponent
|
||||
|
||||
return utils.View(c, si)
|
||||
}
|
||||
@@ -1,15 +1,12 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"cpone/auth"
|
||||
client_handlers "cpone/handlers/client"
|
||||
corporate_handlers "cpone/handlers/corporate"
|
||||
mcu_corporate_handlers "cpone/handlers/corporate/mcudetail"
|
||||
dev_handlers "cpone/handlers/dev"
|
||||
public_handlers "cpone/handlers/public"
|
||||
client_services "cpone/services/client"
|
||||
corporate_services "cpone/services/corporate"
|
||||
mcu_corporate_services "cpone/services/corporate/mcudetail"
|
||||
dev_services "cpone/services/dev"
|
||||
public_services "cpone/services/public"
|
||||
|
||||
@@ -19,10 +16,10 @@ import (
|
||||
)
|
||||
|
||||
func SetupRoutes(app *echo.Echo, h *dev_handlers.UserHandler) {
|
||||
// group := app.Group("/user")
|
||||
group := app.Group("/user")
|
||||
|
||||
// group.GET("", h.HandlerShowUsers)
|
||||
// group.GET("/details/:id", h.HandlerShowUserById)
|
||||
group.GET("", h.HandlerShowUsers)
|
||||
group.GET("/details/:id", h.HandlerShowUserById)
|
||||
|
||||
}
|
||||
|
||||
@@ -64,30 +61,13 @@ func SetupRoutesEmployee(app *echo.Echo, e *dev_handlers.EmployeeHandler) {
|
||||
func SetupRoutesProject(app *echo.Echo) {
|
||||
|
||||
}
|
||||
|
||||
func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) {
|
||||
public := app.Group("/")
|
||||
l := public_services.NewServicesLandingPage(public_services.LandingPage{}, appStore)
|
||||
lh := public_handlers.NewLandingPageHandler(l)
|
||||
public.GET("landingpage", lh.ShowLandingPage)
|
||||
public.GET("home", lh.ShowLandingPage)
|
||||
public.GET("home/login", lh.HandleBtnLogin)
|
||||
|
||||
public.GET("home/hidetoast", public_handlers.HandlerHideToast)
|
||||
|
||||
loginServ := public_services.NewServicesLogin(appStore)
|
||||
loginHadlr := public_handlers.NewLoginHandler(loginServ)
|
||||
public.GET("login", loginHadlr.HandlerShowLogin)
|
||||
|
||||
// ver cpone
|
||||
// public.POST("login/signin", loginHadlr.HandleSignIn)
|
||||
|
||||
// ver devcpone
|
||||
public.POST("login/signin", loginHadlr.HandleSignInV3)
|
||||
|
||||
public.GET("login/redirect", loginHadlr.HandleRedirect)
|
||||
public.GET("login/signout", loginHadlr.HandleSignOut)
|
||||
public.POST("login/autologin", loginHadlr.HandleAutoLoginPage, auth.IsAlreadyLogin)
|
||||
loginHdr := public_handlers.NewLoginHandler(l)
|
||||
public.GET("login", loginHdr.HandlerShowLogin)
|
||||
|
||||
// kartu kontrol
|
||||
publicKartuKontrolServices := public_services.NewServicesKartuKontrol(appStore)
|
||||
@@ -109,95 +89,17 @@ func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) {
|
||||
// redirect to survey mcu page
|
||||
public.GET("redirectsurveymcu", publicKartuKontrolhandlers.HandlerRedirectToSurveyMcu)
|
||||
}
|
||||
|
||||
func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) {
|
||||
corp := app.Group("/corp", auth.IsLoggedIn)
|
||||
// corp := app.Group("/corp")
|
||||
public := app.Group("/corp")
|
||||
l := corporate_services.NewServicesCompany(appStore)
|
||||
lh := corporate_handlers.NewCompanyHandler(l)
|
||||
corp.GET("/company", lh.ShowCompany)
|
||||
|
||||
// ganti password
|
||||
accountService := corporate_services.NewAccountService(appStore)
|
||||
accountHandler := corporate_handlers.NewAccountHandler(accountService)
|
||||
corp.POST("/dashboard_pic/tutupgantipassword", accountHandler.HandleCloseChangePassword)
|
||||
corp.POST("/dashboard_pic/gantipassword", accountHandler.HandleChangePassword)
|
||||
|
||||
// dashboard_pic
|
||||
dashbrdPicServ := corporate_services.NewDashboardPicServices(appStore)
|
||||
dashbrdPicHandl := corporate_handlers.NewDashboardPicHandler(dashbrdPicServ)
|
||||
corp.GET("/dashboard_pic", dashbrdPicHandl.HandleShowEmployeeAnalyticScreen)
|
||||
corp.GET("/dashboard_pic/changepage", dashbrdPicHandl.HandlePagination)
|
||||
corp.GET("/dashboard_pic/filter", dashbrdPicHandl.HandleFilter)
|
||||
corp.GET("/dashboard_pic/click/:id", dashbrdPicHandl.HandleToDetail)
|
||||
|
||||
// mcu detail
|
||||
mcudServ := corporate_services.NewMcuDetailServices(appStore)
|
||||
mcudHandr := corporate_handlers.NewMcuDetailHandler(mcudServ)
|
||||
corp.GET("/dashboard_pic/detail/:id", mcudHandr.HandlerShowMcuDetailScreen)
|
||||
|
||||
// tab kepesertaan
|
||||
kepesertaanSrvs := mcu_corporate_services.NewTabKepersertaanService(appStore)
|
||||
kepesertaanHdlr := mcu_corporate_handlers.NewTabKepersertaanHandler(kepesertaanSrvs)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabkepesertaan", kepesertaanHdlr.HandleShowTabKepesertaan)
|
||||
|
||||
// tab kelainan global
|
||||
kelainanglobalSrvs := mcu_corporate_services.NewTabKelainanGlobalServices(appStore)
|
||||
kelainanglobalHdlr := mcu_corporate_handlers.NewTabKelainanGlobalHandler(kelainanglobalSrvs)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabkelainanglobal", kelainanglobalHdlr.HandleShowTabKelainanGlobal)
|
||||
|
||||
// tab kelainan lab
|
||||
kelainanlabSrvs := mcu_corporate_services.NewTabKelainanLabServices(appStore)
|
||||
kelainanlabHdlr := mcu_corporate_handlers.NewTabKelainanLabHandler(kelainanlabSrvs)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabkelainanlab", kelainanlabHdlr.HandleShowTabKelainanLab)
|
||||
|
||||
// tab kelainan non lab
|
||||
kelnonlabSrvs := mcu_corporate_services.NewTabKelainanNonLabServices(appStore)
|
||||
kelnonlabHdlr := mcu_corporate_handlers.NewTabKelainanNonLabHandler(kelnonlabSrvs)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabkelainannonlab", kelnonlabHdlr.HandleShowTabKelainanNonLab)
|
||||
|
||||
// tab kelainan fisik
|
||||
kelainanfisikSrvs := mcu_corporate_services.NewTabKelainanFisikServices(appStore)
|
||||
kelainanfisikHdlr := mcu_corporate_handlers.NewTabKelainanFisikHandler(kelainanfisikSrvs)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabkelainanfisik", kelainanfisikHdlr.HandleShowTabKelainanFisik)
|
||||
|
||||
// tab kesimpulan
|
||||
kesimpulanSrv := mcu_corporate_services.NewTabKesimpulanServices(appStore)
|
||||
kesimpulanHdr := mcu_corporate_handlers.NewTabKesimpulanHandler(kesimpulanSrv)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabkesimpulan", kesimpulanHdr.HandleShowTabKesimpulanScreen)
|
||||
|
||||
// tab daftar peserta
|
||||
daftarpesertaServ := mcu_corporate_services.NewTabDaftarPesertaServices(appStore)
|
||||
daftarpesertaHandl := mcu_corporate_handlers.NewTabDaftarPesertaHandlers(daftarpesertaServ)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta", daftarpesertaHandl.HandleShowTabDaftarPeserta)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/changepage", daftarpesertaHandl.HandlePagination)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/openreport", daftarpesertaHandl.HandleOpenReportDialog)
|
||||
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/dialoggenpass", daftarpesertaHandl.HandleDialogGenPass)
|
||||
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/closegenpass", daftarpesertaHandl.HandleCloseDialogGenPass)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/openviewakun", daftarpesertaHandl.HandleOpenViewAkun)
|
||||
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/closeviewakun", daftarpesertaHandl.HandleCloseViewAkun)
|
||||
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/viewakun", daftarpesertaHandl.HandleAkun)
|
||||
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/reload", daftarpesertaHandl.HandleContentReload)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/opendetail", daftarpesertaHandl.HandleOpenDetail)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/filter", daftarpesertaHandl.HandleFilter)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/openattachment", daftarpesertaHandl.HandleOpenAttachmentFile)
|
||||
|
||||
// tab keuangan
|
||||
keuanganService := mcu_corporate_services.NewTabKeuanganServices(appStore)
|
||||
keuanganHandler := mcu_corporate_handlers.NewTabKeuanganHandler(keuanganService)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabkeuangan", keuanganHandler.HandleShowTabKeuangan)
|
||||
corp.GET("/dashboard_pic/detail/:id/tabkeuangan/changepage", keuanganHandler.HandleChangePage)
|
||||
|
||||
patienServices := corporate_services.NewPatientServices(appStore)
|
||||
patientHandler := corporate_handlers.NewPatientHandler(patienServices)
|
||||
corp.GET("/dashboard_pat", patientHandler.HandleShowPatient)
|
||||
corp.GET("/dashboard_pat/content", patientHandler.LoadLocalData)
|
||||
corp.GET("/dashboard_pat/changepage", patientHandler.HandleChangePage)
|
||||
corp.GET("/dashboard_pat/open", patientHandler.HandleOpenReport)
|
||||
public.GET("/company", lh.ShowCompany)
|
||||
patientHandler := corporate_handlers.NewPatientHandler(l)
|
||||
public.GET("/patient", patientHandler.ShowPatient)
|
||||
}
|
||||
|
||||
func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) {
|
||||
public := app.Group("/client", auth.IsLoggedIn)
|
||||
public := app.Group("/client")
|
||||
|
||||
lpanel := client_services.NewServicesMdPanel(appStore)
|
||||
lhpanel := client_handlers.NewMdPanelHandler(lpanel)
|
||||
@@ -330,34 +232,6 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
|
||||
// clientgroup.GET("/usergroup/edit", mastermenuusergroupHandler.ChangeFormEdit)
|
||||
// clientgroup.GET("/usergroup/pagination", mastermenuusergroupHandler.HandleChangePage)
|
||||
|
||||
// employee analytic
|
||||
devEmplAnaServices := dev_services.NewEmployeeAnalyticServices(appStore)
|
||||
devEmplAnaHandler := dev_handlers.NewEmployeeAnalyticHandler(devEmplAnaServices)
|
||||
dev.GET("/dashboard_pic", devEmplAnaHandler.HandleShowEmployeeAnalyticScreen)
|
||||
dev.GET("/dashboard_pic/changepage", devEmplAnaHandler.HandlePagination)
|
||||
dev.GET("/dashboard_pic/filter", devEmplAnaHandler.HandleFilter)
|
||||
dev.GET("/dashboard_pic/click/:id", devEmplAnaHandler.HandleIntoDetail)
|
||||
|
||||
devDetailMcuService := dev_services.NewDetailMcuServices(appStore)
|
||||
devDetailMcuHandler := dev_handlers.NewDetailMcuHandler(devDetailMcuService)
|
||||
dev.GET("/detail/:id", devDetailMcuHandler.HandleShowDetailMcuScreen)
|
||||
|
||||
// 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)
|
||||
|
||||
//New User Group
|
||||
devMdUserGroupServices := dev_services.NewMdUserGroupServices(appStore)
|
||||
devMdUserGroupHandlers := dev_handlers.NewMdUserGroupHandler(devMdUserGroupServices)
|
||||
@@ -373,35 +247,21 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
|
||||
dev.POST("/md/usergroupv2/closedeleteform", devMdUserGroupHandlers.HandleCloseFormDelete)
|
||||
dev.POST("/md/usergroupv2/delete", devMdUserGroupHandlers.HandleDeleteUserGroup)
|
||||
|
||||
// md sample station
|
||||
devMDSampleStationServices := dev_services.NewMDSampleStationServices(appStore)
|
||||
devMDSampleStationHandlers := dev_handlers.NewMDSampleStationHandler(devMDSampleStationServices)
|
||||
dev.GET("/md/samplestation", devMDSampleStationHandlers.HandleShowMDSampleStationScreen)
|
||||
dev.GET("/md/samplestation/filter", devMDSampleStationHandlers.HandleFilterMDSS)
|
||||
dev.GET("/md/samplestation/changepage", devMDSampleStationHandlers.HandleChangePageSampleStation)
|
||||
dev.POST("/md/samplestation/add", devMDSampleStationHandlers.HandleAddMDSampleStation)
|
||||
dev.POST("/md/samplestation/closeaddform", devMDSampleStationHandlers.HandleCloseFormAdd)
|
||||
dev.GET("/md/samplestation/opendelete", devMDSampleStationHandlers.HandleOpenDeleteForm)
|
||||
dev.POST("/md/samplestation/closedeleteform", devMDSampleStationHandlers.HandleCloseFormDelete)
|
||||
dev.POST("/md/samplestation/delete", devMDSampleStationHandlers.HandleDeleteMDSS)
|
||||
dev.GET("/md/samplestation/openedit", devMDSampleStationHandlers.HandleOpenEditForm)
|
||||
dev.POST("/md/samplestation/edit", devMDSampleStationHandlers.HandleEditMDSS)
|
||||
dev.POST("/md/samplestation/closeeditform", devMDSampleStationHandlers.HandleCloseEditForm)
|
||||
|
||||
// masterdata nat unit
|
||||
devMdNatUnitServices := dev_services.NewMdNatUnitServices(appStore)
|
||||
devMdNatUnitHandlers := dev_handlers.NeWMdNatUnitHandler(devMdNatUnitServices)
|
||||
dev.GET("/md/natunit", devMdNatUnitHandlers.HandleShowMdNatUnitScreen)
|
||||
dev.GET("/md/natunit/filter", devMdNatUnitHandlers.HandleFilterMdNatUnit)
|
||||
dev.GET("/md/natunit/changepage", devMdNatUnitHandlers.HandlerChangePageMdNatUnit)
|
||||
dev.POST("/md/natunit/closeaddform", devMdNatUnitHandlers.HandlerCloseFormAdd)
|
||||
dev.POST("/md/natunit/add", devMdNatUnitHandlers.HandlerAddNatUnit)
|
||||
dev.GET("/md/natunit/openedit", devMdNatUnitHandlers.HandlerOpenEditForm)
|
||||
dev.POST("/md/natunit/closeeditform", devMdNatUnitHandlers.HandlerCloseFormEdit)
|
||||
dev.POST("/md/natunit/edit", devMdNatUnitHandlers.HandlerEditNatUnit)
|
||||
dev.GET("/md/natunit/opendelete", devMdNatUnitHandlers.HandlerOpenDeleteForm)
|
||||
dev.POST("/md/natunit/closedeleteform", devMdNatUnitHandlers.HandlerCloseFormDelete)
|
||||
dev.POST("/md/natunit/delete", devMdNatUnitHandlers.HandlerDeleteNatUnit)
|
||||
// // group result
|
||||
// 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)
|
||||
@@ -417,28 +277,4 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
|
||||
dev.GET("/md/groupresultv2/opendelete", devMdGRhandlers.HandleOpenDeleteForm)
|
||||
dev.POST("/md/groupresultv2/closedeleteform", devMdGRhandlers.HandleCloseFormDelete)
|
||||
dev.POST("/md/groupresultv2/delete", devMdGRhandlers.HandleDeleteUserGroup)
|
||||
//MD BAHAN
|
||||
devMdBahanServices := dev_services.NewMdBahanServices(appStore)
|
||||
devMdBahanHandlers := dev_handlers.NewMdBahanHandler(devMdBahanServices)
|
||||
dev.GET("/md/bahan", devMdBahanHandlers.HandleShowMdBahanScreen)
|
||||
dev.GET("/md/bahan/filter", devMdBahanHandlers.HandleFilterMdBahan)
|
||||
dev.GET("/md/bahan/pagination", devMdBahanHandlers.HandlePaginationMdBahan)
|
||||
dev.POST("/md/bahan/add", devMdBahanHandlers.HandleAddMdBahan)
|
||||
dev.POST("/md/bahan/closeaddform", devMdBahanHandlers.HandleCloseFormAddMdBahan)
|
||||
dev.GET("/md/bahan/openedit", devMdBahanHandlers.HandleOpenEditMdBahan)
|
||||
dev.POST("/md/bahan/closeeditform", devMdBahanHandlers.HandleCloseFormEditMdBahan)
|
||||
dev.POST("/md/bahan/edit", devMdBahanHandlers.HandleEditMdBahan)
|
||||
dev.GET("/md/bahan/opendelete", devMdBahanHandlers.HandleOpenDeleteMdBahan)
|
||||
dev.POST("/md/bahan/closedeleteform", devMdBahanHandlers.HandleCloseDeleteMdBahan)
|
||||
dev.POST("/md/bahan/delete", devMdBahanHandlers.HandleDeleteMdBahan)
|
||||
|
||||
// Kesimpulan
|
||||
devKesimpulanServices := dev_services.NewServicesKesimpulan(appStore)
|
||||
devKesimpuanHandler := dev_handlers.NewKesimpulanHandler(devKesimpulanServices)
|
||||
dev.GET("/kesimpulan/:id", devKesimpuanHandler.HandleShowKesimpulanScreen)
|
||||
|
||||
// mcu daftar peserta
|
||||
devMcuDaftarPesertaServices := dev_services.NewMcuDaftarPesertaServices(appStore)
|
||||
devMcuDaftarPesertaHandler := dev_handlers.NewMcuDaftarPeserta(devMcuDaftarPesertaServices)
|
||||
dev.GET("/mcudaftarpeserta/:id", devMcuDaftarPesertaHandler.HandleGetMcuDaftarPeserta)
|
||||
}
|
||||
|
||||
@@ -266,8 +266,6 @@ templ CorporateLayout(title string, css templ.Component, js templ.Component, nav
|
||||
<script src="assets/js/scripts.bundle.js"></script>
|
||||
<!--end::Global Theme Bundle-->
|
||||
<script src="assets/js/iconify/iconify.min.js"></script>
|
||||
// bootstrap datepicker
|
||||
<script src="assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js"></script>
|
||||
@js
|
||||
<!--end::Page Scripts-->
|
||||
</body>
|
||||
|
||||
@@ -78,7 +78,7 @@ func CorporateLayout(title string, css templ.Component, js templ.Component, navb
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--begin::Global Config(global config for global JS scripts)--><script src=\"asset-corporate-portal/js/ktappsetting.js\"></script><!--end::Global Config--><!--begin::Global Theme Bundle(used by all pages)--><script src=\"assets/plugins/global/plugins.bundle.js\"></script><script src=\"assets/plugins/custom/prismjs/prismjs.bundle.js\"></script><script src=\"assets/js/scripts.bundle.js\"></script><!--end::Global Theme Bundle--><script src=\"assets/js/iconify/iconify.min.js\"></script><script src=\"assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js\"></script>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--begin::Global Config(global config for global JS scripts)--><script src=\"asset-corporate-portal/js/ktappsetting.js\"></script><!--end::Global Config--><!--begin::Global Theme Bundle(used by all pages)--><script src=\"assets/plugins/global/plugins.bundle.js\"></script><script src=\"assets/plugins/custom/prismjs/prismjs.bundle.js\"></script><script src=\"assets/js/scripts.bundle.js\"></script><!--end::Global Theme Bundle--><script src=\"assets/js/iconify/iconify.min.js\"></script>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -1,197 +0,0 @@
|
||||
package layout
|
||||
|
||||
templ DashboardLayout(
|
||||
title string,
|
||||
css templ.Component,
|
||||
js templ.Component,
|
||||
navbaruser templ.Component,
|
||||
sidebaruser templ.Component,
|
||||
) {
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--begin::Head-->
|
||||
<head>
|
||||
<base href="/"/>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Company Portal | { title }</title>
|
||||
<meta name="description" content="Company Portal"/>
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||||
/>
|
||||
<!--begin::Fonts-->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/poppins.css"
|
||||
/>
|
||||
<!--end::Fonts-->
|
||||
<!--begin::Page Custom Styles(used by this page)-->
|
||||
<link
|
||||
href="assets/css/pages/login/login-1.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!--end::Page Custom Styles-->
|
||||
<!--begin::Global Theme Styles(used by all pages)-->
|
||||
<link
|
||||
href="assets/plugins/global/plugins.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/plugins/custom/prismjs/prismjs.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css"/>
|
||||
<!--end::Global Theme Styles-->
|
||||
<!--begin::Layout Themes(used by all pages)-->
|
||||
<link
|
||||
href="assets/css/themes/layout/header/base/light.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/header/menu/light.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/brand/dark.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="assets/css/themes/layout/aside/dark.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<!--end::Layout Themes-->
|
||||
<link
|
||||
rel="shortcut icon"
|
||||
href="asset-corporate-portal/media/logo/logo-small.jpg"
|
||||
/>
|
||||
<!--end::Layout Themes SAS-->
|
||||
<link
|
||||
href="asset-corporate-portal/css/sas.bundle.css"
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/publicsans.css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/roboto.css"
|
||||
/>
|
||||
<!-- slick -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
href="assets/css/slick/slick.css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
href="assets/css/slick/slick-theme.css"
|
||||
/>
|
||||
@css
|
||||
</head>
|
||||
<!--end::Head-->
|
||||
<!--begin::Body-->
|
||||
<body id="kt_body" class="header-fixed header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading bg-white">
|
||||
<script src="assets/js/htmx/htmx.min.js"></script>
|
||||
<!--start::Navbar Mobile-->
|
||||
<div id="kt_header_mobile" class="header-mobile align-items-center header-mobile-fixed ">
|
||||
<!--begin::Logo-->
|
||||
<a href="index.html">
|
||||
<img alt="Logo" src="asset-corporate-portal/media/logo/logo.png" style="object-fit: contain;height: 4vh;"/>
|
||||
</a>
|
||||
<!--end::Logo-->
|
||||
<!--begin::Toolbar-->
|
||||
<div class="d-flex align-items-center">
|
||||
<!--begin::Topbar Mobile Toggle-->
|
||||
<button class="btn btn-hover-text-primary p-0 ml-2" id="kt_header_mobile_topbar_toggle">
|
||||
<span class="svg-icon svg-icon-xl">
|
||||
<!--begin::Svg Icon | path:/assets/media/svg/icons/General/User.svg-->
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="24px"
|
||||
height="24px"
|
||||
viewBox="0 0 24 24"
|
||||
version="1.1"
|
||||
>
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon points="0 0 24 0 24 24 0 24"></polygon>
|
||||
<path
|
||||
d="M12,11 C9.790861,11 8,9.209139 8,7 C8,4.790861 9.790861,3 12,3 C14.209139,3 16,4.790861 16,7 C16,9.209139 14.209139,11 12,11 Z"
|
||||
fill="#000000"
|
||||
fill-rule="nonzero"
|
||||
opacity="0.3"
|
||||
></path>
|
||||
<path
|
||||
d="M3.00065168,20.1992055 C3.38825852,15.4265159 7.26191235,13 11.9833413,13 C16.7712164,13 20.7048837,15.2931929 20.9979143,20.2 C21.0095879,20.3954741 20.9979143,21 20.2466999,21 C16.541124,21 11.0347247,21 3.72750223,21 C3.47671215,21 2.97953825,20.45918 3.00065168,20.1992055 Z"
|
||||
fill="#000000"
|
||||
fill-rule="nonzero"
|
||||
></path>
|
||||
</g>
|
||||
</svg><!--end::Svg Icon-->
|
||||
</span>
|
||||
</button>
|
||||
<!--end::Topbar Mobile Toggle-->
|
||||
</div>
|
||||
<!--end::Toolbar-->
|
||||
</div>
|
||||
<!--start::Navbar Mobile-->
|
||||
<!--start::Navbar Laptop With Sidebar-->
|
||||
<div class="mb-24 mt-8" style="padding-left: 10vw; padding-right: 10vw;">
|
||||
<div class="align-item-center">
|
||||
@navbaruser
|
||||
</div>
|
||||
<div class="mt-16">
|
||||
// toast
|
||||
<div class="toast-top-right" id="container-system-notification" style="position: absolute; top: 1vh; right: 0vw; z-index: 999;">
|
||||
<!-- toast success -->
|
||||
<div
|
||||
id="notification-001"
|
||||
class="toast fade hide"
|
||||
role="alert"
|
||||
aria-live="assertive"
|
||||
aria-atomic="true"
|
||||
>
|
||||
<div class="toast-header bg-success text-white">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--ep mr-2 icon-xl" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 1024 1024" data-icon="ep:success-filled"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"></path></svg>
|
||||
<strong class="mr-auto">Success</strong>
|
||||
<small class="text-muted text-white">just now</small>
|
||||
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body bg-success-transparent">
|
||||
This is a success toast.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{ children... }
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Navbar Laptop With Sidebar-->
|
||||
@sidebaruser
|
||||
<!--begin::Global Config(global config for global JS scripts)-->
|
||||
<script src="asset-corporate-portal/js/ktappsetting.js"></script>
|
||||
<!--end::Global Config-->
|
||||
<!--begin::Global Theme Bundle(used by all pages)-->
|
||||
<script src="assets/plugins/global/plugins.bundle.js"></script>
|
||||
<script src="assets/plugins/custom/prismjs/prismjs.bundle.js"></script>
|
||||
<script src="assets/js/scripts.bundle.js"></script>
|
||||
<!--end::Global Theme Bundle-->
|
||||
<script src="assets/js/iconify/iconify.min.js"></script>
|
||||
// bootstrap datepicker
|
||||
<script src="assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js"></script>
|
||||
@js
|
||||
<!--end::Page Scripts-->
|
||||
</body>
|
||||
</html>
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package layout
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
func DashboardLayout(
|
||||
title string,
|
||||
css templ.Component,
|
||||
js templ.Component,
|
||||
navbaruser templ.Component,
|
||||
sidebaruser templ.Component,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var1 == nil {
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><html lang=\"en\"><!--begin::Head--><head><base href=\"/\"><meta charset=\"utf-8\"><title>Company Portal | ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `layout\layout_dashboard.templ`, Line: 16, Col: 34}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</title><meta name=\"description\" content=\"Company Portal\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"><!--begin::Fonts--><link rel=\"stylesheet\" href=\"assets/css/googlefont/poppins.css\"><!--end::Fonts--><!--begin::Page Custom Styles(used by this page)--><link href=\"assets/css/pages/login/login-1.css\" rel=\"stylesheet\" type=\"text/css\"><!--end::Page Custom Styles--><!--begin::Global Theme Styles(used by all pages)--><link href=\"assets/plugins/global/plugins.bundle.css\" rel=\"stylesheet\" type=\"text/css\"><link href=\"assets/plugins/custom/prismjs/prismjs.bundle.css\" rel=\"stylesheet\" type=\"text/css\"><link href=\"assets/css/style.bundle.css\" rel=\"stylesheet\" type=\"text/css\"><!--end::Global Theme Styles--><!--begin::Layout Themes(used by all pages)--><link href=\"assets/css/themes/layout/header/base/light.css\" rel=\"stylesheet\" type=\"text/css\"><link href=\"assets/css/themes/layout/header/menu/light.css\" rel=\"stylesheet\" type=\"text/css\"><link href=\"assets/css/themes/layout/brand/dark.css\" rel=\"stylesheet\" type=\"text/css\"><link href=\"assets/css/themes/layout/aside/dark.css\" rel=\"stylesheet\" type=\"text/css\"><!--end::Layout Themes--><link rel=\"shortcut icon\" href=\"asset-corporate-portal/media/logo/logo-small.jpg\"><!--end::Layout Themes SAS--><link href=\"asset-corporate-portal/css/sas.bundle.css\" rel=\"stylesheet\" type=\"text/css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/publicsans.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/roboto.css\"><!-- slick --><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/slick/slick.css\"><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/slick/slick-theme.css\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = css.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</head><!--end::Head--><!--begin::Body--><body id=\"kt_body\" class=\"header-fixed header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading bg-white\"><script src=\"assets/js/htmx/htmx.min.js\"></script><!--start::Navbar Mobile--><div id=\"kt_header_mobile\" class=\"header-mobile align-items-center header-mobile-fixed \"><!--begin::Logo--><a href=\"index.html\"><img alt=\"Logo\" src=\"asset-corporate-portal/media/logo/logo.png\" style=\"object-fit: contain;height: 4vh;\"></a><!--end::Logo--><!--begin::Toolbar--><div class=\"d-flex align-items-center\"><!--begin::Topbar Mobile Toggle--><button class=\"btn btn-hover-text-primary p-0 ml-2\" id=\"kt_header_mobile_topbar_toggle\"><span class=\"svg-icon svg-icon-xl\"><!--begin::Svg Icon | path:/assets/media/svg/icons/General/User.svg--><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" version=\"1.1\"><g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"><polygon points=\"0 0 24 0 24 24 0 24\"></polygon> <path d=\"M12,11 C9.790861,11 8,9.209139 8,7 C8,4.790861 9.790861,3 12,3 C14.209139,3 16,4.790861 16,7 C16,9.209139 14.209139,11 12,11 Z\" fill=\"#000000\" fill-rule=\"nonzero\" opacity=\"0.3\"></path> <path d=\"M3.00065168,20.1992055 C3.38825852,15.4265159 7.26191235,13 11.9833413,13 C16.7712164,13 20.7048837,15.2931929 20.9979143,20.2 C21.0095879,20.3954741 20.9979143,21 20.2466999,21 C16.541124,21 11.0347247,21 3.72750223,21 C3.47671215,21 2.97953825,20.45918 3.00065168,20.1992055 Z\" fill=\"#000000\" fill-rule=\"nonzero\"></path></g></svg><!--end::Svg Icon--></span></button><!--end::Topbar Mobile Toggle--></div><!--end::Toolbar--></div><!--start::Navbar Mobile--><!--start::Navbar Laptop With Sidebar--><div class=\"mb-24 mt-8\" style=\"padding-left: 10vw; padding-right: 10vw;\"><div class=\"align-item-center\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = navbaruser.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"mt-16\"><div class=\"toast-top-right\" id=\"container-system-notification\" style=\"position: absolute; top: 1vh; right: 0vw; z-index: 999;\"><!-- toast success --><div id=\"notification-001\" class=\"toast fade hide\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"><div class=\"toast-header bg-success text-white\"><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" role=\"img\" class=\"iconify iconify--ep mr-2 icon-xl\" width=\"1em\" height=\"1em\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 1024 1024\" data-icon=\"ep:success-filled\"><path fill=\"currentColor\" d=\"M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z\"></path></svg> <strong class=\"mr-auto\">Success</strong> <small class=\"text-muted text-white\">just now</small> <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div><div class=\"toast-body bg-success-transparent\">This is a success toast.\r</div></div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><!--end::Navbar Laptop With Sidebar-->")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = sidebaruser.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--begin::Global Config(global config for global JS scripts)--><script src=\"asset-corporate-portal/js/ktappsetting.js\"></script><!--end::Global Config--><!--begin::Global Theme Bundle(used by all pages)--><script src=\"assets/plugins/global/plugins.bundle.js\"></script><script src=\"assets/plugins/custom/prismjs/prismjs.bundle.js\"></script><script src=\"assets/js/scripts.bundle.js\"></script><!--end::Global Theme Bundle--><script src=\"assets/js/iconify/iconify.min.js\"></script><script src=\"assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js\"></script>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = js.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--end::Page Scripts--></body></html>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
@@ -3,6 +3,18 @@ package layout
|
||||
// LAYOUT PLAYGROUND
|
||||
templ PlaygroundLayout(title string, css templ.Component, js templ.Component) {
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Template Name: Metronic - Bootstrap 4 HTML, React, Angular 9 & VueJS Admin Dashboard Theme
|
||||
Author: KeenThemes
|
||||
Website: http://www.keenthemes.com/
|
||||
Contact: support@keenthemes.com
|
||||
Follow: www.twitter.com/keenthemes
|
||||
Dribbble: www.dribbble.com/keenthemes
|
||||
Like: www.facebook.com/keenthemes
|
||||
Purchase: https://1.envato.market/EA4JP
|
||||
Renew Support: https://1.envato.market/EA4JP
|
||||
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
|
||||
-->
|
||||
<html lang="en">
|
||||
<!--begin::Head-->
|
||||
<head>
|
||||
|
||||
@@ -24,14 +24,14 @@ func PlaygroundLayout(title string, css templ.Component, js templ.Component) tem
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><html lang=\"en\"><!--begin::Head--><head><base href=\"/\"><meta charset=\"utf-8\"><title>Company Portal | ")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><!--\r\n\t\tTemplate Name: Metronic - Bootstrap 4 HTML, React, Angular 9 & VueJS Admin Dashboard Theme\r\n\t\tAuthor: KeenThemes\r\n\t\tWebsite: http://www.keenthemes.com/\r\n\t\tContact: support@keenthemes.com\r\n\t\tFollow: www.twitter.com/keenthemes\r\n\t\tDribbble: www.dribbble.com/keenthemes\r\n\t\tLike: www.facebook.com/keenthemes\r\n\t\tPurchase: https://1.envato.market/EA4JP\r\n\t\tRenew Support: https://1.envato.market/EA4JP\r\n\t\tLicense: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.\r\n\t\t--><html lang=\"en\"><!--begin::Head--><head><base href=\"/\"><meta charset=\"utf-8\"><title>Company Portal | ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `layout\playground_layout.templ`, Line: 11, Col: 34}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `layout\playground_layout.templ`, Line: 23, Col: 34}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
package models
|
||||
|
||||
type ResponseStatus struct {
|
||||
Status string `json:"status"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package models
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
|
||||
type Bahan struct {
|
||||
T_BahanID int `db:"T_BahanID"`
|
||||
T_BahanT_SampleStationID int `db:"T_BahanT_SampleStationID"`
|
||||
T_SampleStationID int `db:"T_SampleStationID"`
|
||||
T_SampleStationName string `db:"T_SampleStationName"`
|
||||
T_BahanCode string `db:"T_BahanCode"`
|
||||
T_BahanName string `db:"T_BahanName"`
|
||||
T_BahanLangName string `db:"T_BahanLangName"`
|
||||
T_BahanIsActive string `db:"T_BahanIsActive"`
|
||||
T_BahanCreated string `db:"T_BahanCreated"`
|
||||
T_BahanCreatedUserID string `db:"T_BahanCreatedUserID"`
|
||||
T_BahanLastUpdated string `db:"T_BahanLastUpdated"`
|
||||
T_BahanLastUpdatedUserID string `db:"T_BahanLastUpdatedUserID"`
|
||||
T_BahanDeleted string `db:"T_BahanDeleted"`
|
||||
T_BahanDeletedUserID string `db:"T_BahanDeletedUserID"`
|
||||
}
|
||||
|
||||
type TmpSampleStation struct {
|
||||
T_SampleStationID int `db:"T_SampleStationID"`
|
||||
T_SampleStationName string `db:"T_SampleStationName"`
|
||||
}
|
||||
|
||||
type BahanFormComponent struct {
|
||||
IDComponent string
|
||||
Link string
|
||||
HxTarget string
|
||||
HxSwap string
|
||||
HxInclude string
|
||||
ModalID string
|
||||
ModalTitle string
|
||||
DialogBody templ.Component
|
||||
DialogAction templ.Component
|
||||
ButtonCLose templ.Component
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
package models
|
||||
|
||||
type SeriesData struct {
|
||||
Value int `json:"value"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type Series struct {
|
||||
Label struct {
|
||||
Position string `json:"position"`
|
||||
Formatter string `json:"formatter"`
|
||||
} `json:"label"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
Radius []string `json:"radius"`
|
||||
ItemStyle struct {
|
||||
BorderRadius int `json:"borderRadius"`
|
||||
BorderColor string `json:"borderColor"`
|
||||
BorderWidth int `json:"borderWidth"`
|
||||
} `json:"itemStyle"`
|
||||
Data []SeriesData `json:"data"`
|
||||
Emphasis struct {
|
||||
ItemStyle struct {
|
||||
ShadowBlur int `json:"shadowBlur"`
|
||||
ShadowOffsetX int `json:"shadowOffsetX"`
|
||||
ShadowColor string `json:"shadowColor"`
|
||||
} `json:"itemStyle"`
|
||||
} `json:"emphasis"`
|
||||
}
|
||||
|
||||
type Piechart struct {
|
||||
Title struct {
|
||||
Text string `json:"text"`
|
||||
SubText string `json:"subtext"`
|
||||
Left string `json:"left"`
|
||||
} `json:"title"`
|
||||
Tooltip struct {
|
||||
Trigger string `json:"trigger"`
|
||||
} `json:"tooltip"`
|
||||
Legend struct {
|
||||
Top string `json:"top"`
|
||||
Left string `json:"left"`
|
||||
Orient string `json:"orient"`
|
||||
Height int `json:"height"`
|
||||
} `json:"legend"`
|
||||
Series []Series `json:"series"`
|
||||
}
|
||||
|
||||
type Barchart struct {
|
||||
Title struct {
|
||||
Text string `json:"text"`
|
||||
Left string `json:"left"`
|
||||
} `json:"title"`
|
||||
Dataset struct {
|
||||
Source [][]interface{} `json:"source"`
|
||||
} `json:"dataset"`
|
||||
Grid struct {
|
||||
ContainLabel bool `json:"containLabel"`
|
||||
} `json:"grid"`
|
||||
XAxis struct {
|
||||
Name string `json:"name"`
|
||||
} `json:"xAxis"`
|
||||
YAxis struct {
|
||||
Type string `json:"type"`
|
||||
} `json:"yAxis"`
|
||||
VisualMap struct {
|
||||
Orient string `json:"orient"`
|
||||
Left string `json:"left"`
|
||||
Min int `json:"min"`
|
||||
Max int `json:"max"`
|
||||
Show bool `json:"show"`
|
||||
Dimension int `json:"dimension"`
|
||||
InRange struct {
|
||||
Color []string `json:"color"`
|
||||
} `json:"inRange"`
|
||||
} `json:"visualMap"`
|
||||
Series []struct {
|
||||
Label struct {
|
||||
Position string `json:"position"`
|
||||
Show bool `json:"show"`
|
||||
Formatter string `json:"formatter"`
|
||||
} `json:"label"`
|
||||
Type string `json:"type"`
|
||||
Encode struct {
|
||||
X string `json:"x"`
|
||||
Y string `json:"y"`
|
||||
} `json:"encode"`
|
||||
} `json:"series"`
|
||||
Tooltip struct {
|
||||
Trigger string `json:"trigger"`
|
||||
AxisPointer struct {
|
||||
Type string `json:"type"`
|
||||
} `json:"axisPointer"`
|
||||
} `json:"tooltip"`
|
||||
Graphic struct {
|
||||
Type string `json:"type"`
|
||||
Left string `json:"left"`
|
||||
Top string `json:"top"`
|
||||
Style struct {
|
||||
Text string `json:"text"`
|
||||
FontSize string `json:"fontSize"`
|
||||
FontWeight string `json:"fontWeight"`
|
||||
} `json:"style"`
|
||||
} `json:"graphic"`
|
||||
}
|
||||
|
||||
type BarDataset struct {
|
||||
Source [][]interface{} `json:"source"`
|
||||
}
|
||||
|
||||
type BarchartV2 struct {
|
||||
Title struct {
|
||||
Text string `json:"text"`
|
||||
Left string `json:"left"`
|
||||
} `json:"title"`
|
||||
Dataset struct {
|
||||
Source [][]interface{} `json:"source"`
|
||||
} `json:"dataset"`
|
||||
Grid struct {
|
||||
ContainLabel bool `json:"containLabel"`
|
||||
} `json:"grid"`
|
||||
XAxis struct {
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
AxisLabel struct {
|
||||
Interval int `json:"interval"`
|
||||
Rotate int `json:"rotate"`
|
||||
} `json:"axisLabel"`
|
||||
} `json:"xAxis"`
|
||||
YAxis struct {
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
NameTextStyle struct {
|
||||
Align string `json:"align"`
|
||||
} `json:"nameTextStyle"`
|
||||
NameGap int `json:"nameGap"`
|
||||
} `json:"yAxis"`
|
||||
VisualMap struct {
|
||||
Orient string `json:"orient"`
|
||||
Left string `json:"left"`
|
||||
Min int `json:"min"`
|
||||
Max int `json:"max"`
|
||||
Dimension int `json:"dimension"`
|
||||
Show bool `json:"show"`
|
||||
InRange struct {
|
||||
Color []string `json:"color"`
|
||||
} `json:"inRange"`
|
||||
} `json:"visualMap"`
|
||||
Series []struct {
|
||||
Label struct {
|
||||
Position string `json:"position"`
|
||||
Show bool `json:"show"`
|
||||
Formatter string `json:"formatter"`
|
||||
} `json:"label"`
|
||||
Type string `json:"type"`
|
||||
Encode struct {
|
||||
X string `json:"x"`
|
||||
Y string `json:"y"`
|
||||
} `json:"encode"`
|
||||
} `json:"series"`
|
||||
Tooltip struct {
|
||||
Trigger string `json:"trigger"`
|
||||
AxisPointer struct {
|
||||
Type string `json:"type"`
|
||||
} `json:"axisPointer"`
|
||||
} `json:"tooltip"`
|
||||
Graphic struct {
|
||||
Type string `json:"type"`
|
||||
Left string `json:"left"`
|
||||
Top string `json:"top"`
|
||||
Style struct {
|
||||
Text string `json:"text"`
|
||||
FontSize string `json:"fontSize"`
|
||||
FontWeight string `json:"fontWeight"`
|
||||
} `json:"style"`
|
||||
} `json:"graphic"`
|
||||
}
|
||||
23
models/component/breadcrumbadmin/breadcrumbadmin.templ
Normal file
23
models/component/breadcrumbadmin/breadcrumbadmin.templ
Normal 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>
|
||||
}
|
||||
35
models/component/breadcrumbadmin/breadcrumbadmin_templ.go
Normal file
35
models/component/breadcrumbadmin/breadcrumbadmin_templ.go
Normal 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
|
||||
})
|
||||
}
|
||||
26
models/component/breadcrumbadmin/breadcrumbadminv1.templ
Normal file
26
models/component/breadcrumbadmin/breadcrumbadminv1.templ
Normal 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>
|
||||
}
|
||||
102
models/component/breadcrumbadmin/breadcrumbadminv1_templ.go
Normal file
102
models/component/breadcrumbadmin/breadcrumbadminv1_templ.go
Normal 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
|
||||
})
|
||||
}
|
||||
30
models/component/chart/chart.templ
Normal file
30
models/component/chart/chart.templ
Normal 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]);
|
||||
});
|
||||
}
|
||||
82
models/component/chart/chart_templ.go
Normal file
82
models/component/chart/chart_templ.go
Normal 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),
|
||||
}
|
||||
}
|
||||
25
models/component/customcheckbox/customcheckboxv1.templ
Normal file
25
models/component/customcheckbox/customcheckboxv1.templ
Normal 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>
|
||||
}
|
||||
143
models/component/customcheckbox/customcheckboxv1_templ.go
Normal file
143
models/component/customcheckbox/customcheckboxv1_templ.go
Normal 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
|
||||
})
|
||||
}
|
||||
61
models/component/customdropdown/customdropdown.templ
Normal file
61
models/component/customdropdown/customdropdown.templ
Normal 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>
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package corporate_dashboardpic
|
||||
package customdropdown
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
@@ -10,15 +10,9 @@ import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
func FilterListing(
|
||||
hxGet string,
|
||||
hxTrigger string,
|
||||
hxInclude string,
|
||||
hxSwap string,
|
||||
hxTarget string,
|
||||
hxBeforeRequest templ.ComponentScript,
|
||||
hxAfterRequest templ.ComponentScript,
|
||||
) templ.Component {
|
||||
import "cpone/models"
|
||||
|
||||
func MainCustomDropdown(inp models.CustomDropdownv1Prm, listItem templ.Component) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
@@ -31,280 +25,313 @@ func FilterListing(
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row pt-8 align-items-center\"><div class=\"col-12 col-sm-3 col-md-1 col-lg-1 col-xl-1 mb-2\"><label class=\"text-black font-weight-bolder\">Start Date:</label></div><div class=\"col-12 col-sm-9 col-md-2 col-lg-2 col-xl-2 mb-2\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest, hxAfterRequest)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input id=\"startdateID\" name=\"startdate\" class=\"form-control form-control-lg bg-field border-0 rounded-lg\" type=\"date\" autocomplete=\"off\" hx-get=\"")
|
||||
_, 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(hxGet)
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 23, Col: 30}
|
||||
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("\" hx-trigger=\"")
|
||||
_, 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(hxTrigger)
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 24, Col: 38}
|
||||
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-include=\"")
|
||||
_, 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(hxInclude)
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxGet)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 25, Col: 38}
|
||||
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-swap=\"")
|
||||
_, 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(hxSwap)
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 26, Col: 32}
|
||||
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-target=\"")
|
||||
_, 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(hxTarget)
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(inp.HxIndicator)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 27, Col: 36}
|
||||
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-on::before-request=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-trigger=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 templ.ComponentScript = hxBeforeRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7.Call)
|
||||
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-on::after-request=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 templ.ComponentScript = hxAfterRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.Call)
|
||||
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("\"></div><div class=\"col-12 col-sm-3 col-md-1 col-lg-1 col-xl-1 mb-2\"><label class=\"text-black font-weight-bolder\">End Date:</label></div><div class=\"col-12 col-sm-9 col-md-2 col-lg-2 col-xl-2 mb-2\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest, hxAfterRequest)
|
||||
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("<input id=\"enddateID\" name=\"enddate\" class=\"form-control form-control-lg bg-field border-0 rounded-lg\" type=\"date\" autocomplete=\"off\" hx-get=\"")
|
||||
_, 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(hxGet)
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 42, Col: 30}
|
||||
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("\" hx-trigger=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 43, Col: 38}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 44, Col: 38}
|
||||
}
|
||||
_, 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-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var12 string
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 45, 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-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 46, Col: 36}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, 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-on::after-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var15 templ.ComponentScript = hxAfterRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div><div class=\"col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 mb-2\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest, hxAfterRequest)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input id=\"searchID\" name=\"search\" class=\"form-control form-control-lg bg-field border-0 rounded-lg\" type=\"text\" placeholder=\"Nama MCU\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var16 string
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 58, Col: 30}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-trigger=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var17 string
|
||||
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 59, Col: 38}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var18 string
|
||||
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 60, Col: 38}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var19 string
|
||||
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 61, Col: 32}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var20 string
|
||||
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 62, Col: 36}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var21 templ.ComponentScript = hxBeforeRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var21.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var22 templ.ComponentScript = hxAfterRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div></div>")
|
||||
_, 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
|
||||
}
|
||||
17
models/component/customtextfield/customtextfield.templ
Normal file
17
models/component/customtextfield/customtextfield.templ
Normal 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>
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package customradiobuttoninline
|
||||
package customtextfield
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
@@ -10,9 +10,10 @@ import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
import "cpone/models"
|
||||
|
||||
func MainCustomRadioButtonInput(inp models.CustomRadioButtonv1Prm) templ.Component {
|
||||
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 {
|
||||
@@ -25,59 +26,72 @@ func MainCustomRadioButtonInput(inp models.CustomRadioButtonv1Prm) templ.Compone
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mt-5\"><label for=\"input1\" style=\"font-family: Poppins; font-weight: 600\">")
|
||||
_, 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(inp.Label)
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inpLabelText)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customradiobutton\customradiobuttoninline.templ`, Line: 7, Col: 80}
|
||||
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><div class=\"form-control\"><div class=\"form-group\"><div style=\"display: flex; gap: 20px\"><label style=\"display: flex; align-items: center; gap: 5px\"><input type=\"radio\" name=\"nationality\" value=\"")
|
||||
_, 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.Value)
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(inpName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customradiobutton\customradiobuttoninline.templ`, Line: 12, Col: 62}
|
||||
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("\"><p style=\"margin: 0\">")
|
||||
_, 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.Text)
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inpName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customradiobutton\customradiobuttoninline.templ`, Line: 13, Col: 37}
|
||||
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("</p></label></div></div></div><div class=\"invalid-feedback text-danger mt-3 ml-2 mt-5\">")
|
||||
_, 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.ErrorMsg)
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inpType)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customradiobutton\customradiobuttoninline.templ`, Line: 19, Col: 17}
|
||||
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("</div></div>")
|
||||
_, 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
|
||||
}
|
||||
31
models/component/customtextfield/customtextfieldv2.templ
Normal file
31
models/component/customtextfield/customtextfieldv2.templ
Normal 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>
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package corporate_daftarpeserta
|
||||
package customtextfield
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
@@ -10,10 +10,9 @@ import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
func Filter_DaftarPeserta(
|
||||
hx_get string, hx_target string, hx_include string, hx_swap string,
|
||||
hx_trigger string, hx_before templ.ComponentScript, hx_after templ.ComponentScript,
|
||||
) templ.Component {
|
||||
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 {
|
||||
@@ -26,98 +25,128 @@ func Filter_DaftarPeserta(
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row pt-8 align-items-center\"><div class=\"col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 mb-2\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"form-group\"><label")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hx_before, hx_after)
|
||||
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("<input id=\"search-daftar-peserta\" type=\"text\" placeholder=\"Cari nama peserta atau NIP\" name=\"searchdp\" class=\"form-control form-control-lg bg-field border-0 rounded-lg\" hx-get=\"")
|
||||
_, 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(hx_get)
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Label)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\filter.templ`, Line: 12, Col: 31}
|
||||
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("\" hx-target=\"")
|
||||
_, 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(hx_target)
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\filter.templ`, Line: 12, Col: 55}
|
||||
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("\" hx-include=\"")
|
||||
_, 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(hx_include)
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\filter.templ`, Line: 12, Col: 81}
|
||||
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("\" hx-swap=\"")
|
||||
_, 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(hx_swap)
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Type)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\filter.templ`, Line: 12, Col: 101}
|
||||
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("\" hx-trigger=\"")
|
||||
_, 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(hx_trigger)
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Placeholder)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\filter.templ`, Line: 13, Col: 39}
|
||||
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("\" hx-on::before-request=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 templ.ComponentScript = hx_before
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7.Call)
|
||||
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("\" hx-on::after-request=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 templ.ComponentScript = hx_after
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.Call)
|
||||
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
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div></div>")
|
||||
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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
@@ -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>
|
||||
}
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
30
models/component/modal/modal.templ
Normal file
30
models/component/modal/modal.templ
Normal 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>
|
||||
}
|
||||
52
models/component/modal/modal_confirmation.templ
Normal file
52
models/component/modal/modal_confirmation.templ
Normal 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>
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package corporate_kesimpulan
|
||||
package modalcomponent
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
@@ -10,13 +10,14 @@ import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
import (
|
||||
"cpone/component/table"
|
||||
"cpone/models"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func Table_Kesimpulan(title string, data []models.ModelKesimpulanLab, table_id string) templ.Component {
|
||||
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 {
|
||||
@@ -29,115 +30,111 @@ func Table_Kesimpulan(title string, data []models.ModelKesimpulanLab, table_id s
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"card card-custom gutter-b\" style=\"border-radius: 20px;\"><div style=\"padding-top: 12px;\"><h3 class=\"card-label dot-text text-black\">")
|
||||
_, 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(title)
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(id)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\kesimpulan\table.templ`, Line: 12, Col: 62}
|
||||
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("</h3></div><div class=\"card-body\"><div id=\"")
|
||||
_, 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(table_id)
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(modalTitle)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\kesimpulan\table.templ`, Line: 15, Col: 30}
|
||||
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("\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h6>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PRESENTASE"}, []string{"5%", "70%", "25%"}, Row_Kesimpulan(data)).Render(ctx, templ_7745c5c3_Buffer)
|
||||
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></div>")
|
||||
_, 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
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(message)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `models\component\modal\modal_confirmation.templ`, Line: 28, Col: 17}
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func Row_Kesimpulan(data []models.ModelKesimpulanLab) 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)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var4 == nil {
|
||||
templ_7745c5c3_Var4 = templ.NopComponent
|
||||
_, 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
|
||||
}
|
||||
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 i, v := range data {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td>")
|
||||
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(strconv.Itoa(i + 1))
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\kesimpulan\table.templ`, Line: 30, Col: 37}
|
||||
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("</td><td>")
|
||||
_, 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.Test)
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\kesimpulan\table.templ`, Line: 31, Col: 24}
|
||||
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("</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.Total)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\kesimpulan\table.templ`, Line: 32, 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("</td></tr>")
|
||||
_, 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)
|
||||
}
|
||||
85
models/component/modal/modal_templ.go
Normal file
85
models/component/modal/modal_templ.go
Normal 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
|
||||
})
|
||||
}
|
||||
74
models/component/navbar/navbar.templ
Normal file
74
models/component/navbar/navbar.templ
Normal 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>
|
||||
}
|
||||
112
models/component/navbar/navbar_templ.go
Normal file
112
models/component/navbar/navbar_templ.go
Normal 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
|
||||
})
|
||||
}
|
||||
59
models/component/pagination/pagination.templ
Normal file
59
models/component/pagination/pagination.templ
Normal 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);
|
||||
|
||||
}
|
||||
216
models/component/pagination/pagination_templ.go
Normal file
216
models/component/pagination/pagination_templ.go
Normal 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),
|
||||
}
|
||||
}
|
||||
55
models/component/pagination/paginationv1.templ
Normal file
55
models/component/pagination/paginationv1.templ
Normal 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);
|
||||
|
||||
// }
|
||||
154
models/component/pagination/paginationv1_templ.go
Normal file
154
models/component/pagination/paginationv1_templ.go
Normal 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);
|
||||
|
||||
// }
|
||||
52
models/component/pagination/paginationv2.templ
Normal file
52
models/component/pagination/paginationv2.templ
Normal file
@@ -0,0 +1,52 @@
|
||||
package pagination
|
||||
|
||||
import "strconv"
|
||||
import "cpone/component/customtextfield"
|
||||
import "cpone/models"
|
||||
|
||||
templ PaginationV2(length int,
|
||||
currentPage int,
|
||||
link string,
|
||||
paginationID string,
|
||||
hxInclude string,
|
||||
hxTarget string,
|
||||
hxSwap string,
|
||||
hxIndicator string,
|
||||
hxSwapOob string) {
|
||||
// hx-on::before-request={ HideContent(contentID) }
|
||||
// hx-on::after-request="alert('Done making a request!')"
|
||||
<div class="d-flex justify-content-between align-items-center flex-wrap" id={ paginationID } hx-swap-oob={ hxSwapOob }>
|
||||
<div class="d-flex flex-wrap py-2 mr-3">
|
||||
for i:=0; i<length; i++ {
|
||||
if (i+1) == currentPage {
|
||||
<a
|
||||
hx-get={ link + "?" + "page=" + strconv.Itoa(i+1) }
|
||||
class="btn btn-icon btn-sm border-0 btn-light btn-hover-primary active mr-2 my-1"
|
||||
hx-swap={ hxSwap }
|
||||
hx-indicator={ hxIndicator }
|
||||
hx-trigger="click"
|
||||
hx-target={ hxTarget }
|
||||
hx-include={ hxInclude }
|
||||
hx-disabled-elt=".btneditug, .btndeleteug"
|
||||
>{ strconv.Itoa(i+1) }</a>
|
||||
} else {
|
||||
<a
|
||||
hx-get={ link + "?" + "page=" + strconv.Itoa(i+1) }
|
||||
class="btn btn-icon btn-sm border-0 btn-light mr-2 my-1"
|
||||
hx-swap={ hxSwap }
|
||||
hx-indicator={ hxIndicator }
|
||||
hx-trigger="click"
|
||||
hx-target={ hxTarget }
|
||||
hx-include={ hxInclude }
|
||||
hx-disabled-elt=".btneditug, .btndeleteug"
|
||||
>{ strconv.Itoa(i+1) }</a>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{
|
||||
ID: "currpage" + paginationID,
|
||||
Name: "currpage" + paginationID,
|
||||
Type: "hidden",
|
||||
Value: strconv.Itoa(currentPage)})
|
||||
</div>
|
||||
}
|
||||
258
models/component/pagination/paginationv2_templ.go
Normal file
258
models/component/pagination/paginationv2_templ.go
Normal file
@@ -0,0 +1,258 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package pagination
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
import "strconv"
|
||||
import "cpone/component/customtextfield"
|
||||
import "cpone/models"
|
||||
|
||||
func PaginationV2(length int,
|
||||
currentPage int,
|
||||
link string,
|
||||
paginationID string,
|
||||
hxInclude string,
|
||||
hxTarget string,
|
||||
hxSwap string,
|
||||
hxIndicator string,
|
||||
hxSwapOob string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var1 == nil {
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex justify-content-between align-items-center flex-wrap\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(paginationID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `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
|
||||
})
|
||||
}
|
||||
@@ -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>
|
||||
}
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user