From aef0b024b7275cb706a05d1822652f527f617ffc Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 27 Feb 2024 19:08:16 +0100 Subject: [PATCH] Fix the Fork button in repo headers In #2445, I lifted out the fork button into its own template, but did not update it properly. This resulted in the fork button's counter not displaying, and pointing to the wrong place too. This patch updates the template to account for it moving to a separate file, and also adds test cases to verify the button is display as it should be. Fixes #2494. Signed-off-by: Gergely Nagy --- templates/repo/header_fork.tmpl | 2 ++ tests/integration/repo_fork_test.go | 39 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/templates/repo/header_fork.tmpl b/templates/repo/header_fork.tmpl index 5bce9e0f14..e248a77850 100644 --- a/templates/repo/header_fork.tmpl +++ b/templates/repo/header_fork.tmpl @@ -1,3 +1,4 @@ +{{with .Repository}} {{if and (not .IsEmpty) ($.Permission.CanRead $.UnitTypeCode)}}