diff options
author | Jakub Stasiak <jakub@stasiak.at> | 2015-05-14 00:14:24 +0200 |
---|---|---|
committer | Jakub Stasiak <jakub@stasiak.at> | 2015-07-13 21:52:48 +0200 |
commit | 562ad02a6da7323b3ec5e2b0259ee1f17935d5f6 (patch) | |
tree | 595ed1ee8902acbefa65098f9aec66c3827931dc /templates/repo | |
parent | ced212f8fa6e4761bca0c635240e8147ae427435 (diff) | |
download | gitea-562ad02a6da7323b3ec5e2b0259ee1f17935d5f6.tar.gz gitea-562ad02a6da7323b3ec5e2b0259ee1f17935d5f6.zip |
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.
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/view_file.tmpl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index d33cc95023..4d11170bd0 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -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> |