Compare commits
1 Commits
andy/coba-
...
hanan/logi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3281472f67 |
@@ -38,6 +38,14 @@ func main() {
|
||||
|
||||
handlers.SetupRoutes(app, h)
|
||||
|
||||
LStore, err := db.NewLoginStore(dbName)
|
||||
if err != nil {
|
||||
app.Logger.Fatalf("failed to create store: %s", err)
|
||||
}
|
||||
l := services.NewServicesLogin(services.Login{}, LStore)
|
||||
lh := handlers.NewLoginHandler(l)
|
||||
handlers.SetupRoutesLogin(app, lh)
|
||||
|
||||
xStore, err := db.NewXsampleStore(dbName)
|
||||
if err != nil {
|
||||
app.Logger.Fatalf("failed to create store: %s", err)
|
||||
|
||||
26
db/login.store.go
Normal file
26
db/login.store.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
_ "github.com/glebarez/go-sqlite"
|
||||
)
|
||||
|
||||
type LoginStore struct {
|
||||
Db *sql.DB
|
||||
}
|
||||
|
||||
func NewLoginStore(dbName string) (LoginStore, error) {
|
||||
Db, err := getConnection(dbName)
|
||||
if err != nil {
|
||||
return LoginStore{}, err
|
||||
}
|
||||
|
||||
if err := createMigrations(dbName, Db); err != nil {
|
||||
return LoginStore{}, err
|
||||
}
|
||||
|
||||
return LoginStore{
|
||||
Db,
|
||||
}, nil
|
||||
}
|
||||
@@ -2,19 +2,34 @@ package handlers
|
||||
|
||||
import (
|
||||
"github.com/a-h/templ"
|
||||
"github.com/emarifer/go-templ-project-structure/services"
|
||||
"github.com/emarifer/go-templ-project-structure/views/login"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func HandlerShowLoginCompany(c echo.Context) error {
|
||||
|
||||
// si := user.ShowIndex("| Home", user.Show(udata))
|
||||
si := login.ShowLogin("Login ", login.DivLogin(), login.CssLogin(), login.JsLogin())
|
||||
|
||||
return ViewLoginCompany(c, si)
|
||||
type LoginService interface {
|
||||
GetLogin(Email string, Password string) (services.Login, error)
|
||||
}
|
||||
func ViewLoginCompany(c echo.Context, cmp templ.Component) error {
|
||||
|
||||
func NewLoginHandler(us LoginService) *LoginHandler {
|
||||
return &LoginHandler{
|
||||
LoginService: us,
|
||||
}
|
||||
}
|
||||
|
||||
type LoginHandler struct {
|
||||
LoginService LoginService
|
||||
}
|
||||
|
||||
func (lh *LoginHandler) HandlerShowLogin(c echo.Context) error {
|
||||
|
||||
si := login.ShowLogin("Login ", login.MainLogin(), login.CssLogin(), login.JsLogin())
|
||||
|
||||
return lh.ViewLogin(c, si)
|
||||
}
|
||||
|
||||
func (uh *LoginHandler) ViewLogin(c echo.Context, cmp templ.Component) error {
|
||||
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
|
||||
|
||||
return cmp.Render(c.Request().Context(), c.Response().Writer)
|
||||
|
||||
@@ -11,6 +11,10 @@ func SetupRoutes(app *echo.Echo, h *UserHandler) {
|
||||
}
|
||||
|
||||
//PLAYGROUND TESTING
|
||||
func SetupRoutesLogin(app *echo.Echo, h *LoginHandler) {
|
||||
l := app.Group("/login")
|
||||
l.GET("/", h.HandlerShowLogin)
|
||||
}
|
||||
func SetupRoutesXsample(app *echo.Echo, h *XsampleHandler) {
|
||||
xSample := app.Group("/xsample")
|
||||
xSample.GET("/xsample01", h.Hello)
|
||||
|
||||
59
services/login.services.go
Normal file
59
services/login.services.go
Normal file
@@ -0,0 +1,59 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/emarifer/go-templ-project-structure/db"
|
||||
)
|
||||
|
||||
func NewServicesLogin(u Login, uStore db.LoginStore) *ServicesLogin {
|
||||
|
||||
return &ServicesLogin{
|
||||
Login: u,
|
||||
LoginStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
type Login struct {
|
||||
ID int `json:"id"`
|
||||
Loginname string `json:"Loginname"`
|
||||
Email string `json:"Email"`
|
||||
Password string `json:"Password"`
|
||||
CreatedAt time.Time `json:"created_at,omitempty"`
|
||||
}
|
||||
|
||||
type ServicesLogin struct {
|
||||
Login Login
|
||||
LoginStore db.LoginStore
|
||||
}
|
||||
|
||||
func (su *ServicesLogin) GetLogin(Email string, Password string) (Login, error) {
|
||||
|
||||
query := `SELECT id, Loginname, Email, Password, created_at FROM Login
|
||||
WHERE Email = ? AND Password = ?`
|
||||
|
||||
stmt, err := su.LoginStore.Db.Prepare(query)
|
||||
if err != nil {
|
||||
return Login{}, err
|
||||
}
|
||||
|
||||
defer stmt.Close()
|
||||
|
||||
su.Login.Email = Email
|
||||
su.Login.Password = Password
|
||||
err = stmt.QueryRow(
|
||||
su.Login.Email,
|
||||
su.Login.Password,
|
||||
).Scan(
|
||||
&su.Login.ID,
|
||||
&su.Login.Loginname,
|
||||
&su.Login.Email,
|
||||
&su.Login.Password,
|
||||
&su.Login.CreatedAt,
|
||||
)
|
||||
if err != nil {
|
||||
return Login{}, err
|
||||
}
|
||||
|
||||
return su.Login, nil
|
||||
}
|
||||
@@ -4,44 +4,14 @@ import (
|
||||
"github.com/emarifer/go-templ-project-structure/views/layout"
|
||||
)
|
||||
|
||||
templ DivLogin() {
|
||||
templ MainLogin() {
|
||||
<div class="d-flex flex-column flex-root">
|
||||
<div
|
||||
class="login login-1 login-signin-on d-flex flex-column flex-lg-row flex-column-fluid bg-white"
|
||||
id="kt_login"
|
||||
>
|
||||
<!--begin::Aside-->
|
||||
<div
|
||||
class="login-aside d-flex flex-column flex-row-auto"
|
||||
style="background-color: #3b4f9f"
|
||||
>
|
||||
<!--begin::Aside Top-->
|
||||
<div class="d-flex flex-column-auto flex-column pt-lg-40 pt-15 px-10">
|
||||
<!--begin::Aside header-->
|
||||
<div class="aside-title mb-5">
|
||||
Empowering Your Workforce's Health
|
||||
</div>
|
||||
<!--end::Aside header-->
|
||||
<!--begin::Aside title-->
|
||||
<div class="aside-subtitle">
|
||||
Discover peace of mind and prioritize your health with our
|
||||
comprehensive medical check-up packages
|
||||
</div>
|
||||
<!--end::Aside title-->
|
||||
</div>
|
||||
<!--end::Aside Top-->
|
||||
<!--begin::Aside Bottom-->
|
||||
<div
|
||||
class="d-flex bgi-no-repeat flex-row-fluid justify-content-center align-items-end"
|
||||
>
|
||||
<img
|
||||
src="asset-corporate-portal/media/login-company-vector.png"
|
||||
class="img-fluid"
|
||||
style="height: 55vh; width: 55vh"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Aside Bottom-->
|
||||
</div>
|
||||
@AsideLeft()
|
||||
<!--begin::Aside-->
|
||||
<!--begin::Content-->
|
||||
<div
|
||||
@@ -52,254 +22,21 @@ templ DivLogin() {
|
||||
<!--begin::Signin-->
|
||||
<div class="login-form login-signin">
|
||||
<!--begin::Form-->
|
||||
<form
|
||||
class="form"
|
||||
novalidate="novalidate"
|
||||
id="kt_login_signin_form"
|
||||
>
|
||||
<!--begin::Title-->
|
||||
<div class="d-flex justify-content-center mb-5">
|
||||
<img
|
||||
src="asset-corporate-portal/media/logo.png"
|
||||
alt=""
|
||||
style="height: 103px"
|
||||
/>
|
||||
</div>
|
||||
<div class="pt-2">
|
||||
<h3
|
||||
class="d-flex justify-content-center title-company"
|
||||
style="color: black"
|
||||
>
|
||||
Welcome to Corporate Portal
|
||||
</h3>
|
||||
</div>
|
||||
<div class="pb-10 pt-0">
|
||||
<h3 class="subtitle-company" style="color: #a7a8bb">
|
||||
Sign in to access your account
|
||||
</h3>
|
||||
</div>
|
||||
<!--begin::Title-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<label class="font-size-h6 font-weight-bolder text-dark">Email</label>
|
||||
<input
|
||||
class="form-control form-control-solid h-auto py-7 px-6 rounded-lg"
|
||||
type="text"
|
||||
name="username"
|
||||
autocomplete="off"
|
||||
placeholder="Enter your email"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<div class="d-flex justify-content-between mt-n5">
|
||||
<label
|
||||
class="font-size-h6 font-weight-bolder text-dark pt-5"
|
||||
>Password</label>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<!-- form-control form-control-solid -->
|
||||
<input
|
||||
class="h-auto form-control form-control-solid py-7 px-6 rounded-lg rounded-right-0"
|
||||
type="password"
|
||||
name="password"
|
||||
id="user-password"
|
||||
autocomplete="off"
|
||||
placeholder="Enter your password"
|
||||
/>
|
||||
<div class="input-group-append">
|
||||
<span
|
||||
class="input-group-text rounded-lg rounded-left-0"
|
||||
style="border: 0"
|
||||
>
|
||||
<!-- far fa-eye-slash -->
|
||||
<a class="btn" role="button" id="btn-show">
|
||||
<i class="far fa-eye-slash" id="password-icon"></i>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end">
|
||||
<a
|
||||
href="javascript:;"
|
||||
class="font-size-h6 font-weight-bolder text-hover-primary mb-5"
|
||||
id="kt_login_forgot"
|
||||
style="color: #0c518c"
|
||||
>
|
||||
Forgot Password ?
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Action-->
|
||||
<div class="pb-lg-0 pb-5 pt-5">
|
||||
<button
|
||||
type="button"
|
||||
id="kt_login_signin_submit"
|
||||
style="background-color: #0c518c"
|
||||
class="btn btn-block font-weight-bolder text-white font-size-h6 px-8 py-4 my-3 mr-3 mt-5"
|
||||
>
|
||||
Sign In
|
||||
</button>
|
||||
</div>
|
||||
<!--end::Action-->
|
||||
</form>
|
||||
@FormSignin()
|
||||
<!--end::Form-->
|
||||
</div>
|
||||
<!--end::Signin-->
|
||||
<!--begin::Signup -->
|
||||
<div class="login-form login-signup">
|
||||
<!--begin::Form -->
|
||||
<form
|
||||
class="form"
|
||||
novalidate="novalidate"
|
||||
id="kt_login_signup_form"
|
||||
>
|
||||
<!--begin::Title -->
|
||||
<div class="pb-13 pt-lg-0 pt-5">
|
||||
<h3
|
||||
class="font-weight-bolder text-dark font-size-h4 font-size-h1-lg"
|
||||
>
|
||||
Sign Up
|
||||
</h3>
|
||||
<p class="text-muted font-weight-bold font-size-h4">
|
||||
Enter your details to create your account
|
||||
</p>
|
||||
</div>
|
||||
<!--end::Title -->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<input
|
||||
class="form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6"
|
||||
type="text"
|
||||
placeholder="Fullname"
|
||||
name="fullname"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<input
|
||||
class="form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6"
|
||||
type="email"
|
||||
placeholder="Email"
|
||||
name="email"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<input
|
||||
class="form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6"
|
||||
type="password"
|
||||
placeholder="Password"
|
||||
name="password"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<input
|
||||
class="form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6"
|
||||
type="password"
|
||||
placeholder="Confirm password"
|
||||
name="cpassword"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<label class="checkbox mb-0">
|
||||
<input type="checkbox" name="agree"/>I Agree the
|
||||
<a href="#">terms and conditions</a>.
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group d-flex flex-wrap pb-lg-0 pb-3">
|
||||
<button
|
||||
type="button"
|
||||
id="kt_login_signup_submit"
|
||||
class="btn btn-primary font-weight-bolder font-size-h6 px-8 py-4 my-3 mr-4"
|
||||
>
|
||||
Submit
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
id="kt_login_signup_cancel"
|
||||
class="btn btn-light-primary font-weight-bolder font-size-h6 px-8 py-4 my-3"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
</form>
|
||||
@FormSignup()
|
||||
<!--end::Form -->
|
||||
</div>
|
||||
<!--end::Signup -->
|
||||
<!--begin::Forgot-->
|
||||
<div class="login-form login-forgot">
|
||||
<!--begin::Form-->
|
||||
<form
|
||||
class="form"
|
||||
novalidate="novalidate"
|
||||
id="kt_login_forgot_form"
|
||||
>
|
||||
<!--begin::Title-->
|
||||
<div class="d-flex justify-content-center mb-5">
|
||||
<img
|
||||
src="asset-corporate-portal/media/logo.png"
|
||||
alt=""
|
||||
style="height: 103px"
|
||||
/>
|
||||
</div>
|
||||
<div class="pb-13 pt-lg-0 pt-5">
|
||||
<h3
|
||||
class="font-weight-bolder text-dark font-size-h4 font-size-h1-lg"
|
||||
>
|
||||
Forgotten Password ?
|
||||
</h3>
|
||||
<p class="text-muted font-weight-bold font-size-h4">
|
||||
Enter your email to reset your password
|
||||
</p>
|
||||
</div>
|
||||
<!--end::Title-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<input
|
||||
class="form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6"
|
||||
type="email"
|
||||
placeholder="Email"
|
||||
name="email"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group d-flex flex-wrap pb-lg-0">
|
||||
<button
|
||||
type="button"
|
||||
id="kt_login_forgot_submit"
|
||||
class="btn btn-primary font-weight-bolder font-size-h6 px-8 py-4 my-3 btn-block btn-submit"
|
||||
>
|
||||
Submit
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
id="kt_login_forgot_cancel"
|
||||
class="btn btn-light-primary font-weight-bolder font-size-h6 px-8 py-4 my-3 btn-block btn-cancel"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
</form>
|
||||
@ForgotPassword()
|
||||
<!--end::Form-->
|
||||
</div>
|
||||
<!--end::Forgot-->
|
||||
@@ -315,73 +52,52 @@ templ DivLogin() {
|
||||
|
||||
templ CssLogin() {
|
||||
<style>
|
||||
|
||||
.title-company {
|
||||
color: #181c32;
|
||||
font-family: Poppins;
|
||||
font-size: 31px;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
line-height: normal;
|
||||
letter-spacing: -0.3px;
|
||||
}
|
||||
.subtitle-company {
|
||||
color: #a7a8bb;
|
||||
font-family: Poppins;
|
||||
font-size: 18px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: normal;
|
||||
.title-company {
|
||||
color: #181c32;
|
||||
font-family: Poppins;
|
||||
font-size: 31px;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
line-height: normal;
|
||||
letter-spacing: -0.3px;
|
||||
}
|
||||
.subtitle-company {
|
||||
color: #a7a8bb;
|
||||
font-family: Poppins;
|
||||
font-size: 18px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: normal;
|
||||
}
|
||||
.aside-title {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-family: Poppins;
|
||||
font-size: 28px;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
line-height: normal;
|
||||
letter-spacing: -0.84px;
|
||||
}
|
||||
.aside-subtitle {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-family: Poppins;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: 30px; /* 187.5% */
|
||||
letter-spacing: -0.48px;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
.aside-title {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-family: Poppins;
|
||||
font-size: 28px;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
line-height: normal;
|
||||
letter-spacing: -0.84px;
|
||||
}
|
||||
|
||||
.aside-subtitle {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-family: Poppins;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: 30px;
|
||||
/* 187.5% */
|
||||
letter-spacing: -0.48px;
|
||||
}
|
||||
|
||||
.btn-submit {
|
||||
background-color: #3b4f9f !important
|
||||
}
|
||||
|
||||
.btn-cancel {
|
||||
color: #3b4f9f !important;
|
||||
background-color: #e1f0ff !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
}
|
||||
|
||||
// templ CssLoginCompany() {
|
||||
// <link
|
||||
// rel="stylesheet"
|
||||
// type="text/css"
|
||||
// href="asset-corporate-portal/css/login.css"
|
||||
// />
|
||||
// }
|
||||
templ JsLogin() {
|
||||
<script src="asset-corporate-portal/js/login-general.js"></script>
|
||||
<script src="../../asset-corporate-portal/js/login-general.js"></script>
|
||||
}
|
||||
|
||||
templ ShowLogin(title string, cmp templ.Component, css templ.Component, js templ.Component) {
|
||||
@layout.CanvasLayout(title, css, js) {
|
||||
@layout.PlaygroundLayout(title, css, js) {
|
||||
@cmp
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
274
views/login/logincomponent.templ
Normal file
274
views/login/logincomponent.templ
Normal file
@@ -0,0 +1,274 @@
|
||||
package login
|
||||
|
||||
templ AsideLeft() {
|
||||
<div class="login-aside d-flex flex-column flex-row-auto bg-primary">
|
||||
<!--begin::Aside Top-->
|
||||
<div class="d-flex flex-column-auto flex-column pt-lg-40 pt-15 px-10">
|
||||
<!--begin::Aside header-->
|
||||
<div class="aside-title mb-5">
|
||||
Empowering Your Workforce's Health
|
||||
</div>
|
||||
<!--end::Aside header-->
|
||||
<!--begin::Aside title-->
|
||||
<div class="aside-subtitle">
|
||||
Discover peace of mind and prioritize your health with our
|
||||
comprehensive medical check-up packages
|
||||
</div>
|
||||
<!--end::Aside title-->
|
||||
</div>
|
||||
<!--end::Aside Top-->
|
||||
<!--begin::Aside Bottom-->
|
||||
<div
|
||||
class="d-flex bgi-no-repeat flex-row-fluid justify-content-center align-items-end"
|
||||
>
|
||||
<img
|
||||
src="../../asset-corporate-portal/media/login/login-company-vector.png"
|
||||
class="img-fluid"
|
||||
style="height: 55vh; width: 55vh"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Aside Bottom-->
|
||||
</div>
|
||||
}
|
||||
|
||||
templ FormSignin() {
|
||||
<form
|
||||
class="form"
|
||||
novalidate="novalidate"
|
||||
id="kt_login_signin_form"
|
||||
>
|
||||
<!--begin::Title-->
|
||||
<div class="d-flex justify-content-center mb-5">
|
||||
<img
|
||||
src="../../asset-corporate-portal/media/logo/logo.png"
|
||||
alt=""
|
||||
style="height: 103px"
|
||||
/>
|
||||
</div>
|
||||
<div class="pt-2">
|
||||
<h3
|
||||
class="d-flex justify-content-center title-company text-dark"
|
||||
>
|
||||
Welcome to Corporate Portal
|
||||
</h3>
|
||||
</div>
|
||||
<div class="pb-10 pt-0">
|
||||
<h3 class="subtitle-company" style="color: #a7a8bb">
|
||||
Sign in to access your account
|
||||
</h3>
|
||||
</div>
|
||||
<!--begin::Title-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<label class="font-size-h6 font-weight-bolder text-dark">Email</label>
|
||||
<input
|
||||
class="form-control form-control-solid h-auto py-7 px-6 rounded-lg"
|
||||
type="text"
|
||||
name="username"
|
||||
autocomplete="off"
|
||||
placeholder="Enter your email"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<div class="d-flex justify-content-between mt-n5">
|
||||
<label
|
||||
class="font-size-h6 font-weight-bolder text-dark pt-5"
|
||||
>Password</label>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<!-- form-control form-control-solid -->
|
||||
<input
|
||||
class="h-auto form-control form-control-solid py-7 px-6 rounded-lg rounded-right-0"
|
||||
type="password"
|
||||
name="password"
|
||||
id="user-password"
|
||||
autocomplete="off"
|
||||
placeholder="Enter your password"
|
||||
/>
|
||||
<div class="input-group-append">
|
||||
<span
|
||||
class="input-group-text rounded-lg rounded-left-0"
|
||||
style="border: 0"
|
||||
>
|
||||
<!-- far fa-eye-slash -->
|
||||
<a class="btn" role="button" id="btn-show">
|
||||
<i class="far fa-eye-slash" id="password-icon"></i>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end">
|
||||
<a
|
||||
href="javascript:;"
|
||||
class="font-size-h6 font-weight-bolder text-hover-primary mb-5 text-primary"
|
||||
id="kt_login_forgot"
|
||||
>
|
||||
Forgot Password ?
|
||||
</a>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Action-->
|
||||
<div class="pb-lg-0 pb-5 pt-5">
|
||||
<button
|
||||
type="button"
|
||||
id="kt_login_signin_submit"
|
||||
class="btn btn-block font-weight-bolder text-white font-size-h6 px-8 py-4 my-3 mr-3 mt-5 btn-primary"
|
||||
>
|
||||
Sign In
|
||||
</button>
|
||||
</div>
|
||||
<!--end::Action-->
|
||||
</form>
|
||||
}
|
||||
|
||||
templ FormSignup() {
|
||||
<form
|
||||
class="form"
|
||||
novalidate="novalidate"
|
||||
id="kt_login_signup_form"
|
||||
>
|
||||
<!--begin::Title -->
|
||||
<div class="pb-13 pt-lg-0 pt-5">
|
||||
<h3
|
||||
class="font-weight-bolder text-dark font-size-h4 font-size-h1-lg"
|
||||
>
|
||||
Sign Up
|
||||
</h3>
|
||||
<p class="text-muted font-weight-bold font-size-h4">
|
||||
Enter your details to create your account
|
||||
</p>
|
||||
</div>
|
||||
<!--end::Title -->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<input
|
||||
class="form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6"
|
||||
type="text"
|
||||
placeholder="Fullname"
|
||||
name="fullname"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<input
|
||||
class="form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6"
|
||||
type="email"
|
||||
placeholder="Email"
|
||||
name="email"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<input
|
||||
class="form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6"
|
||||
type="password"
|
||||
placeholder="Password"
|
||||
name="password"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<input
|
||||
class="form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6"
|
||||
type="password"
|
||||
placeholder="Confirm password"
|
||||
name="cpassword"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<label class="checkbox mb-0">
|
||||
<input type="checkbox" name="agree"/>I Agree the
|
||||
<a href="#">terms and conditions</a>.
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group d-flex flex-wrap pb-lg-0 pb-3">
|
||||
<button
|
||||
type="button"
|
||||
id="kt_login_signup_submit"
|
||||
class="btn btn-primary font-weight-bolder font-size-h6 px-8 py-4 my-3 mr-4"
|
||||
>
|
||||
Submit
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
id="kt_login_signup_cancel"
|
||||
class="btn btn-light-primary font-weight-bolder font-size-h6 px-8 py-4 my-3"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
</form>
|
||||
}
|
||||
|
||||
templ ForgotPassword() {
|
||||
<form
|
||||
class="form"
|
||||
novalidate="novalidate"
|
||||
id="kt_login_forgot_form"
|
||||
>
|
||||
<!--begin::Title-->
|
||||
<div class="d-flex justify-content-center mb-5">
|
||||
<img
|
||||
src="../../asset-corporate-portal/media/logo/logo.png"
|
||||
alt=""
|
||||
style="height: 103px"
|
||||
/>
|
||||
</div>
|
||||
<div class="pb-13 pt-lg-0 pt-5">
|
||||
<h3
|
||||
class="font-weight-bolder text-dark font-size-h4 font-size-h1-lg"
|
||||
>
|
||||
Forgotten Password ?
|
||||
</h3>
|
||||
<p class="text-muted font-weight-bold font-size-h4">
|
||||
Enter your email to reset your password
|
||||
</p>
|
||||
</div>
|
||||
<!--end::Title-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group">
|
||||
<input
|
||||
class="form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6"
|
||||
type="email"
|
||||
placeholder="Email"
|
||||
name="email"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
<!--begin::Form group-->
|
||||
<div class="form-group d-flex flex-wrap pb-lg-0">
|
||||
<button
|
||||
type="button"
|
||||
id="kt_login_forgot_submit"
|
||||
class="btn btn-primary font-weight-bolder font-size-h6 px-8 py-4 my-3 btn-block btn-submit"
|
||||
>
|
||||
Submit
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
id="kt_login_forgot_cancel"
|
||||
class="btn btn-light-primary font-weight-bolder font-size-h6 px-8 py-4 my-3 btn-block btn-cancel"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
<!--end::Form group-->
|
||||
</form>
|
||||
}
|
||||
107
views/login/logincomponent_templ.go
Normal file
107
views/login/logincomponent_templ.go
Normal file
@@ -0,0 +1,107 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package login
|
||||
|
||||
//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 AsideLeft() templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, 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=\"login-aside d-flex flex-column flex-row-auto bg-primary\"><!--begin::Aside Top--><div class=\"d-flex flex-column-auto flex-column pt-lg-40 pt-15 px-10\"><!--begin::Aside header--><div class=\"aside-title mb-5\">Empowering Your Workforce's Health\r</div><!--end::Aside header--><!--begin::Aside title--><div class=\"aside-subtitle\">Discover peace of mind and prioritize your health with our\r comprehensive medical check-up packages\r</div><!--end::Aside title--></div><!--end::Aside Top--><!--begin::Aside Bottom--><div class=\"d-flex bgi-no-repeat flex-row-fluid justify-content-center align-items-end\"><img src=\"../../asset-corporate-portal/media/login/login-company-vector.png\" class=\"img-fluid\" style=\"height: 55vh; width: 55vh\"></div><!--end::Aside Bottom--></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 FormSignin() templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, 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("<form class=\"form\" novalidate=\"novalidate\" id=\"kt_login_signin_form\"><!--begin::Title--><div class=\"d-flex justify-content-center mb-5\"><img src=\"../../asset-corporate-portal/media/logo/logo.png\" alt=\"\" style=\"height: 103px\"></div><div class=\"pt-2\"><h3 class=\"d-flex justify-content-center title-company text-dark\">Welcome to Corporate Portal\r</h3></div><div class=\"pb-10 pt-0\"><h3 class=\"subtitle-company\" style=\"color: #a7a8bb\">Sign in to access your account\r</h3></div><!--begin::Title--><!--begin::Form group--><div class=\"form-group\"><label class=\"font-size-h6 font-weight-bolder text-dark\">Email</label> <input class=\"form-control form-control-solid h-auto py-7 px-6 rounded-lg\" type=\"text\" name=\"username\" autocomplete=\"off\" placeholder=\"Enter your email\"></div><!--end::Form group--><!--begin::Form group--><div class=\"form-group\"><div class=\"d-flex justify-content-between mt-n5\"><label class=\"font-size-h6 font-weight-bolder text-dark pt-5\">Password</label></div><div class=\"input-group\"><!-- form-control form-control-solid --><input class=\"h-auto form-control form-control-solid py-7 px-6 rounded-lg rounded-right-0\" type=\"password\" name=\"password\" id=\"user-password\" autocomplete=\"off\" placeholder=\"Enter your password\"><div class=\"input-group-append\"><span class=\"input-group-text rounded-lg rounded-left-0\" style=\"border: 0\"><!-- far fa-eye-slash --><a class=\"btn\" role=\"button\" id=\"btn-show\"><i class=\"far fa-eye-slash\" id=\"password-icon\"></i></a></span></div></div></div><div class=\"d-flex justify-content-end\"><a href=\"javascript:;\" class=\"font-size-h6 font-weight-bolder text-hover-primary mb-5 text-primary\" id=\"kt_login_forgot\">Forgot Password ?\r</a></div><!--end::Form group--><!--begin::Action--><div class=\"pb-lg-0 pb-5 pt-5\"><button type=\"button\" id=\"kt_login_signin_submit\" class=\"btn btn-block font-weight-bolder text-white font-size-h6 px-8 py-4 my-3 mr-3 mt-5 btn-primary\">Sign In\r</button></div><!--end::Action--></form>")
|
||||
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 FormSignup() templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, 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("<form class=\"form\" novalidate=\"novalidate\" id=\"kt_login_signup_form\"><!--begin::Title --><div class=\"pb-13 pt-lg-0 pt-5\"><h3 class=\"font-weight-bolder text-dark font-size-h4 font-size-h1-lg\">Sign Up\r</h3><p class=\"text-muted font-weight-bold font-size-h4\">Enter your details to create your account\r</p></div><!--end::Title --><!--begin::Form group--><div class=\"form-group\"><input class=\"form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6\" type=\"text\" placeholder=\"Fullname\" name=\"fullname\" autocomplete=\"off\"></div><!--end::Form group--><!--begin::Form group--><div class=\"form-group\"><input class=\"form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6\" type=\"email\" placeholder=\"Email\" name=\"email\" autocomplete=\"off\"></div><!--end::Form group--><!--begin::Form group--><div class=\"form-group\"><input class=\"form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6\" type=\"password\" placeholder=\"Password\" name=\"password\" autocomplete=\"off\"></div><!--end::Form group--><!--begin::Form group--><div class=\"form-group\"><input class=\"form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6\" type=\"password\" placeholder=\"Confirm password\" name=\"cpassword\" autocomplete=\"off\"></div><!--end::Form group--><!--begin::Form group--><div class=\"form-group\"><label class=\"checkbox mb-0\"><input type=\"checkbox\" name=\"agree\">I Agree the\r <a href=\"#\">terms and conditions</a>.\r <span></span></label></div><!--end::Form group--><!--begin::Form group--><div class=\"form-group d-flex flex-wrap pb-lg-0 pb-3\"><button type=\"button\" id=\"kt_login_signup_submit\" class=\"btn btn-primary font-weight-bolder font-size-h6 px-8 py-4 my-3 mr-4\">Submit\r</button> <button type=\"button\" id=\"kt_login_signup_cancel\" class=\"btn btn-light-primary font-weight-bolder font-size-h6 px-8 py-4 my-3\">Cancel\r</button></div><!--end::Form group--></form>")
|
||||
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 ForgotPassword() templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, 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("<form class=\"form\" novalidate=\"novalidate\" id=\"kt_login_forgot_form\"><!--begin::Title--><div class=\"d-flex justify-content-center mb-5\"><img src=\"../../asset-corporate-portal/media/logo/logo.png\" alt=\"\" style=\"height: 103px\"></div><div class=\"pb-13 pt-lg-0 pt-5\"><h3 class=\"font-weight-bolder text-dark font-size-h4 font-size-h1-lg\">Forgotten Password ?\r</h3><p class=\"text-muted font-weight-bold font-size-h4\">Enter your email to reset your password\r</p></div><!--end::Title--><!--begin::Form group--><div class=\"form-group\"><input class=\"form-control form-control-solid h-auto py-7 px-6 rounded-lg font-size-h6\" type=\"email\" placeholder=\"Email\" name=\"email\" autocomplete=\"off\"></div><!--end::Form group--><!--begin::Form group--><div class=\"form-group d-flex flex-wrap pb-lg-0\"><button type=\"button\" id=\"kt_login_forgot_submit\" class=\"btn btn-primary font-weight-bolder font-size-h6 px-8 py-4 my-3 btn-block btn-submit\">Submit\r</button> <button type=\"button\" id=\"kt_login_forgot_cancel\" class=\"btn btn-light-primary font-weight-bolder font-size-h6 px-8 py-4 my-3 btn-block btn-cancel\">Cancel\r</button></div><!--end::Form group--></form>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user