From 1e45ae2ea3497958b2ea6a20137955cfc3bbc964 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Wed, 11 Dec 2024 17:05:12 +0100 Subject: feat: Add UI/Handler login process It adds the whole workflow to store and handle login on both UI and handler level. With that the login information should be available at any point given the context. --- templates/navbar.qtpl.go | 211 ++++++++++++++++++++++++++--------------------- 1 file changed, 117 insertions(+), 94 deletions(-) (limited to 'templates/navbar.qtpl.go') diff --git a/templates/navbar.qtpl.go b/templates/navbar.qtpl.go index e080785..d900c9c 100644 --- a/templates/navbar.qtpl.go +++ b/templates/navbar.qtpl.go @@ -5,19 +5,22 @@ package templates //line templates/navbar.qtpl:1 +import "context" + +//line templates/navbar.qtpl:3 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) -//line templates/navbar.qtpl:1 +//line templates/navbar.qtpl:3 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) -//line templates/navbar.qtpl:2 +//line templates/navbar.qtpl:4 type Selection int const ( @@ -28,7 +31,7 @@ const ( Login ) -//line templates/navbar.qtpl:13 +//line templates/navbar.qtpl:15 type GitSelection int const ( @@ -39,213 +42,233 @@ const ( Tree ) -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 func streaminsertIfEqual(qw422016 *qt422016.Writer, s, d any) { -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 if s == d { -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 qw422016.N().S(` selected`) -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 } -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 } -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 func writeinsertIfEqual(qq422016 qtio422016.Writer, s, d any) { -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 streaminsertIfEqual(qw422016, s, d) -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 qt422016.ReleaseWriter(qw422016) -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 } -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 func insertIfEqual(s, d any) string { -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 qb422016 := qt422016.AcquireByteBuffer() -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 writeinsertIfEqual(qb422016, s, d) -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 qs422016 := string(qb422016.B) -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 qt422016.ReleaseByteBuffer(qb422016) -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 return qs422016 -//line templates/navbar.qtpl:23 +//line templates/navbar.qtpl:25 } -//line templates/navbar.qtpl:25 -func StreamNavbar(qw422016 *qt422016.Writer, s Selection) { -//line templates/navbar.qtpl:25 +//line templates/navbar.qtpl:27 +func StreamNavbar(qw422016 *qt422016.Writer, ctx context.Context, s Selection) { +//line templates/navbar.qtpl:27 qw422016.N().S(` `) -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:48 } -//line templates/navbar.qtpl:42 -func WriteNavbar(qq422016 qtio422016.Writer, s Selection) { -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:48 +func WriteNavbar(qq422016 qtio422016.Writer, ctx context.Context, s Selection) { +//line templates/navbar.qtpl:48 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/navbar.qtpl:42 - StreamNavbar(qw422016, s) -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:48 + StreamNavbar(qw422016, ctx, s) +//line templates/navbar.qtpl:48 qt422016.ReleaseWriter(qw422016) -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:48 } -//line templates/navbar.qtpl:42 -func Navbar(s Selection) string { -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:48 +func Navbar(ctx context.Context, s Selection) string { +//line templates/navbar.qtpl:48 qb422016 := qt422016.AcquireByteBuffer() -//line templates/navbar.qtpl:42 - WriteNavbar(qb422016, s) -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:48 + WriteNavbar(qb422016, ctx, s) +//line templates/navbar.qtpl:48 qs422016 := string(qb422016.B) -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:48 qt422016.ReleaseByteBuffer(qb422016) -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:48 return qs422016 -//line templates/navbar.qtpl:42 +//line templates/navbar.qtpl:48 } -//line templates/navbar.qtpl:44 +//line templates/navbar.qtpl:50 func StreamGitItemNav(qw422016 *qt422016.Writer, name, ref string, s GitSelection) { -//line templates/navbar.qtpl:44 +//line templates/navbar.qtpl:50 qw422016.N().S(`

`) -//line templates/navbar.qtpl:46 +//line templates/navbar.qtpl:52 qw422016.E().S(name) -//line templates/navbar.qtpl:46 +//line templates/navbar.qtpl:52 qw422016.N().S(` `) -//line templates/navbar.qtpl:46 +//line templates/navbar.qtpl:52 if ref != "" && (s == Log || s == Tree) { -//line templates/navbar.qtpl:46 +//line templates/navbar.qtpl:52 qw422016.N().S(`@ `) -//line templates/navbar.qtpl:46 +//line templates/navbar.qtpl:52 qw422016.E().S(ref) -//line templates/navbar.qtpl:46 +//line templates/navbar.qtpl:52 } -//line templates/navbar.qtpl:46 +//line templates/navbar.qtpl:52 qw422016.N().S(`

`) -//line templates/navbar.qtpl:67 +//line templates/navbar.qtpl:73 } -//line templates/navbar.qtpl:67 +//line templates/navbar.qtpl:73 func WriteGitItemNav(qq422016 qtio422016.Writer, name, ref string, s GitSelection) { -//line templates/navbar.qtpl:67 +//line templates/navbar.qtpl:73 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/navbar.qtpl:67 +//line templates/navbar.qtpl:73 StreamGitItemNav(qw422016, name, ref, s) -//line templates/navbar.qtpl:67 +//line templates/navbar.qtpl:73 qt422016.ReleaseWriter(qw422016) -//line templates/navbar.qtpl:67 +//line templates/navbar.qtpl:73 } -//line templates/navbar.qtpl:67 +//line templates/navbar.qtpl:73 func GitItemNav(name, ref string, s GitSelection) string { -//line templates/navbar.qtpl:67 +//line templates/navbar.qtpl:73 qb422016 := qt422016.AcquireByteBuffer() -//line templates/navbar.qtpl:67 +//line templates/navbar.qtpl:73 WriteGitItemNav(qb422016, name, ref, s) -//line templates/navbar.qtpl:67 +//line templates/navbar.qtpl:73 qs422016 := string(qb422016.B) -//line templates/navbar.qtpl:67 +//line templates/navbar.qtpl:73 qt422016.ReleaseByteBuffer(qb422016) -//line templates/navbar.qtpl:67 +//line templates/navbar.qtpl:73 return qs422016 -//line templates/navbar.qtpl:67 +//line templates/navbar.qtpl:73 } -- cgit v1.2.3