From 6fce04b97acdd68a245b5009a2a507d29ae7d62b Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 9 Aug 2022 04:23:18 +0200 Subject: [PATCH] Don't open new page for ext wiki on same repository - 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 8a15cec2c68a0..9eac4ff916ea6 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -453,6 +453,7 @@ func NewFuncMap() []template.FuncMap { } return items }, + "HasPrefix": strings.HasPrefix, }} } diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index fa0fb7981358e..e78e2e7b4fe4b 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"}} {{.locale.Tr "repo.wiki"}} {{end}}