1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-09-15 18:56:59 +00:00

template: repo: compare: display a warning if the user is not logged in

Signed-off-by: Litchi Pi <litchi.pi@proton.me>
(cherry picked from commit dd4a1107ed)
This commit is contained in:
Litchi Pi 2024-12-16 13:44:25 +01:00 committed by forgejo-backport-action
parent 424f85304e
commit 5a0c79e6b4
4 changed files with 46 additions and 0 deletions

View file

@ -51,6 +51,7 @@ const (
func setCompareContext(ctx *context.Context, before, head *git.Commit, headOwner, headName string) {
ctx.Data["BeforeCommit"] = before
ctx.Data["HeadCommit"] = head
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login?redirect_to=" + url.QueryEscape(ctx.Data["Link"].(string))
ctx.Data["GetBlobByPathForCommit"] = func(commit *git.Commit, path string) *git.Blob {
if commit == nil {