From ce8da047eaa9c5d5d7882261fd074d98302d79d1 Mon Sep 17 00:00:00 2001 From: bouncepaw Date: Sun, 29 Nov 2020 22:09:02 +0500 Subject: [PATCH] Do not show login link for wikis with no auth --- templates/common.qtpl | 2 + templates/common.qtpl.go | 84 ++++++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 37 deletions(-) diff --git a/templates/common.qtpl b/templates/common.qtpl index 321da84..29673cc 100644 --- a/templates/common.qtpl +++ b/templates/common.qtpl @@ -40,6 +40,7 @@ var navEntries = []navEntry{ {% endfunc %} {% func userMenuHTML(u *user.User) %} + {% if user.AuthUsed %} + {% endif %} {% endfunc %} diff --git a/templates/common.qtpl.go b/templates/common.qtpl.go index de53098..b2791b8 100644 --- a/templates/common.qtpl.go +++ b/templates/common.qtpl.go @@ -140,63 +140,73 @@ func navHTML(rq *http.Request, hyphaName, navType string, revisionHash ...string func streamuserMenuHTML(qw422016 *qt422016.Writer, u *user.User) { //line templates/common.qtpl:42 qw422016.N().S(` + `) +//line templates/common.qtpl:43 + if user.AuthUsed { +//line templates/common.qtpl:43 + qw422016.N().S(` + `) +//line templates/common.qtpl:51 + } +//line templates/common.qtpl:51 + qw422016.N().S(` `) -//line templates/common.qtpl:50 +//line templates/common.qtpl:52 } -//line templates/common.qtpl:50 +//line templates/common.qtpl:52 func writeuserMenuHTML(qq422016 qtio422016.Writer, u *user.User) { -//line templates/common.qtpl:50 +//line templates/common.qtpl:52 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/common.qtpl:50 +//line templates/common.qtpl:52 streamuserMenuHTML(qw422016, u) -//line templates/common.qtpl:50 +//line templates/common.qtpl:52 qt422016.ReleaseWriter(qw422016) -//line templates/common.qtpl:50 +//line templates/common.qtpl:52 } -//line templates/common.qtpl:50 +//line templates/common.qtpl:52 func userMenuHTML(u *user.User) string { -//line templates/common.qtpl:50 +//line templates/common.qtpl:52 qb422016 := qt422016.AcquireByteBuffer() -//line templates/common.qtpl:50 +//line templates/common.qtpl:52 writeuserMenuHTML(qb422016, u) -//line templates/common.qtpl:50 +//line templates/common.qtpl:52 qs422016 := string(qb422016.B) -//line templates/common.qtpl:50 +//line templates/common.qtpl:52 qt422016.ReleaseByteBuffer(qb422016) -//line templates/common.qtpl:50 +//line templates/common.qtpl:52 return qs422016 -//line templates/common.qtpl:50 +//line templates/common.qtpl:52 }