]> source.dussan.org Git - gitea.git/commitdiff
Add copy Commit ID button in commits list (#17759)
authorvelengel <kounakadora528@gmail.com>
Tue, 23 Nov 2021 02:44:10 +0000 (11:44 +0900)
committerGitHub <noreply@github.com>
Tue, 23 Nov 2021 02:44:10 +0000 (21:44 -0500)
* fix: implement commit id copy to clipboard

* fix: remove abundant attributes / consider edge-case

* fix: locale_en fixed

* fix: use ui button

* tune copy button

* fix: button size

* Fix merge

Co-authored-by: Ysmr-Ry <ryo.yossy@live.jp>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
templates/repo/commits_list.tmpl
web_src/less/_base.less
web_src/less/_repository.less

index 3a98a3afb23bd6f00a4a3a99e0f4950bdfa073cf..e270a9997294241bf1d6dad18c42de1010060df0 100644 (file)
@@ -23,7 +23,8 @@
                                                                {{$userName}}
                                                        {{end}}
                                                </td>
-                                               <td class="sha">
+                                               <td class="sha df">
+                                                       <button class="ui button copy-commit-sha df ac" data-clipboard-text="{{.ID}}">{{svg "octicon-copy" 14}}</button>
                                                        {{$class := "ui sha label"}}
                                                        {{if .Signature}}
                                                                {{$class = (printf "%s%s" $class " isSigned")}}
index c09f3a2bdd8ac31b322d09695f1e9971d607180e..1477c1af49b1397ef3b2bf6c3ebd5c398dbc6d81 100644 (file)
@@ -985,6 +985,13 @@ a.ui.card:hover,
     margin: 0 6px;
   }
 
+  .button.copy-commit-sha {
+    border: 1px solid var(--color-light-border);
+    margin-right: 3px;
+    padding: 6px 6px 4px;
+    background: var(--color-light);
+  }
+
   .button.truncate {
     display: inline-block;
     max-width: 100%;
index 85607881dc8ede3c9c616c2b7c8b4f386315f6e6..e0f8b98fa2a7e8440bc5d10e6afc2102c0562a6d 100644 (file)
           text-align: center;
         }
 
-        width: 175px;
+        width: 200px;
       }
     }