From b8b6d3037c524575f140650ac243c16df6a98a92 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Wed, 19 Jul 2023 21:01:49 +0200 Subject: feat: Move last page to qtpl --- pkg/view/filesystem.go | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'pkg/view') diff --git a/pkg/view/filesystem.go b/pkg/view/filesystem.go index 7fd7331..6a01117 100644 --- a/pkg/view/filesystem.go +++ b/pkg/view/filesystem.go @@ -3,10 +3,10 @@ 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/pkg/service" + "git.sr.ht/~gabrielgio/img/templates" ) type ( @@ -45,17 +45,12 @@ func (self *FileSystemView) Index(ctx *fasthttp.RequestCtx) error { return err } - err = img.Render(ctx, "fs.html", &img.HTMLView[*FilePage]{ - Title: pathValue, - Data: &FilePage{ - Page: page, - ShowMode: settings.ShowMode, - ShowOwner: settings.ShowOwner, - }, + templates.WritePageTemplate(ctx, &templates.FilePage{ + Page: page, + ShowMode: settings.ShowMode, + ShowOwner: settings.ShowOwner, }) - if err != nil { - return err - } + return nil } -- cgit v1.2.3