fix(ui): open raw file links in new tab (#581) #600
@@ -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}}
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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,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>
|
||||
|
||||
Reference in New Issue
Block a user