From d347208114966166ffa9655adc5b202676546c31 Mon Sep 17 00:00:00 2001 From: JakobDev Date: Mon, 24 Apr 2023 18:28:37 +0200 Subject: [PATCH] Improve External Wiki in Repo Header (#24304) If you use a External Wiki, with Gitea, it brings currently 2 Problems in the Header: 1. It always uses the Wiki Icon. When you use e.g. a External Issue Tracker, it shows the External Link icon to Indicate, that the User will send to a External Side. This helps preventing fishing. 2. If you use a External Wiki, the Link in the Header still goes to `{repo}/wiki` which will redirect the user to the External Wiki. That means, that if the users hovers with the Cursor over the link, it shows `{repo}/wiki`, so the User does not know, where he will land. This PR fixes both. ![grafik](https://user-images.githubusercontent.com/15185051/233964455-dbca9bbe-a224-44c5-b351-5649fd9b15fc.png) --- templates/repo/header.tmpl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 5f2e135b98699..8a6833f499316 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -215,12 +215,18 @@ {{end}} - {{if or (.Permission.CanRead $.UnitTypeWiki) (.Permission.CanRead $.UnitTypeExternalWiki)}} - + {{if .Permission.CanRead $.UnitTypeWiki}} + {{svg "octicon-book"}} {{.locale.Tr "repo.wiki"}} {{end}} + {{if .Permission.CanRead $.UnitTypeExternalWiki}} + + {{svg "octicon-link-external"}} {{.locale.Tr "repo.wiki"}} + + {{end}} + {{if and (.Permission.CanReadAny $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases) (not .IsEmptyRepo)}} {{svg "octicon-pulse"}} {{.locale.Tr "repo.activity"}}