From 2527e09125a653e93ee95ac69049bd5ebd249bdc Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 14 Jan 2024 13:37:16 +0100 Subject: [PATCH] [GITEA] Include a branch link in the recently pushed banner The message telling us that we recently pushed on a branch should include a link to said branch, not just a "New pull request" button. Signed-off-by: Gergely Nagy (cherry picked from commit d9662d03a407aaa69166d87fdc6e125417e292c1) --- options/locale/locale_en-US.ini | 2 +- templates/repo/code/recently_pushed_new_branches.tmpl | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index c88e85dec6..4d99c2e583 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1846,7 +1846,7 @@ pulls.auto_merge_canceled_schedule_comment = `canceled auto merging this pull re pulls.delete.title = Delete this pull request? pulls.delete.text = Do you really want to delete this pull request? (This will permanently remove all content. Consider closing it instead, if you intend to keep it archived) -pulls.recently_pushed_new_branches = You pushed on branch %[1]s %[2]s +pulls.recently_pushed_new_branches = You pushed on branch %[1]s %[2]s pull.deleted_branch = (deleted):%s diff --git a/templates/repo/code/recently_pushed_new_branches.tmpl b/templates/repo/code/recently_pushed_new_branches.tmpl index 8910a9e5b6..2b9948d214 100644 --- a/templates/repo/code/recently_pushed_new_branches.tmpl +++ b/templates/repo/code/recently_pushed_new_branches.tmpl @@ -2,7 +2,8 @@
{{$timeSince := TimeSince .CommitTime.AsTime ctx.Locale}} - {{ctx.Locale.Tr "repo.pulls.recently_pushed_new_branches" (Escape .Name) $timeSince | Safe}} + {{$branchLink := (print $.RepoLink "/src/branch/" (PathEscapeSegments .Name))}} + {{ctx.Locale.Tr "repo.pulls.recently_pushed_new_branches" (Escape .Name) $timeSince $branchLink | Safe}}
{{ctx.Locale.Tr "repo.pulls.compare_changes"}}