From b5485ca03d6e4e098c1307c6cee662d9b3ac74c4 Mon Sep 17 00:00:00 2001 From: Gusted Date: Mon, 22 Aug 2022 14:41:58 +0200 Subject: [PATCH 1/3] Don't open new page for ext wiki on same repository (#20725) - Backport of #20725 - When the external wiki has been set to a file on the repository, don't open the page on a tab. - Resolves #20657 --- modules/templates/helper.go | 1 + templates/repo/header.tmpl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 537ef71ccf5ed..359b5db2f0879 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -574,6 +574,7 @@ func NewTextFuncMap() []texttmpl.FuncMap { return sum }, "QueryEscape": url.QueryEscape, + "HasPrefix": strings.HasPrefix, }} } diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 94ae5ed7e215f..a2f31fc9503b6 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -206,7 +206,7 @@ {{end}} {{if or (.Permission.CanRead $.UnitTypeWiki) (.Permission.CanRead $.UnitTypeExternalWiki)}} - + {{svg "octicon-book"}} {{.i18n.Tr "repo.wiki"}} {{end}} From 3d077ebd5c136dd2f46898ffdffcb66d536420fa Mon Sep 17 00:00:00 2001 From: Gusted Date: Mon, 22 Aug 2022 14:46:14 +0200 Subject: [PATCH 2/3] Gofmt --- modules/templates/helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 359b5db2f0879..3fb140b04e9ee 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -574,7 +574,7 @@ func NewTextFuncMap() []texttmpl.FuncMap { return sum }, "QueryEscape": url.QueryEscape, - "HasPrefix": strings.HasPrefix, + "HasPrefix": strings.HasPrefix, }} } From 0a0029c539c3f4b34f808a164870824edddd0554 Mon Sep 17 00:00:00 2001 From: Gusted Date: Mon, 22 Aug 2022 16:21:30 +0200 Subject: [PATCH 3/3] Fix line --- modules/templates/helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 3fb140b04e9ee..ad39baecb904e 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -454,6 +454,7 @@ func NewFuncMap() []template.FuncMap { } return items }, + "HasPrefix": strings.HasPrefix, }} } @@ -574,7 +575,6 @@ func NewTextFuncMap() []texttmpl.FuncMap { return sum }, "QueryEscape": url.QueryEscape, - "HasPrefix": strings.HasPrefix, }} }