aboutsummaryrefslogtreecommitdiff
path: root/pkg/view
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-07-19 20:24:19 +0200
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-07-19 21:00:27 +0200
commit52276ba99540d6c61195772ccdd50944e96f4959 (patch)
tree88f9ae39a76c063e99864bd8c4c84d63111ce3af /pkg/view
parentcd1fa849fb161d3bbc7c582aa2787315a1037db1 (diff)
downloadlens-52276ba99540d6c61195772ccdd50944e96f4959.tar.gz
lens-52276ba99540d6c61195772ccdd50944e96f4959.tar.bz2
lens-52276ba99540d6c61195772ccdd50944e96f4959.zip
feat: Move settings from `html/template` to qtpl
Diffstat (limited to 'pkg/view')
-rw-r--r--pkg/view/settings.go18
1 files changed, 6 insertions, 12 deletions
diff --git a/pkg/view/settings.go b/pkg/view/settings.go
index 14f4e49..bee3dc2 100644
--- a/pkg/view/settings.go
+++ b/pkg/view/settings.go
@@ -3,9 +3,9 @@ package view
import (
"github.com/valyala/fasthttp"
- "git.sr.ht/~gabrielgio/img"
"git.sr.ht/~gabrielgio/img/pkg/database/repository"
"git.sr.ht/~gabrielgio/img/pkg/ext"
+ "git.sr.ht/~gabrielgio/img/templates"
)
type (
@@ -14,11 +14,6 @@ type (
settingsRepository repository.SettingsRepository
userRepository repository.UserRepository
}
-
- SettingsPage struct {
- Settings *repository.Settings
- Users []*repository.User
- }
)
func NewSettingsView(
@@ -42,13 +37,12 @@ func (self *SettingsView) Index(ctx *fasthttp.RequestCtx) error {
return err
}
- return img.Render(ctx, "settings.html", &img.HTMLView[*SettingsPage]{
- Title: "Settings",
- Data: &SettingsPage{
- Settings: s,
- Users: users,
- },
+ templates.WritePageTemplate(ctx, &templates.SettingsPage{
+ Settings: s,
+ Users: users,
})
+
+ return nil
}
func (self *SettingsView) Save(ctx *fasthttp.RequestCtx) error {