Skip to content

Commit b2b6dcd

Browse files
author
Diyor Khaydarov
committed
Merge branch 'main' of https://github.com/iota-uz/iota-sdk
2 parents 82369b6 + 98e383d commit b2b6dcd

File tree

114 files changed

+555
-304
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+555
-304
lines changed

modules/bichat/presentation/templates/pages/bichat/bichat.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ templ BiChatPage(props *ChatPageProps) {
110110
templ Index(props *ChatPageProps) {
111111
{{ pageCtx := composables.UsePageCtx(ctx) }}
112112
@layouts.Authenticated(layouts.AuthenticatedProps{
113-
Title: pageCtx.T("BiChat.Meta.Index.Title"),
113+
BaseProps: layouts.BaseProps{Title: pageCtx.T("BiChat.Meta.Index.Title")},
114114
}) {
115115
@BiChatPage(props)
116116
}

modules/bichat/presentation/templates/pages/bichat/bichat_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/templates/layouts/authenticated.templ

+5-2
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ templ SidebarHeader() {
201201
}
202202

203203
type AuthenticatedProps struct {
204-
Title string
204+
BaseProps
205205
}
206206

207207
templ Authenticated(props AuthenticatedProps) {
@@ -214,7 +214,10 @@ templ Authenticated(props AuthenticatedProps) {
214214
Footer: SidebarFooter(pageCtx),
215215
}
216216
}}
217-
@Base(props.Title) {
217+
if props.WebsocketURL == "" {
218+
{{ props.WebsocketURL = "/ws" }}
219+
}
220+
@Base(&props.BaseProps) {
218221
@MobileSidebar(sidebarProps)
219222
<div class="grid min-h-screen w-full lg:grid-cols-[280px_1fr] overflow-y-auto">
220223
<div class="hidden lg:block">

modules/core/presentation/templates/layouts/authenticated_templ.go

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/templates/layouts/base.templ

+12-3
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,28 @@ templ DefaultHead() {
3232
<script src={ htmxWS }></script>
3333
}
3434

35-
templ Base(title string) {
35+
type BaseProps struct {
36+
Title string
37+
WebsocketURL string
38+
}
39+
40+
templ Base(props *BaseProps) {
3641
<!DOCTYPE html>
3742
<html
3843
lang="en"
3944
class="system bg-surface-100 text-100"
4045
>
4146
<head>
42-
<title>{ title }</title>
47+
<title>{ props.Title }</title>
4348
<meta charset="UTF-8"/>
4449
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
4550
@composables.MustUseHead(ctx)
4651
</head>
47-
<body class="antialiased overflow-y-hidden">
52+
<body
53+
class="antialiased overflow-y-hidden"
54+
hx-ext="ws"
55+
ws-connect={ props.WebsocketURL }
56+
>
4857
{ children... }
4958
</body>
5059
</html>

modules/core/presentation/templates/layouts/base_templ.go

+23-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/templates/pages/account/index.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ templ ProfileForm(props *ProfilePageProps) {
9393
templ Index(props *ProfilePageProps) {
9494
{{ pageCtx := composables.UsePageCtx(ctx) }}
9595
@layouts.Authenticated(layouts.AuthenticatedProps{
96-
Title: pageCtx.T("Account.Meta.Index.Title"),
96+
BaseProps: layouts.BaseProps{Title: pageCtx.T("Account.Meta.Index.Title")},
9797
}) {
9898
@ProfileForm(props)
9999
}

modules/core/presentation/templates/pages/account/index_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/templates/pages/account/settings.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ templ SettingsForm(props *SettingsPageProps) {
100100
templ Settings(props *SettingsPageProps) {
101101
{{ pageCtx := composables.UsePageCtx(ctx) }}
102102
@layouts.Authenticated(layouts.AuthenticatedProps{
103-
Title: pageCtx.T("Account.Meta.Settings.Title"),
103+
BaseProps: layouts.BaseProps{Title: pageCtx.T("Account.Meta.Settings.Title")},
104104
}) {
105105
@SettingsForm(props)
106106
}

modules/core/presentation/templates/pages/account/settings_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/templates/pages/dashboard/index.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ templ DashboardContent(props *IndexPageProps) {
178178
templ Index(props *IndexPageProps) {
179179
{{ pageCtx := composables.UsePageCtx(ctx) }}
180180
@layouts.Authenticated(layouts.AuthenticatedProps{
181-
Title: pageCtx.T("Dashboard.Meta.Title"),
181+
BaseProps: layouts.BaseProps{Title: pageCtx.T("Dashboard.Meta.Title")},
182182
}) {
183183
@DashboardContent(props)
184184
}

modules/core/presentation/templates/pages/dashboard/index_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/templates/pages/error_pages/notfound.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
templ NotFoundContent() {
10-
@layouts.Base("Not found") {
10+
@layouts.Base(&layouts.BaseProps{Title: "Not found", WebsocketURL: "/ws"}) {
1111
<div class="flex flex-col items-center justify-center h-screen w-full">
1212
<div class="flex flex-col items-center">
1313
<img src="/assets/images/search.svg" class="w-32 h-32" alt="404"/>

modules/core/presentation/templates/pages/error_pages/notfound_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/templates/pages/login/index.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ templ Header() {
7272

7373
templ Index(p *LoginProps) {
7474
{{ pageCtx := composables.UsePageCtx(ctx) }}
75-
@layouts.Base(pageCtx.T("Login.Meta.Title")) {
75+
@layouts.Base(&layouts.BaseProps{Title: pageCtx.T("Login.Meta.Title"), WebsocketURL: "/ws"}) {
7676
<div class="flex flex-col h-screen overflow-y-auto">
7777
@Header()
7878
<div class="flex-1 flex items-center justify-center">

modules/core/presentation/templates/pages/login/index_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/templates/pages/roles/edit.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ templ EditForm(props *EditFormProps) {
105105
templ Edit(props *EditFormProps) {
106106
{{ pageCtx := composables.UsePageCtx(ctx) }}
107107
@layouts.Authenticated(layouts.AuthenticatedProps{
108-
Title: pageCtx.T("Roles.Meta.Edit.Title"),
108+
BaseProps: layouts.BaseProps{Title: pageCtx.T("Roles.Meta.Edit.Title")},
109109
}) {
110110
@EditForm(props)
111111
@dialog.Confirmation(&dialog.Props{

modules/core/presentation/templates/pages/roles/edit_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/templates/pages/roles/new.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ templ CreateForm(props *CreateFormProps) {
7070
templ New(props *CreateFormProps) {
7171
{{ pageCtx := composables.UsePageCtx(ctx) }}
7272
@layouts.Authenticated(layouts.AuthenticatedProps{
73-
Title: pageCtx.T("Roles.Meta.New.Title"),
73+
BaseProps: layouts.BaseProps{Title: pageCtx.T("Roles.Meta.New.Title")},
7474
}) {
7575
@CreateForm(props)
7676
}

modules/core/presentation/templates/pages/roles/new_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/templates/pages/roles/roles.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ templ RolesContent(props *IndexPageProps) {
103103
templ Index(props *IndexPageProps) {
104104
{{ pageCtx := composables.UsePageCtx(ctx) }}
105105
@layouts.Authenticated(layouts.AuthenticatedProps{
106-
Title: pageCtx.T("Roles.Meta.List.Title"),
106+
BaseProps: layouts.BaseProps{Title: pageCtx.T("Roles.Meta.List.Title")},
107107
}) {
108108
@RolesContent(props)
109109
}

modules/core/presentation/templates/pages/roles/roles_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/templates/pages/users/edit.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ templ EditForm(props *EditFormProps) {
163163
templ Edit(props *EditFormProps) {
164164
{{ pageCtx := composables.UsePageCtx(ctx) }}
165165
@layouts.Authenticated(layouts.AuthenticatedProps{
166-
Title: pageCtx.T("Users.Meta.Edit.Title"),
166+
BaseProps: layouts.BaseProps{Title: pageCtx.T("Users.Meta.Edit.Title")},
167167
}) {
168168
@EditForm(props)
169169
@dialog.Confirmation(&dialog.Props{

modules/core/presentation/templates/pages/users/edit_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/templates/pages/users/new.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ templ CreateForm(props *CreateFormProps) {
108108
templ New(props *CreateFormProps) {
109109
{{ pageCtx := composables.UsePageCtx(ctx) }}
110110
@layouts.Authenticated(layouts.AuthenticatedProps{
111-
Title: pageCtx.T("Users.Meta.New.Title"),
111+
BaseProps: layouts.BaseProps{Title: pageCtx.T("Users.Meta.New.Title")},
112112
}) {
113113
@CreateForm(props)
114114
}

modules/core/presentation/templates/pages/users/new_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/core/presentation/templates/pages/users/users.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ templ UsersContent(props *IndexPageProps) {
205205
templ Index(props *IndexPageProps) {
206206
{{ pageCtx := composables.UsePageCtx(ctx) }}
207207
@layouts.Authenticated(layouts.AuthenticatedProps{
208-
Title: pageCtx.T("Users.Meta.List.Title"),
208+
BaseProps: layouts.BaseProps{Title: pageCtx.T("Users.Meta.List.Title")},
209209
}) {
210210
@UsersContent(props)
211211
}

modules/core/presentation/templates/pages/users/users_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)