diff --git a/controllers/tablerbase.go b/controllers/tablerbase.go index 2197445..792713c 100644 --- a/controllers/tablerbase.go +++ b/controllers/tablerbase.go @@ -171,6 +171,60 @@ func TablerTables(c *core.Context) *core.Response { return c.Response.Template("tabler_tables.html", data) } +// UserSignIn renders the sign-in page. +func UserSignIn(c *core.Context) *core.Response { + type authPageData struct { + TablerPageData + } + data := authPageData{ + TablerPageData: TablerPageData{ + PageTitle: "Sign In", + }, + } + return c.Response.Template("apptabler_sign-in.html", data) +} + +// UserSignUp renders the sign-up page. +func UserSignUp(c *core.Context) *core.Response { + type authPageData struct { + TablerPageData + } + data := authPageData{ + TablerPageData: TablerPageData{ + PageTitle: "Sign Up", + }, + } + return c.Response.Template("apptabler_sign-up.html", data) +} + +// UserForgot renders the forgot password page. +func UserForgot(c *core.Context) *core.Response { + type authPageData struct { + TablerPageData + } + data := authPageData{ + TablerPageData: TablerPageData{ + PageTitle: "Forgot Password", + }, + } + return c.Response.Template("apptabler_forgot.html", data) +} + +// UserLock renders the account lock page. +func UserLock(c *core.Context) *core.Response { + type authLockPageData struct { + TablerPageData + PersonName string + } + data := authLockPageData{ + TablerPageData: TablerPageData{ + PageTitle: "Account Locked", + }, + PersonName: "Paweł Kuna", + } + return c.Response.Template("apptabler_auth-lock.html", data) +} + // TablerHome renders the homepage/dashboard layout func TablerHome(c *core.Context) *core.Response { data := TablerPageData{ diff --git a/controllers/tablertypes.go b/controllers/tablertypes.go index f076f7b..0303c40 100644 --- a/controllers/tablertypes.go +++ b/controllers/tablertypes.go @@ -476,11 +476,16 @@ type FormtablerFormElementsPage struct { // FormtablerComponentsPage is the page-specific struct for the combined demo // showing alerts, toasts, and breadcrumbs. type FormtablerComponentsPage struct { - Alerts []FormtablerAlert + Alerts []FormtablerAlert Breadcrumbs []FormtablerBreadcrumb Toasts []FormtablerToast } +// AuthLockPageData holds the data for the account lock page. +type AuthLockPageData struct { + PersonName string +} + // TablerPageData holds the common data for all tabler pages. // It should NOT contain component-specific fields like tables or forms. // Add those by creating a page-specific struct that embeds TablerPageData diff --git a/routes.go b/routes.go index eb2190d..f2f4a09 100644 --- a/routes.go +++ b/routes.go @@ -69,7 +69,16 @@ func registerRoutes() { controller.Get("/tablerdefault", controllers.TablerDefault) controller.Get("/tablerhome", controllers.TablerHome) controller.Get("/tablernavmenu", controllers.TablerNavbar) - controller.Get("/tablertable", controllers.TablerTables) + controller.Get("/user/login", controllers.UserSignIn) + controller.Post("/user/login", controllers.UserSignIn) + controller.Get("/user/signup", controllers.UserSignUp) + controller.Post("/user/signup", controllers.UserSignUp) + controller.Get("/user/forgot", controllers.UserForgot) + controller.Post("/user/forgot", controllers.UserForgot) + controller.Get("/user/lock", controllers.UserLock) + controller.Post("/user/lock", controllers.UserLock) + + controller.Get("/tablertable", controllers.TablerTables) controller.Get("/tablerformelements", controllers.TablerFormElements) controller.Get("/tablercards", controllers.TablerCards) controller.Get("/tablercomponents", controllers.TablerComponents) diff --git a/storage/templates/tabler/app/auth/apptabler_auth-lock.html b/storage/templates/tabler/app/auth/apptabler_auth-lock.html new file mode 100644 index 0000000..005068f --- /dev/null +++ b/storage/templates/tabler/app/auth/apptabler_auth-lock.html @@ -0,0 +1,34 @@ +{{template "base_header" .}} +
+
+
+ {{template "tabler_navbar_logo" .}} +
+ +
+
+
+

Account Locked

+

Please enter your password to unlock your account

+
+ +
+ +

{{defaultVal "Paweł Kuna" .PersonName}}

+
+ +
+ +
+ +
+ +
+
+
+
+
+{{template "base_footer" .}} diff --git a/storage/templates/tabler/app/auth/apptabler_forgot.html b/storage/templates/tabler/app/auth/apptabler_forgot.html new file mode 100644 index 0000000..49be6da --- /dev/null +++ b/storage/templates/tabler/app/auth/apptabler_forgot.html @@ -0,0 +1,33 @@ +{{template "base_header" .}} +
+
+
+ {{template "tabler_navbar_logo" .}} +
+ +
+
+

Forgot password

+ +

Enter your email address and your password will be reset and emailed to you.

+ +
+ + +
+ + +
+
+ +
+ Forget it, send me back to the sign in screen. +
+
+
+{{template "base_footer" .}} diff --git a/storage/templates/tabler/app/auth/apptabler_sign-in.html b/storage/templates/tabler/app/auth/apptabler_sign-in.html new file mode 100644 index 0000000..5c54f11 --- /dev/null +++ b/storage/templates/tabler/app/auth/apptabler_sign-in.html @@ -0,0 +1,66 @@ +{{template "base_header" .}} +
+
+
+ {{template "tabler_navbar_logo" .}} +
+ +
+
+

Login to your account

+ +
+
+ + +
+
+ +
+ + + + + + +
+
+
+ +
+ + +
+
+ +
+ +
+ +
+ Don't have account yet? Sign up +
+
+
+{{template "base_footer" .}} diff --git a/storage/templates/tabler/app/auth/apptabler_sign-up.html b/storage/templates/tabler/app/auth/apptabler_sign-up.html new file mode 100644 index 0000000..648e8c1 --- /dev/null +++ b/storage/templates/tabler/app/auth/apptabler_sign-up.html @@ -0,0 +1,49 @@ +{{template "base_header" .}} +
+
+
+ {{template "tabler_navbar_logo" .}} +
+ +
+
+

Create new account

+ +
+ + +
+
+ + +
+
+ +
+ + + + + + +
+
+
+ +
+ + +
+
+ +
+ Already have account? Sign in +
+
+
+{{template "base_footer" .}} diff --git a/storage/templates/tabler/layouts/base.html b/storage/templates/tabler/layouts/base.html index b26a538..0c8131a 100644 --- a/storage/templates/tabler/layouts/base.html +++ b/storage/templates/tabler/layouts/base.html @@ -33,7 +33,7 @@ {{template "tabler_skip_link" .}} - + {{end}}