fix(ui): open raw file links in new tab (#581) #600

Merged
jmiller merged 1 commits from fix/581-raw-button-new-tab into main 2026-06-11 21:14:49 +00:00
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -17,7 +17,7 @@
</div>
<div class="file-header-right file-actions tw-flex tw-items-center tw-flex-wrap">
<div class="ui buttons">
<a class="ui tiny button" href="{{$.RawFileLink}}">{{ctx.Locale.Tr "repo.file_raw"}}</a>
<a class="ui tiny button" href="{{$.RawFileLink}}" target="_blank">{{ctx.Locale.Tr "repo.file_raw"}}</a>
{{if or .RefFullName.IsBranch .RefFullName.IsTag}}
<a class="ui tiny button" href="{{.RepoLink}}/src/commit/{{.CommitID | PathEscape}}/{{.TreePath | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.file_permalink"}}</a>
{{end}}
+1 -1
View File
@@ -31,7 +31,7 @@
<strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
</audio>
{{else}}
<a href="{{$.RawFileLink}}" rel="nofollow" class="tw-p-4">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>
<a href="{{$.RawFileLink}}" rel="nofollow" target="_blank" class="tw-p-4">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>
{{end}}
</div>
{{else if .FileSize}}
+2 -2
View File
@@ -46,7 +46,7 @@
</div>
{{if not .ReadmeInList}}
<div class="ui buttons tw-mr-1">
<a class="ui mini basic button" href="{{$.RawFileLink}}">{{ctx.Locale.Tr "repo.file_raw"}}</a>
<a class="ui mini basic button" href="{{$.RawFileLink}}" target="_blank">{{ctx.Locale.Tr "repo.file_raw"}}</a>
{{if or .RefFullName.IsBranch .RefFullName.IsTag}}
<a class="ui mini basic button" href="{{.RepoLink}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.file_permalink"}}</a>
{{end}}
@@ -132,7 +132,7 @@
{{else}}
<div class="file-view-render-container">
<div class="file-view-raw-prompt tw-p-4">
<a href="{{$.RawFileLink}}" rel="nofollow">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>
<a href="{{$.RawFileLink}}" rel="nofollow" target="_blank">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>
</div>
</div>
{{end}}
+1 -1
View File
@@ -1,4 +1,4 @@
<div class="file-not-rendered-prompt">
{{ctx.Locale.Tr "repo.file_too_large"}}
{{if .RawFileLink}}<a href="{{.RawFileLink}}" rel="nofollow">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>{{end}}
{{if .RawFileLink}}<a href="{{.RawFileLink}}" rel="nofollow" target="_blank">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>{{end}}
</div>