Skip to content

Commit

Permalink
Add copy commit SHA1 button in commits list
Browse files Browse the repository at this point in the history
  • Loading branch information
saqlainkadiri committed Oct 23, 2021
1 parent 2a9aefd commit d4e5518
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,9 @@ commits.search.tooltip = You can prefix keywords with "author:", "committer:", "
commits.find = Search
commits.search_all = All Branches
commits.author = Author
commits.copy_sha_text = Copy
commits.copy_sha_success = SHA1 has been copied
commits.copy_sha_error = Use ⌘C or Ctrl-C to copy
commits.message = Message
commits.date = Date
commits.older = Older
Expand Down
10 changes: 10 additions & 0 deletions templates/repo/commits_list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
<span class="{{$class}}">
{{end}}
<span class="shortsha">{{ShortSha .ID.String}}</span>
<span class="clipboard"
data-original="{{$.i18n.Tr "repo.commits.copy_sha_text"}}"
data-success="{{$.i18n.Tr "repo.commits.copy_sha_success"}}"
data-error="{{$.i18n.Tr "repo.commits.copy_sha_error"}}"
data-content="{{$.i18n.Tr "repo.commits.copy_sha_text"}}"
data-variation="inverted tiny"
data-clipboard-text="{{.ID}}"
>
{{svg "octicon-paste"}}
</span>
{{if .Signature}}
{{template "repo/shabox_badge" dict "root" $ "verification" .Verification}}
{{end}}
Expand Down

0 comments on commit d4e5518

Please sign in to comment.