From 998f9712462d0b6e2e1707c6000582c8fc5b9043 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 11 Jun 2026 15:30:34 -0500 Subject: [PATCH] fix(ui): open raw file links in new tab (#581) Raw and View Raw links now open in a new tab so the user stays on the file view page. Updated in view_file, blame, filetoolarge, and LFS file templates. Co-Authored-By: Moko Consulting --- templates/repo/blame.tmpl | 2 +- templates/repo/settings/lfs_file.tmpl | 2 +- templates/repo/view_file.tmpl | 4 ++-- templates/shared/filetoolarge.tmpl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl index 4ebf13b1e8..2d2a09ac0a 100644 --- a/templates/repo/blame.tmpl +++ b/templates/repo/blame.tmpl @@ -17,7 +17,7 @@
- {{ctx.Locale.Tr "repo.file_raw"}} + {{ctx.Locale.Tr "repo.file_raw"}} {{if or .RefFullName.IsBranch .RefFullName.IsTag}} {{ctx.Locale.Tr "repo.file_permalink"}} {{end}} diff --git a/templates/repo/settings/lfs_file.tmpl b/templates/repo/settings/lfs_file.tmpl index b04dc16cdf..f6774ea1c7 100644 --- a/templates/repo/settings/lfs_file.tmpl +++ b/templates/repo/settings/lfs_file.tmpl @@ -31,7 +31,7 @@ {{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}} {{else}} - {{ctx.Locale.Tr "repo.file_view_raw"}} + {{ctx.Locale.Tr "repo.file_view_raw"}} {{end}}
{{else if .FileSize}} diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index a3dc1845b7..d6871839c3 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -46,7 +46,7 @@
{{if not .ReadmeInList}}
- {{ctx.Locale.Tr "repo.file_raw"}} + {{ctx.Locale.Tr "repo.file_raw"}} {{if or .RefFullName.IsBranch .RefFullName.IsTag}} {{ctx.Locale.Tr "repo.file_permalink"}} {{end}} @@ -132,7 +132,7 @@ {{else}} {{end}} diff --git a/templates/shared/filetoolarge.tmpl b/templates/shared/filetoolarge.tmpl index cb23864ec8..079721fda7 100644 --- a/templates/shared/filetoolarge.tmpl +++ b/templates/shared/filetoolarge.tmpl @@ -1,4 +1,4 @@
{{ctx.Locale.Tr "repo.file_too_large"}} - {{if .RawFileLink}}{{ctx.Locale.Tr "repo.file_view_raw"}}{{end}} + {{if .RawFileLink}}{{ctx.Locale.Tr "repo.file_view_raw"}}{{end}}
-- 2.52.0