From 0c1dc783ad71f881ccc198802a4c4e945c86f4ad Mon Sep 17 00:00:00 2001
From: Vangelis <macvag@gmail.com>
Date: Fri, 4 Dec 2020 21:13:16 +0200
Subject: [PATCH] Added copy commit SHA1 button in commits list Fixes #13816

Signed-off-by: Vangelis <macvag@gmail.com>
---
 options/locale/locale_en-US.ini  | 3 +++
 templates/repo/commits_list.tmpl | 1 +
 2 files changed, 4 insertions(+)

diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index 1500bf73e9084..938151a9561ae 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -898,6 +898,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 = 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
diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl
index e7489bf51d244..5224c847c71de 100644
--- a/templates/repo/commits_list.tmpl
+++ b/templates/repo/commits_list.tmpl
@@ -56,6 +56,7 @@
 							{{else}}
 								</span>
 							{{end}}
+							<span style="cursor: pointer;vertical-align: middle;" class="clipboard" data-original="{{$.i18n.Tr "repo.commits.copy_sha"}}" 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"}}" data-variation="inverted tiny" data-clipboard-text="{{.ID}}">{{svg "octicon-clippy"}}</span>
 						</td>
 						<td class="message">
 							<span class="message-wrapper">