diff options
author | qwerty287 <80460567+qwerty287@users.noreply.github.com> | 2021-10-02 09:46:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-02 10:46:43 +0300 |
commit | 47193dbcd97555d0c72d3219a372d9d5d01755d3 (patch) | |
tree | 6708016560731889622cd6c9fde59586f661a41d /templates/repo | |
parent | c64e2a319fcbff2dc2f5d5d62570928394c89d08 (diff) | |
download | gitea-47193dbcd97555d0c72d3219a372d9d5d01755d3.tar.gz gitea-47193dbcd97555d0c72d3219a372d9d5d01755d3.zip |
Add option to copy line permalink (#17145)
* Add option to copy line permalink
* Fix lint
* Apply review suggestions
* Update code and fix lint
* Use features/clipboard.js framework
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/view_file.tmpl | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index b6198bd0e2..8e75bcb4ca 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -112,17 +112,20 @@ {{end}} </tbody> </table> - {{if $.Permission.CanRead $.UnitTypeIssues}} - <div class="code-line-menu ui fluid popup transition hidden"> - <div class="ui column relaxed equal height"> - <div class="column"> - <div class="ui link list"> - <a class="item ref-in-new-issue" href="{{.RepoLink}}/issues/new?body={{URLJoin AppUrl .RepoLink}}/src/commit/{{.CommitID}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.issues.context.reference_issue"}}</a> - </div> + <div class="code-line-menu ui fluid popup transition hidden"> + <div class="ui column relaxed equal height"> + <div class="column"> + {{if $.Permission.CanRead $.UnitTypeIssues}} + <div class="ui link list"> + <a class="item ref-in-new-issue" href="{{.RepoLink}}/issues/new?body={{URLJoin AppUrl .RepoLink}}/src/commit/{{.CommitID}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.issues.context.reference_issue"}}</a> </div> + {{end}} + <div class="ui link list"> + <a data-clipboard-text="{{URLJoin AppUrl .RepoLink}}/src/commit/{{.CommitID}}/{{EscapePound .TreePath}}" class="item copy-line-permalink">{{.i18n.Tr "repo.file_copy_permalink"}}</a> </div> </div> - {{end}} + </div> + </div> {{end}} {{end}} </div> |