forked from forgejo/forgejo
[FEAT] Show follow symlink button
- When a user goes opens a symlink file in Forgejo, the file would be rendered with the path of the symlink as content. - Add a button that is shown when the user opens a *valid* symlink file, which means that the symlink must have an valid path to an existent file and after 999 follows isn't a symlink anymore. - Return the relative path from the `FollowLink` functions, because Git really doesn't want to tell where an file is located based on the blob ID. - Adds integration tests.
This commit is contained in:
parent
0bba571f5b
commit
c63b52c126
6 changed files with 84 additions and 18 deletions
|
@ -43,6 +43,9 @@
|
|||
{{end}}
|
||||
{{if not .ReadmeInList}}
|
||||
<div class="ui buttons gt-mr-2">
|
||||
{{if .SymlinkURL}}
|
||||
<a class="ui mini basic button" href="{{$.SymlinkURL}}" data-kind="follow-symlink">{{ctx.Locale.Tr "repo.file_follow"}}</a>
|
||||
{{end}}
|
||||
<a class="ui mini basic button" href="{{$.RawFileLink}}">{{ctx.Locale.Tr "repo.file_raw"}}</a>
|
||||
{{if not .IsViewCommit}}
|
||||
<a class="ui mini basic button" href="{{.RepoLink}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.file_permalink"}}</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue