// Copyright 2023 Harran Ali <harran.m@gmail.com>. All rights reserved.
// Copyright (c) 2024 Zeni Kim <zenik@smarteching.com>
// Use of this source code is governed by MIT-style
// license that can be found in the LICENSE file.

package main

import (
	"git.smarteching.com/goffee/core"
	"git.smarteching.com/jacs/goffeetabler/controllers"
	"git.smarteching.com/jacs/goffeetabler/hooks"
)

// Register the app controllers
func registerRoutes() {
	controller := core.ResolveRouter()
	//#############################
	//# App Routes            #####
	//#############################

	// Define your routes here...
	controller.Get("/", controllers.WelcomeHome)
	// Uncomment the lines below to enable theme demo
	controller.Get("/themebase", controllers.Themedemo)
	controller.Get("/themeform", controllers.Themeform)
	controller.Get("/themecontent", controllers.Themecontent)
	controller.Get("/themepanel", controllers.Themedemo)
	controller.Get("/themeelements", controllers.ThemeElements)
	controller.Get("/queuesample", controllers.Queuesample)

	// Uncomment the lines below to enable authentication
	controller.Post("/signup", controllers.Signup)
	controller.Post("/signin", controllers.Signin)
	controller.Post("/signout", controllers.Signout)
	controller.Post("/reset-password", controllers.ResetPasswordRequest)
	controller.Post("/reset-password/code/:code", controllers.SetNewPassword)

	// Uncomment the lines below to enable user administration
	controller.Get("/admin/users", controllers.AdminUsersList)
	controller.Post("/admin/users", controllers.AdminUsersList)
	controller.Get("/admin/users/add", controllers.AdminUsersAdd)
	controller.Post("/admin/users/add", controllers.AdminUsersAdd)
	controller.Get("/admin/users/edit/:id", controllers.AdminUsersEdit)
	controller.Post("/admin/users/edit/:id", controllers.AdminUsersEdit)
	controller.Post("/admin/users/delete", controllers.AdminUsersDelete)
	controller.Post("/admin/users/deleteconfirm", controllers.AdminUsersDelConfirm)
	//controller.Get("/admin/users/roles", controllers.Signout)
	//controller.Get("/admin/users/permissions", controllers.ResetPasswordRequest)

	controller.Get("/dashboard", controllers.WelcomeToDashboard, hooks.AuthCheck)

	// templates demos
	controller.Get("/signout", controllers.Signout)

	controller.Get("/appsample", controllers.AppSample, hooks.AuthCheck)
	controller.Post("/appsample", controllers.AppSample, hooks.AuthCheck)

	controller.Get("/applogin", controllers.AppLogin, hooks.CheckSessionCookie)
	controller.Post("/applogin", controllers.AppLogin, hooks.CheckSessionCookie)

	controller.Get("/appsession", controllers.AppSession)
	controller.Post("/appsession", controllers.AppSession)


	controller.Get("/demotabler1", controllers.TablerDemo1)

	// Tabler layout routes
	controller.Get("/tablersingle", controllers.TablerSingle)
	controller.Get("/tablerdefault", controllers.TablerDefault)
	controller.Get("/tablerhome", controllers.TablerHome)
	controller.Get("/tablernavmenu", controllers.TablerNavbar)

}
