Merge branch 'andy/login'

This commit is contained in:
Sas Andy
2024-04-25 17:06:40 +07:00
16 changed files with 5754 additions and 7 deletions

586
assets/andy/coba.html Normal file
View File

@@ -0,0 +1,586 @@
<!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>Corporate portal | Landing Page</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
href="asset-corporate-portal/css/sas.bundle.css"
rel="stylesheet"
type="text/css"
/>
<link rel="shortcut icon" href="assets/media/logos/favicon.ico" />
</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"
>
<!--begin::Main-->
<div class="d-flex flex-column flex-root bg-white">
<!-- begin::Navbar -->
<div
class="d-flex flex-lg-row justify-content-between py-5"
style="height: 119px; align-items: center"
>
<img
src="asset-corporate-portal/media/logo.png"
alt=""
style="height: 39px"
/>
<ul class="nav">
<li class="nav-item dropdown">
<a
class="nav-link dropdown-toggle font-weight-bolder"
data-toggle="dropdown"
role="button"
aria-haspopup="true"
aria-expanded="false"
>
Dashboard
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Action</a>
</div>
</li>
<li class="nav-item">
<a
class="nav-link disabled"
href="#"
tabindex="-1"
aria-disabled="true"
>Disabled</a
>
</li>
</ul>
<img
src="asset-corporate-portal/media/logo.png"
alt=""
style="height: 39px"
/>
</div>
<div class="p-10">
<button type="button" class="btn">btn</button>
<button type="button" class="btn btn-tosca">btn cb</button>
<button type="button" class="btn btn-primary">Primary</button>
<button type="button" class="btn btn-secondary">Secondary</button>
<button type="button" class="btn btn-info">Info</button>
<button type="button" class="btn btn-danger">Danger</button>
<button type="button" class="btn btn-success">Success</button>
<button type="button" class="btn btn-warning">Warning</button>
</div>
<div class="p-10">
<button type="button" class="btn btn-outline-primary">Primary</button>
<button type="button" class="btn btn-outline-secondary">
Secondary
</button>
<button type="button" class="btn btn-outline-success">Success</button>
<button type="button" class="btn btn-outline-danger">Danger</button>
<button type="button" class="btn btn-outline-warning">Warning</button>
<button type="button" class="btn btn-outline-info">Info</button>
<button type="button" class="btn btn-outline-dark">Dark</button>
</div>
<div class="p-10">
<a href="#" class="btn btn-primary active">Active state</a>
<a href="#" class="btn btn-success active">Active state</a>
<a href="#" class="btn btn-danger active">Active state</a>
<a href="#" class="btn btn-warning active">Active state</a>
</div>
<div class="p-10">
<button class="btn btn-primary" disabled>Disabled state</button>
<button class="btn btn-success" disabled>Disabled state</button>
<button class="btn btn-danger" disabled>Disabled state</button>
<button class="btn btn-warning" disabled>Disabled state</button>
</div>
<div class="p-10">
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-success active">
<input type="radio" name="options" id="option1" checked="checked" />
Active
</label>
<label class="btn btn-success">
<input type="radio" name="options" id="option2" /> Radio
</label>
<label class="btn btn-success">
<input type="radio" name="options" id="option3" /> Radio
</label>
</div>
</div>
<div class="p-10">
<a href="#" class="btn btn-success font-weight-bold btn-pill"
>Success</a
>
<a href="#" class="btn btn-primary font-weight-bold btn-pill"
>Primary</a
>
<a href="#" class="btn btn-danger font-weight-bold btn-pill">Danger</a>
<a href="#" class="btn btn-warning font-weight-bold btn-pill"
>Warning</a
>
<a href="#" class="btn btn-dark font-weight-bold btn-pill">Dark</a>
</div>
<div class="p-10">
<a href="#" class="btn btn-success font-weight-bold btn-square"
>Success</a
>
<a href="#" class="btn btn-primary font-weight-bold btn-square"
>Primary</a
>
<a href="#" class="btn btn-danger font-weight-bold btn-square"
>Danger</a
>
<a href="#" class="btn btn-warning font-weight-bold btn-square"
>Warning</a
>
<a href="#" class="btn btn-dark font-weight-bold btn-square">Dark</a>
</div>
<div class="p-10">
<a href="#" class="btn btn-light-success font-weight-bold mr-2"
>Success</a
>
<a href="#" class="btn btn-light-info font-weight-bold mr-2">info</a>
<a href="#" class="btn btn-light-primary font-weight-bold mr-2"
>Primary</a
>
<a href="#" class="btn btn-light-secondary font-weight-bold mr-2"
>secondary</a
>
<a href="#" class="btn btn-light-danger font-weight-bold mr-2"
>Danger</a
>
<a href="#" class="btn btn-light-warning font-weight-bold mr-2"
>Warning</a
>
<a href="#" class="btn btn-light-dark font-weight-bold">Dark</a>
</div>
<div class="p-10">
<a
href="#"
class="btn btn-text-info btn-hover-light-info font-weight-bold mr-2"
>info</a
>
<a
href="#"
class="btn btn-text-secondary btn-hover-light-secondary font-weight-bold mr-2"
>secondary</a
>
<a
href="#"
class="btn btn-text-success btn-hover-light-success font-weight-bold mr-2"
>Success</a
>
<a
href="#"
class="btn btn-text-primary btn-hover-light-primary font-weight-bold mr-2"
>Primary</a
>
<a
href="#"
class="btn btn-text-danger btn-hover-light-danger font-weight-bold mr-2"
>Danger</a
>
<a
href="#"
class="btn btn-text-warning btn-hover-light-warning font-weight-bold mr-2"
>Warning</a
>
<a
href="#"
class="btn btn-text-dark btn-hover-light-dark font-weight-bold mr-2"
>Dark</a
>
</div>
<div class="p-10">
<a
href="#"
class="btn btn-hover-bg-success btn-text-success btn-hover-text-white border-0 font-weight-bold mr-2"
>Success</a
>
<a
href="#"
class="btn btn-hover-bg-info btn-text-info btn-hover-text-white border-0 font-weight-bold mr-2"
>info</a
>
<a
href="#"
class="btn btn-hover-bg-primary btn-text-primary btn-hover-text-white border-0 font-weight-bold mr-2"
>Primary</a
>
<a
href="#"
class="btn btn-hover-bg-danger btn-text-danger btn-hover-text-white border-0 font-weight-bold mr-2"
>Danger</a
>
<a
href="#"
class="btn btn-hover-bg-warning btn-text-warning btn-hover-text-white border-0 font-weight-bold mr-2"
>Warning</a
>
<a
href="#"
class="btn btn-hover-bg-dark btn-text-dark btn-hover-text-white border-0 font-weight-bold mr-2"
>Dark</a
>
</div>
<div class="p-10">
<a
href="#"
class="btn btn-light btn-text-success btn-hover-text-success font-weight-bold"
>Success</a
>
<a
href="#"
class="btn btn-light btn-text-info btn-hover-text-info font-weight-bold"
>info</a
>
<a
href="#"
class="btn btn-light btn-text-primary btn-hover-text-primary font-weight-bold"
>Primary</a
>
<a
href="#"
class="btn btn-light btn-text-danger btn-hover-text-danger font-weight-bold"
>Danger</a
>
<a
href="#"
class="btn btn-light btn-text-warning btn-hover-text-dark-50 font-weight-bold"
>Warning</a
>
<a
href="#"
class="btn btn-light btn-text-dark btn-hover-text-dark font-weight-bold"
>Dark</a
>
</div>
<div class="p-10">
<a
href="#"
class="btn btn-light btn-hover-success font-weight-bold mr-2"
>Success</a
>
<a href="#" class="btn btn-light btn-hover-info font-weight-bold mr-2"
>info</a
>
<a href="#" class="btn btn-light btn-hover-primary font-weight-bold"
>Primary</a
>
<a href="#" class="btn btn-light btn-hover-danger font-weight-bold"
>Danger</a
>
<a href="#" class="btn btn-light btn-hover-warning font-weight-bold"
>Warning</a
>
<a href="#" class="btn btn-light btn-hover-dark font-weight-bold"
>Dark</a
>
</div>
<div class="p-10">
<a href="#" class="btn btn-link-success font-weight-bold">Success</a>
<a href="#" class="btn btn-link-info font-weight-bold">info</a>
<a href="#" class="btn btn-link-primary font-weight-bold">Primary</a>
<a href="#" class="btn btn-link-danger font-weight-bold">Danger</a>
<a href="#" class="btn btn-link-warning font-weight-bold">Warning</a>
<a href="#" class="btn btn-link-dark font-weight-bold">Dark</a>
</div>
<div class="p-10">
<a href="#" class="btn btn-light btn-shadow font-weight-bold mr-2"
>Light</a
>
<a href="#" class="btn btn-info btn-shadow font-weight-bold mr-2"
>info</a
>
<a href="#" class="btn btn-success btn-shadow font-weight-bold mr-2"
>Success</a
>
<a href="#" class="btn btn-primary btn-shadow font-weight-bold mr-2"
>Primary</a
>
<a href="#" class="btn btn-danger btn-shadow font-weight-bold mr-2"
>Danger</a
>
<a href="#" class="btn btn-warning btn-shadow font-weight-bold mr-2"
>Warning</a
>
</div>
<div class="p-10">
<a href="#" class="btn btn-light btn-shadow-hover font-weight-bold mr-2"
>Light</a
>
<a href="#" class="btn btn-info btn-shadow-hover font-weight-bold mr-2"
>info</a
>
<a
href="#"
class="btn btn-success btn-shadow-hover font-weight-bold mr-2"
>Success</a
>
<a
href="#"
class="btn btn-primary btn-shadow-hover font-weight-bold mr-2"
>Primary</a
>
<a
href="#"
class="btn btn-danger btn-shadow-hover font-weight-bold mr-2"
>Danger</a
>
<a
href="#"
class="btn btn-warning btn-shadow-hover font-weight-bold mr-2"
>Warning</a
>
</div>
<div class="p-10">
<ul class="nav">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a
class="nav-link dropdown-toggle"
data-toggle="dropdown"
href="#"
role="button"
aria-haspopup="true"
aria-expanded="false"
>
Dropdown
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Separated link</a>
</div>
</li>
<li class="nav-item">
<a
class="nav-link disabled"
href="#"
tabindex="-1"
aria-disabled="true"
>Disabled</a
>
</li>
</ul>
</div>
<div class="p-10">
<ul class="nav nav-pills" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a
class="nav-link dropdown-toggle"
data-toggle="dropdown"
href="#"
role="button"
aria-haspopup="true"
aria-expanded="false"
>
Dropdown
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Separated link</a>
</div>
</li>
<li class="nav-item">
<a
class="nav-link disabled"
href="#"
tabindex="-1"
aria-disabled="true"
>Disabled</a
>
</li>
</ul>
<div class="tab-content mt-5" id="myTabContent">...</div>
</div>
<div class="p-10">
<p class="text-primary">.text-primary</p>
<p class="text-secondary">.text-secondary</p>
<p class="text-success">.text-success</p>
<p class="text-danger">.text-danger</p>
<p class="text-warning">.text-warning</p>
<p class="text-info">.text-info</p>
<p class="text-light bg-dark">.text-light</p>
<p class="text-dark">.text-dark</p>
<p class="text-body">.text-body</p>
<p class="text-muted">.text-muted</p>
<p class="text-white bg-dark">.text-white</p>
<p class="text-black-50">.text-black-50</p>
<p class="text-white-50 bg-dark">.text-white-50</p>
<p class="h1 text-disabled">text normal</p>
</div>
<!-- end::Navbar -->
</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 Scripts(used by this page)-->
<!-- <script src="asset-corporate-portal/js/login-general.js"></script> -->
<!--end::Page Scripts-->
</body>
<!--end::Body-->
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -38,6 +38,14 @@ func main() {
handlers.SetupRoutes(app, h)
xStore, err := db.NewXsampleStore(dbName)
if err != nil {
app.Logger.Fatalf("failed to create store: %s", err)
}
xs := services.NewServicesXsample(services.Xsample{}, xStore)
xh := handlers.NewXsampleHandler(xs)
handlers.SetupRoutesXsample(app, xh)
app.Logger.Fatal(app.Start(":5000"))
}

26
db/xsample.store.go Normal file
View File

@@ -0,0 +1,26 @@
package db
import (
"database/sql"
_ "github.com/glebarez/go-sqlite"
)
type XsampleStore struct {
Db *sql.DB
}
func NewXsampleStore(dbName string) (XsampleStore, error) {
Db, err := getConnection(dbName)
if err != nil {
return XsampleStore{}, err
}
if err := createMigrations(dbName, Db); err != nil {
return XsampleStore{}, err
}
return XsampleStore{
Db,
}, nil
}

View File

@@ -0,0 +1,21 @@
package handlers
import (
"github.com/a-h/templ"
"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)
}
func ViewLoginCompany(c echo.Context, cmp templ.Component) error {
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
return cmp.Render(c.Request().Context(), c.Response().Writer)
}

View File

@@ -7,6 +7,13 @@ func SetupRoutes(app *echo.Echo, h *UserHandler) {
group.GET("", h.HandlerShowUsers)
group.GET("/details/:id", h.HandlerShowUserById)
}
//PLAYGROUND TESTING
func SetupRoutesXsample(app *echo.Echo, h *XsampleHandler) {
xSample := app.Group("/xsample")
xSample.GET("/xsample01", h.Hello)
}
func SetupRoutesProject(app *echo.Echo) {

View File

@@ -0,0 +1,32 @@
package handlers
import (
"github.com/a-h/templ"
"github.com/emarifer/go-templ-project-structure/views/xsample"
"github.com/labstack/echo/v4"
)
type XsampleService interface {
}
func NewXsampleHandler(us XsampleService) *XsampleHandler {
return &XsampleHandler{
XsampleService: us,
}
}
type XsampleHandler struct {
XsampleService XsampleService
}
func (uh *XsampleHandler) Hello(c echo.Context) error {
helo := xsample.ShowHelo("Hello World", xsample.HelloWorld("Hello World"), xsample.CssHelo(), xsample.JsHelo())
return uh.View(c, helo)
}
func (uh *XsampleHandler) View(c echo.Context, cmp templ.Component) error {
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
return cmp.Render(c.Request().Context(), c.Response().Writer)
}

View File

@@ -0,0 +1,80 @@
package services
import (
"time"
"github.com/emarifer/go-templ-project-structure/db"
)
func NewServicesXsample(u Xsample, uStore db.XsampleStore) *ServicesXsample {
return &ServicesXsample{
Xsample: u,
XsampleStore: uStore,
}
}
type Xsample struct {
ID int `json:"id"`
Xsamplename string `json:"Xsamplename"`
Email string `json:"email"`
CreatedAt time.Time `json:"created_at,omitempty"`
}
type ServicesXsample struct {
Xsample Xsample
XsampleStore db.XsampleStore
}
func (su *ServicesXsample) GetAllXsamples() ([]Xsample, error) {
query := `SELECT id, Xsamplename, email, created_at FROM Xsamples ORDER BY created_at DESC`
rows, err := su.XsampleStore.Db.Query(query)
if err != nil {
return []Xsample{}, err
}
// We close the resource
defer rows.Close()
Xsamples := []Xsample{}
for rows.Next() {
rows.Scan(
&su.Xsample.ID,
&su.Xsample.Xsamplename,
&su.Xsample.Email,
&su.Xsample.CreatedAt,
)
Xsamples = append(Xsamples, su.Xsample)
}
return Xsamples, nil
}
func (su *ServicesXsample) GetXsampleById(id int) (Xsample, error) {
query := `SELECT id, Xsamplename, email, created_at FROM Xsamples
WHERE id = ?`
stmt, err := su.XsampleStore.Db.Prepare(query)
if err != nil {
return Xsample{}, err
}
defer stmt.Close()
su.Xsample.ID = id
err = stmt.QueryRow(
su.Xsample.ID,
).Scan(
&su.Xsample.ID,
&su.Xsample.Xsamplename,
&su.Xsample.Email,
&su.Xsample.CreatedAt,
)
if err != nil {
return Xsample{}, err
}
return su.Xsample, nil
}

View File

@@ -1,7 +1,6 @@
package layout
// loyoit for login/forgot password
templ AuthenticationLayout(title string, css templ.Component, js templ.Component) {
templ CanvasLayout(title string, css templ.Component, js templ.Component) {
<!DOCTYPE html>
<!--
Template Name: Metronic - Bootstrap 4 HTML, React, Angular 9 & VueJS Admin Dashboard Theme
@@ -78,6 +77,12 @@ templ AuthenticationLayout(title string, css templ.Component, js templ.Component
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"
/>
@css
</head>
<!--end::Head-->

View File

@@ -10,8 +10,7 @@ import "context"
import "io"
import "bytes"
// loyoit for login/forgot password
func AuthenticationLayout(title string, css templ.Component, js templ.Component) templ.Component {
func CanvasLayout(title string, 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 {
@@ -24,20 +23,20 @@ func AuthenticationLayout(title string, css templ.Component, js templ.Component)
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><!--\r\nTemplate Name: Metronic - Bootstrap 4 HTML, React, Angular 9 & VueJS Admin Dashboard Theme\r\nAuthor: KeenThemes\r\nWebsite: http://www.keenthemes.com/\r\nContact: support@keenthemes.com\r\nFollow: www.twitter.com/keenthemes\r\nDribbble: www.dribbble.com/keenthemes\r\nLike: www.facebook.com/keenthemes\r\nPurchase: https://1.envato.market/EA4JP\r\nRenew Support: https://1.envato.market/EA4JP\r\nLicense: 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--><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: `views\layout\canvas_layout.templ`, Line: 23, Col: 34}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\layout\canvas_layout.templ`, Line: 22, 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=\"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=\"shortcut icon\" href=\"asset-corporate-portal/media/logo/logo-small.jpg\">")
_, 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=\"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=\"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\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -0,0 +1,174 @@
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>
<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="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="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"
/>
@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"
>
<!--begin::Main-->
{ children... }
<!--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-->
@js
<!--end::Page Scripts-->
</body>
<!--end::Body-->
</html>
}

View File

@@ -0,0 +1,73 @@
// 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"
// LAYOUT PLAYGROUND
func PlaygroundLayout(title string, 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_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><!--\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: `views\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 {
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=\"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=\"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\">")
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\"><!--begin::Main-->")
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("<!--end::Main--><script>\r\n var HOST_URL =\r\n \"https://preview.keenthemes.com/metronic/theme/html/tools/preview\";\r\n </script><!--begin::Global Config(global config for global JS scripts)--><script>\r\n var KTAppSettings = {\r\n breakpoints: {\r\n sm: 576,\r\n md: 768,\r\n lg: 992,\r\n xl: 1200,\r\n xxl: 1400,\r\n },\r\n colors: {\r\n theme: {\r\n base: {\r\n white: \"#ffffff\",\r\n primary: \"#3699FF\",\r\n secondary: \"#E5EAEE\",\r\n success: \"#1BC5BD\",\r\n info: \"#8950FC\",\r\n warning: \"#FFA800\",\r\n danger: \"#F64E60\",\r\n light: \"#E4E6EF\",\r\n dark: \"#181C32\",\r\n },\r\n light: {\r\n white: \"#ffffff\",\r\n primary: \"#E1F0FF\",\r\n secondary: \"#EBEDF3\",\r\n success: \"#C9F7F5\",\r\n info: \"#EEE5FF\",\r\n warning: \"#FFF4DE\",\r\n danger: \"#FFE2E5\",\r\n light: \"#F3F6F9\",\r\n dark: \"#D6D6E0\",\r\n },\r\n inverse: {\r\n white: \"#ffffff\",\r\n primary: \"#ffffff\",\r\n secondary: \"#3F4254\",\r\n success: \"#ffffff\",\r\n info: \"#ffffff\",\r\n warning: \"#ffffff\",\r\n danger: \"#ffffff\",\r\n light: \"#464E5F\",\r\n dark: \"#ffffff\",\r\n },\r\n },\r\n gray: {\r\n \"gray-100\": \"#F3F6F9\",\r\n \"gray-200\": \"#EBEDF3\",\r\n \"gray-300\": \"#E4E6EF\",\r\n \"gray-400\": \"#D1D3E0\",\r\n \"gray-500\": \"#B5B5C3\",\r\n \"gray-600\": \"#7E8299\",\r\n \"gray-700\": \"#5E6278\",\r\n \"gray-800\": \"#3F4254\",\r\n \"gray-900\": \"#181C32\",\r\n },\r\n },\r\n \"font-family\": \"Poppins\",\r\n };\r\n </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-->")
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><!--end::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
})
}

387
views/login/login.templ Normal file
View File

@@ -0,0 +1,387 @@
package login
import (
"github.com/emarifer/go-templ-project-structure/views/layout"
)
templ DivLogin() {
<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>
<!--begin::Aside-->
<!--begin::Content-->
<div
class="login-content flex-row-fluid d-flex flex-column justify-content-center position-relative overflow-hidden p-7 mx-auto"
>
<!--begin::Content body-->
<div class="d-flex flex-column-fluid flex-center">
<!--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>
<!--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>
<!--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>
<!--end::Form-->
</div>
<!--end::Forgot-->
</div>
<!--end::Content body-->
<!--end::Content footer-->
</div>
<!--end::Content-->
</div>
<!--end::Login-->
</div>
}
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;
}
.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>
}
templ ShowLogin(title string, cmp templ.Component, css templ.Component, js templ.Component) {
@layout.CanvasLayout(title, css, js) {
@cmp
}
}

133
views/login/login_templ.go Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,21 @@
package xsample
import (
"github.com/emarifer/go-templ-project-structure/views/layout"
)
templ HelloWorld(title string) {
<div>{ title }</div>
}
templ CssHelo() {
}
templ JsHelo() {
}
templ ShowHelo(title string, cmp templ.Component, css templ.Component, js templ.Component) {
@layout.PlaygroundLayout(title, css, js) {
@cmp
}
}

View File

@@ -0,0 +1,131 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package xsample
//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 (
"github.com/emarifer/go-templ-project-structure/views/layout"
)
func HelloWorld(title 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>")
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: `views\xsample\xsample.templ`, Line: 8, Col: 13}
}
_, 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>")
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 CssHelo() templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
if templ_7745c5c3_Var3 == nil {
templ_7745c5c3_Var3 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func JsHelo() templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func ShowHelo(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_Var5 := templ.GetChildren(ctx)
if templ_7745c5c3_Var5 == nil {
templ_7745c5c3_Var5 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Var6 := 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_Var6), 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
})
}