tempalte profile
This commit is contained in:
parent
137b9f9a6a
commit
7f3bfb7d59
5 changed files with 189 additions and 8 deletions
|
|
@ -225,6 +225,30 @@ func UserLock(c *core.Context) *core.Response {
|
||||||
return c.Response.Template("apptabler_auth-lock.html", data)
|
return c.Response.Template("apptabler_auth-lock.html", data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UserSettings renders the user settings page.
|
||||||
|
func UserSettings(c *core.Context) *core.Response {
|
||||||
|
type userSettingsPageData struct {
|
||||||
|
TablerPageData
|
||||||
|
UserSettings FormtablerUserSettingsPage
|
||||||
|
}
|
||||||
|
data := userSettingsPageData{
|
||||||
|
TablerPageData: TablerPageData{
|
||||||
|
PageTitle: "Account Settings",
|
||||||
|
PageDescription: "User account settings",
|
||||||
|
ShowTopbar: true,
|
||||||
|
Sidebar: false,
|
||||||
|
PageHeader: "Account Settings",
|
||||||
|
PagePretitle: "User Profile",
|
||||||
|
UserName: "Jane Doe",
|
||||||
|
UserRole: "Administrator",
|
||||||
|
NavbarMenu: SampleNavbarMenu(),
|
||||||
|
Content: nil,
|
||||||
|
},
|
||||||
|
UserSettings: SampleUserSettings(),
|
||||||
|
}
|
||||||
|
return c.Response.Template("apptabler_usersettings.html", data)
|
||||||
|
}
|
||||||
|
|
||||||
// TablerHome renders the homepage/dashboard layout
|
// TablerHome renders the homepage/dashboard layout
|
||||||
func TablerHome(c *core.Context) *core.Response {
|
func TablerHome(c *core.Context) *core.Response {
|
||||||
data := TablerPageData{
|
data := TablerPageData{
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,31 @@ func SampleNavbarMenu() TablerMenu {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SampleUserSettings returns sample data for the user settings page.
|
||||||
|
func SampleUserSettings() FormtablerUserSettingsPage {
|
||||||
|
return FormtablerUserSettingsPage{
|
||||||
|
ActiveTab: "My Account",
|
||||||
|
SidebarSections: []FormtablerUserSettingsSection{
|
||||||
|
{
|
||||||
|
Title: "Business settings",
|
||||||
|
SubItems: []FormtablerUserSettingsNavItem{
|
||||||
|
{Title: "My Account", Link: "/user/settings", Active: true},
|
||||||
|
{Title: "My Notifications", Link: "#"},
|
||||||
|
{Title: "Connected Apps", Link: "#"},
|
||||||
|
{Title: "Plans", Link: "#"},
|
||||||
|
{Title: "Billing & Invoices", Link: "#"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Title: "Experience",
|
||||||
|
SubItems: []FormtablerUserSettingsNavItem{
|
||||||
|
{Title: "Give Feedback", Link: "#"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// SampleComponents returns sample data for alerts, breadcrumbs, and toasts.
|
// SampleComponents returns sample data for alerts, breadcrumbs, and toasts.
|
||||||
func SampleComponents() FormtablerComponentsPage {
|
func SampleComponents() FormtablerComponentsPage {
|
||||||
return FormtablerComponentsPage{
|
return FormtablerComponentsPage{
|
||||||
|
|
|
||||||
|
|
@ -481,6 +481,25 @@ type FormtablerComponentsPage struct {
|
||||||
Toasts []FormtablerToast
|
Toasts []FormtablerToast
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FormtablerUserSettingsSection represents a section in the settings sidebar.
|
||||||
|
type FormtablerUserSettingsSection struct {
|
||||||
|
Title string
|
||||||
|
SubItems []FormtablerUserSettingsNavItem
|
||||||
|
}
|
||||||
|
|
||||||
|
// FormtablerUserSettingsNavItem represents a single navigation item in the settings sidebar.
|
||||||
|
type FormtablerUserSettingsNavItem struct {
|
||||||
|
Title string
|
||||||
|
Link string
|
||||||
|
Active bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// FormtablerUserSettingsPage holds the data for the user settings page.
|
||||||
|
type FormtablerUserSettingsPage struct {
|
||||||
|
SidebarSections []FormtablerUserSettingsSection
|
||||||
|
ActiveTab string
|
||||||
|
}
|
||||||
|
|
||||||
// AuthLockPageData holds the data for the account lock page.
|
// AuthLockPageData holds the data for the account lock page.
|
||||||
type AuthLockPageData struct {
|
type AuthLockPageData struct {
|
||||||
PersonName string
|
PersonName string
|
||||||
|
|
|
||||||
18
routes.go
18
routes.go
|
|
@ -69,14 +69,16 @@ func registerRoutes() {
|
||||||
controller.Get("/tablerdefault", controllers.TablerDefault)
|
controller.Get("/tablerdefault", controllers.TablerDefault)
|
||||||
controller.Get("/tablerhome", controllers.TablerHome)
|
controller.Get("/tablerhome", controllers.TablerHome)
|
||||||
controller.Get("/tablernavmenu", controllers.TablerNavbar)
|
controller.Get("/tablernavmenu", controllers.TablerNavbar)
|
||||||
controller.Get("/user/login", controllers.UserSignIn)
|
controller.Get("/user/login", controllers.UserSignIn)
|
||||||
controller.Post("/user/login", controllers.UserSignIn)
|
controller.Post("/user/login", controllers.UserSignIn)
|
||||||
controller.Get("/user/signup", controllers.UserSignUp)
|
controller.Get("/user/signup", controllers.UserSignUp)
|
||||||
controller.Post("/user/signup", controllers.UserSignUp)
|
controller.Post("/user/signup", controllers.UserSignUp)
|
||||||
controller.Get("/user/forgot", controllers.UserForgot)
|
controller.Get("/user/forgot", controllers.UserForgot)
|
||||||
controller.Post("/user/forgot", controllers.UserForgot)
|
controller.Post("/user/forgot", controllers.UserForgot)
|
||||||
controller.Get("/user/lock", controllers.UserLock)
|
controller.Get("/user/lock", controllers.UserLock)
|
||||||
controller.Post("/user/lock", controllers.UserLock)
|
controller.Post("/user/lock", controllers.UserLock)
|
||||||
|
controller.Get("/user/settings", controllers.UserSettings)
|
||||||
|
controller.Post("/user/settings", controllers.UserSettings)
|
||||||
|
|
||||||
controller.Get("/tablertable", controllers.TablerTables)
|
controller.Get("/tablertable", controllers.TablerTables)
|
||||||
controller.Get("/tablerformelements", controllers.TablerFormElements)
|
controller.Get("/tablerformelements", controllers.TablerFormElements)
|
||||||
|
|
|
||||||
111
storage/templates/tabler/app/profile/apptabler_usersettings.html
Normal file
111
storage/templates/tabler/app/profile/apptabler_usersettings.html
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
{{template "base_header" .}}
|
||||||
|
{{$s := .UserSettings}}
|
||||||
|
<div class="page">
|
||||||
|
{{if .ShowTopbar}}
|
||||||
|
{{template "tabler_navbar" .}}
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
<div class="page-wrapper">
|
||||||
|
{{if .PageHeader}}
|
||||||
|
<div class="page-header d-print-none">
|
||||||
|
<div class="container-xl">
|
||||||
|
<div class="row g-2 align-items-center">
|
||||||
|
<div class="col">
|
||||||
|
{{if .PagePretitle}}
|
||||||
|
<div class="page-pretitle">
|
||||||
|
{{.PagePretitle}}
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
<h1 class="page-title">
|
||||||
|
{{.PageHeader}}
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
<div class="page-body">
|
||||||
|
<div class="container-xl">
|
||||||
|
<div class="card">
|
||||||
|
<div class="row g-0">
|
||||||
|
<div class="col-12 col-md-3 border-end">
|
||||||
|
<div class="card-body">
|
||||||
|
{{range $s.SidebarSections}}
|
||||||
|
<h4 class="subheader">{{.Title}}</h4>
|
||||||
|
<nav class="list-group list-group-transparent mb-4">
|
||||||
|
{{range .SubItems}}
|
||||||
|
<a href="{{.Link}}" class="list-group-item list-group-item-action d-flex align-items-center{{if .Active}} active{{end}}">{{.Title}}</a>
|
||||||
|
{{end}}
|
||||||
|
</nav>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-md-9 d-flex flex-column">
|
||||||
|
<div class="card-body">
|
||||||
|
<h3 class="card-title">{{defaultVal "My Account" $s.ActiveTab}}</h3>
|
||||||
|
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-auto">
|
||||||
|
<span class="avatar avatar-xl" style="background-image: url(/static/avatars/000m.jpg)"></span>
|
||||||
|
</div>
|
||||||
|
<div class="col align-self-center">
|
||||||
|
<div class="text-secondary mt-1">Paweł Kuna</div>
|
||||||
|
<a href="#" class="btn btn-sm btn-outline-primary mt-2">Change avatar</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h4 class="subheader">Personal Information</h4>
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">First Name</label>
|
||||||
|
<input type="text" class="form-control" value="Paweł">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Last Name</label>
|
||||||
|
<input type="text" class="form-control" value="Kuna">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Email address</label>
|
||||||
|
<input type="email" class="form-control" value="pawel.kuna@example.com">
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Bio</label>
|
||||||
|
<textarea class="form-control" rows="3" placeholder="Write a short bio...">UI Designer at Tabler</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h4 class="subheader">Password</h4>
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Current Password</label>
|
||||||
|
<input type="password" class="form-control" placeholder="Leave blank to keep unchanged">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">New Password</label>
|
||||||
|
<input type="password" class="form-control" placeholder="Leave blank to keep unchanged">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-footer">
|
||||||
|
<button type="submit" class="btn btn-primary">Save changes</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{template "tabler_footer" .}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{template "base_footer" .}}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue