From c0754e9d1998827a4be7b7297d87cb6e5e31500d Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 23 Aug 2022 01:58:11 +0200 Subject: [PATCH] Don't open new page for ext wiki on same repository (#20725) (#20910) * 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 * Gofmt * Fix line Co-authored-by: zeripath --- 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 537ef71cc..ad39baecb 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -454,6 +454,7 @@ func NewFuncMap() []template.FuncMap { } return items }, + "HasPrefix": strings.HasPrefix, }} } diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 94ae5ed7e..a2f31fc95 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}}