diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-12-11 18:10:12 +0100 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-12-11 18:10:12 +0100 |
commit | 3784181e4fad3c947dfa95081d8a0b34f5be12d4 (patch) | |
tree | 48263aa693149f997cdd7ac0c51bf0f994743748 /templates/navbar.qtpl.go | |
parent | 57efc8d2173fdff1ef99157a2633d3f1d366a290 (diff) | |
download | cerrado-3784181e4fad3c947dfa95081d8a0b34f5be12d4.tar.gz cerrado-3784181e4fad3c947dfa95081d8a0b34f5be12d4.tar.bz2 cerrado-3784181e4fad3c947dfa95081d8a0b34f5be12d4.zip |
feat: Disable auth if passphrase is empty
Disable all auth mechanism when passphrase is empty. That will allow for
a simpler setup.
Diffstat (limited to 'templates/navbar.qtpl.go')
-rw-r--r-- | templates/navbar.qtpl.go | 156 |
1 files changed, 83 insertions, 73 deletions
diff --git a/templates/navbar.qtpl.go b/templates/navbar.qtpl.go index b359ffb..47573a7 100644 --- a/templates/navbar.qtpl.go +++ b/templates/navbar.qtpl.go @@ -94,181 +94,191 @@ func StreamNavbar(qw422016 *qt422016.Writer, ctx context.Context, s Selection) { <div class="navbar-nav ms-auto"> `) //line templates/navbar.qtpl:33 - if IsLoggedIn(ctx) { + if !IsAuthenticationDisabled(ctx) { //line templates/navbar.qtpl:33 qw422016.N().S(` - <a class="nav-link`) + `) //line templates/navbar.qtpl:34 - streaminsertIfEqual(qw422016, s, Login) + if IsLoggedIn(ctx) { //line templates/navbar.qtpl:34 - qw422016.N().S(`" href="/logout/">logout</a> - `) + qw422016.N().S(` + <a class="nav-link`) //line templates/navbar.qtpl:35 - } else { + streaminsertIfEqual(qw422016, s, Login) //line templates/navbar.qtpl:35 - qw422016.N().S(` - <a class="nav-link`) + qw422016.N().S(`" href="/logout/">logout</a> + `) //line templates/navbar.qtpl:36 - streaminsertIfEqual(qw422016, s, Login) + } else { //line templates/navbar.qtpl:36 - qw422016.N().S(`" href="/login/">login</a> - `) + qw422016.N().S(` + <a class="nav-link`) //line templates/navbar.qtpl:37 - } + streaminsertIfEqual(qw422016, s, Login) //line templates/navbar.qtpl:37 + qw422016.N().S(`" href="/login/">login</a> + `) +//line templates/navbar.qtpl:38 + } +//line templates/navbar.qtpl:38 + qw422016.N().S(` + `) +//line templates/navbar.qtpl:39 + } +//line templates/navbar.qtpl:39 qw422016.N().S(` `) -//line templates/navbar.qtpl:41 +//line templates/navbar.qtpl:43 qw422016.N().S(` `) -//line templates/navbar.qtpl:45 +//line templates/navbar.qtpl:47 qw422016.N().S(` </div> </nav> `) -//line templates/navbar.qtpl:48 +//line templates/navbar.qtpl:50 } -//line templates/navbar.qtpl:48 +//line templates/navbar.qtpl:50 func WriteNavbar(qq422016 qtio422016.Writer, ctx context.Context, s Selection) { -//line templates/navbar.qtpl:48 +//line templates/navbar.qtpl:50 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/navbar.qtpl:48 +//line templates/navbar.qtpl:50 StreamNavbar(qw422016, ctx, s) -//line templates/navbar.qtpl:48 +//line templates/navbar.qtpl:50 qt422016.ReleaseWriter(qw422016) -//line templates/navbar.qtpl:48 +//line templates/navbar.qtpl:50 } -//line templates/navbar.qtpl:48 +//line templates/navbar.qtpl:50 func Navbar(ctx context.Context, s Selection) string { -//line templates/navbar.qtpl:48 +//line templates/navbar.qtpl:50 qb422016 := qt422016.AcquireByteBuffer() -//line templates/navbar.qtpl:48 +//line templates/navbar.qtpl:50 WriteNavbar(qb422016, ctx, s) -//line templates/navbar.qtpl:48 +//line templates/navbar.qtpl:50 qs422016 := string(qb422016.B) -//line templates/navbar.qtpl:48 +//line templates/navbar.qtpl:50 qt422016.ReleaseByteBuffer(qb422016) -//line templates/navbar.qtpl:48 +//line templates/navbar.qtpl:50 return qs422016 -//line templates/navbar.qtpl:48 +//line templates/navbar.qtpl:50 } -//line templates/navbar.qtpl:50 +//line templates/navbar.qtpl:52 func StreamGitItemNav(qw422016 *qt422016.Writer, name, ref string, s GitSelection) { -//line templates/navbar.qtpl:50 +//line templates/navbar.qtpl:52 qw422016.N().S(` <div class="row"> <h3 id="name">`) -//line templates/navbar.qtpl:52 +//line templates/navbar.qtpl:54 qw422016.E().S(name) -//line templates/navbar.qtpl:52 +//line templates/navbar.qtpl:54 qw422016.N().S(` `) -//line templates/navbar.qtpl:52 +//line templates/navbar.qtpl:54 if ref != "" && (s == Log || s == Tree) { -//line templates/navbar.qtpl:52 +//line templates/navbar.qtpl:54 qw422016.N().S(`@ `) -//line templates/navbar.qtpl:52 +//line templates/navbar.qtpl:54 qw422016.E().S(ref) -//line templates/navbar.qtpl:52 +//line templates/navbar.qtpl:54 } -//line templates/navbar.qtpl:52 +//line templates/navbar.qtpl:54 qw422016.N().S(`</h3> </div> <div class="row"> <ul class="nav"> <li class="nav-item"> <a class="nav-link`) -//line templates/navbar.qtpl:57 +//line templates/navbar.qtpl:59 streaminsertIfEqual(qw422016, s, Readme) -//line templates/navbar.qtpl:57 +//line templates/navbar.qtpl:59 qw422016.N().S(`" aria-current="page" href="/`) -//line templates/navbar.qtpl:57 +//line templates/navbar.qtpl:59 qw422016.E().S(name) -//line templates/navbar.qtpl:57 +//line templates/navbar.qtpl:59 qw422016.N().S(`/about/">about</a> </li> <li class="nav-item"> <a class="nav-link`) -//line templates/navbar.qtpl:60 +//line templates/navbar.qtpl:62 streaminsertIfEqual(qw422016, s, Summary) -//line templates/navbar.qtpl:60 +//line templates/navbar.qtpl:62 qw422016.N().S(`" aria-current="page" href="/`) -//line templates/navbar.qtpl:60 +//line templates/navbar.qtpl:62 qw422016.E().S(name) -//line templates/navbar.qtpl:60 +//line templates/navbar.qtpl:62 qw422016.N().S(`/">summary</a> </li> <li class="nav-item"> <a class="nav-link`) -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:65 streaminsertIfEqual(qw422016, s, Refs) -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:65 qw422016.N().S(`" aria-current="page" href="/`) -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:65 qw422016.E().S(name) -//line templates/navbar.qtpl:63 +//line templates/navbar.qtpl:65 qw422016.N().S(`/refs/">refs</a> </li> <li class="nav-item"> <a class="nav-link`) -//line templates/navbar.qtpl:66 +//line templates/navbar.qtpl:68 streaminsertIfEqual(qw422016, s, Log) -//line templates/navbar.qtpl:66 +//line templates/navbar.qtpl:68 qw422016.N().S(`" aria-current="page" href="/`) -//line templates/navbar.qtpl:66 +//line templates/navbar.qtpl:68 qw422016.E().S(name) -//line templates/navbar.qtpl:66 +//line templates/navbar.qtpl:68 qw422016.N().S(`/log/`) -//line templates/navbar.qtpl:66 +//line templates/navbar.qtpl:68 qw422016.E().S(ref) -//line templates/navbar.qtpl:66 +//line templates/navbar.qtpl:68 qw422016.N().S(`/">log</a> </li> <li class="nav-item"> <a class="nav-link`) -//line templates/navbar.qtpl:69 +//line templates/navbar.qtpl:71 streaminsertIfEqual(qw422016, s, Tree) -//line templates/navbar.qtpl:69 +//line templates/navbar.qtpl:71 qw422016.N().S(`" aria-current="page" href="/`) -//line templates/navbar.qtpl:69 +//line templates/navbar.qtpl:71 qw422016.E().S(name) -//line templates/navbar.qtpl:69 +//line templates/navbar.qtpl:71 qw422016.N().S(`/tree/`) -//line templates/navbar.qtpl:69 +//line templates/navbar.qtpl:71 qw422016.E().S(ref) -//line templates/navbar.qtpl:69 +//line templates/navbar.qtpl:71 qw422016.N().S(`/">tree</a> </li> </ul> </div> `) -//line templates/navbar.qtpl:73 +//line templates/navbar.qtpl:75 } -//line templates/navbar.qtpl:73 +//line templates/navbar.qtpl:75 func WriteGitItemNav(qq422016 qtio422016.Writer, name, ref string, s GitSelection) { -//line templates/navbar.qtpl:73 +//line templates/navbar.qtpl:75 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/navbar.qtpl:73 +//line templates/navbar.qtpl:75 StreamGitItemNav(qw422016, name, ref, s) -//line templates/navbar.qtpl:73 +//line templates/navbar.qtpl:75 qt422016.ReleaseWriter(qw422016) -//line templates/navbar.qtpl:73 +//line templates/navbar.qtpl:75 } -//line templates/navbar.qtpl:73 +//line templates/navbar.qtpl:75 func GitItemNav(name, ref string, s GitSelection) string { -//line templates/navbar.qtpl:73 +//line templates/navbar.qtpl:75 qb422016 := qt422016.AcquireByteBuffer() -//line templates/navbar.qtpl:73 +//line templates/navbar.qtpl:75 WriteGitItemNav(qb422016, name, ref, s) -//line templates/navbar.qtpl:73 +//line templates/navbar.qtpl:75 qs422016 := string(qb422016.B) -//line templates/navbar.qtpl:73 +//line templates/navbar.qtpl:75 qt422016.ReleaseByteBuffer(qb422016) -//line templates/navbar.qtpl:73 +//line templates/navbar.qtpl:75 return qs422016 -//line templates/navbar.qtpl:73 +//line templates/navbar.qtpl:75 } |