From d784a0f25d81ac8b8a3752d3feb07982f0a84b44 Mon Sep 17 00:00:00 2001 From: badhezi Date: Wed, 14 May 2025 14:53:38 +0300 Subject: [PATCH] add download links to raw diff and patch in diff box options dropdown --- routers/web/repo/compare.go | 1 + templates/repo/diff/options_dropdown.tmpl | 3 +++ 2 files changed, 4 insertions(+) diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index 989691a572..a206f8deb6 100644 --- a/routers/web/repo/compare.go +++ b/routers/web/repo/compare.go @@ -750,6 +750,7 @@ func CompareDiff(ctx *context.Context) { return } + ctx.Data["PageIsCompareDiff"] = true ctx.Data["PullRequestWorkInProgressPrefixes"] = setting.Repository.PullRequest.WorkInProgressPrefixes ctx.Data["DirectComparison"] = ci.DirectComparison ctx.Data["OtherCompareSeparator"] = ".." diff --git a/templates/repo/diff/options_dropdown.tmpl b/templates/repo/diff/options_dropdown.tmpl index 8d08e7ad46..a8a6c2ac10 100644 --- a/templates/repo/diff/options_dropdown.tmpl +++ b/templates/repo/diff/options_dropdown.tmpl @@ -10,6 +10,9 @@ {{else if .Commit.ID.String}} {{ctx.Locale.Tr "repo.diff.download_patch"}} {{ctx.Locale.Tr "repo.diff.download_diff"}} + {{else if $.PageIsCompareDiff }} + {{ctx.Locale.Tr "repo.diff.download_patch"}} + {{ctx.Locale.Tr "repo.diff.download_diff"}} {{end}} {{ctx.Locale.Tr "repo.pulls.expand_files"}} {{ctx.Locale.Tr "repo.pulls.collapse_files"}}