mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
Add file permalink button
The button appears when a file is viewed in a branch or a tag. It points to a URL containing the branch's (or tag's) current commit id so that it'll always point to the same content.
This commit is contained in:
parent
ced212f8fa
commit
562ad02a6d
13 changed files with 17 additions and 0 deletions
|
@ -12,6 +12,11 @@
|
|||
<strong class="file-name">{{.FileName}}</strong><span class="file-size">{{FileSize .FileSize}}</span>
|
||||
{{end}}
|
||||
{{if not .ReadmeInList}}
|
||||
{{if not .IsCommit}}
|
||||
<a class="right" href="{{.RepoLink}}/src/{{.CommitId}}/{{.TreeName}}">
|
||||
<button class="btn btn-medium btn-gray btn-right-radius btn-comb">{{.i18n.Tr "repo.file_permalink"}}</button>
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="right" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}/{{.TreeName}}">
|
||||
<button class="btn btn-medium btn-gray btn-right-radius btn-comb">{{.i18n.Tr "repo.file_history"}}</button>
|
||||
</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue