|
116 | 116 | <div class="repo-button-row-right"> |
117 | 117 | <!-- Only show clone panel in repository home page --> |
118 | 118 | {{if $isHomepage}} |
119 | | - <div class="clone-panel ui action tiny input"> |
120 | | - {{template "repo/clone_buttons" .}} |
121 | | - <button class="ui small jump dropdown icon button" data-tooltip-content="{{ctx.Locale.Tr "repo.more_operations"}}"> |
122 | | - {{svg "octicon-kebab-horizontal"}} |
123 | | - <div class="menu"> |
124 | | - {{if not $.DisableDownloadSourceArchives}} |
125 | | - <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.download_zip"}}</a> |
126 | | - <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.download_tar"}}</a> |
127 | | - <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.bundle" rel="nofollow">{{svg "octicon-package" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.download_bundle"}}</a> |
128 | | - {{end}} |
129 | | - {{if .CitiationExist}} |
130 | | - <a class="item" id="cite-repo-button">{{svg "octicon-cross-reference" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.cite_this_repo"}}</a> |
| 119 | + <div class="clone-panel ui action tiny input"> |
| 120 | + <button class="ui basic small compact jump dropdown icon button primary" data-tooltip-content="{{ctx.Locale.Tr "repo.more_operations"}}"> |
| 121 | + <!-- {{svg "octicon-kebab-horizontal"}} --> |
| 122 | + <div> |
| 123 | + {{svg "octicon-code" 16}} |
| 124 | + <span>Code</span> |
| 125 | + {{svg "octicon-chevron-down"}} |
| 126 | + </div> |
| 127 | + <div class="menu gt-mt-3 clone-panel-content"> |
| 128 | + <div class="ui input"> |
| 129 | + {{svg "octicon-terminal" 16}} |
| 130 | + <strong id="clone-heading" class="gt-ml-3">Clone</strong> |
| 131 | + </div> |
| 132 | + <div class="ui input gt-mb-0"> |
| 133 | + <!-- there is always at least one button (by context/repo.go) --> |
| 134 | + {{if $.CloneButtonShowHTTPS}} |
| 135 | + <div class="ui clone tabs" id="repo-clone-https" data-link="{{$.CloneButtonOriginLink.HTTPS}}" data-description="{{ctx.Locale.Tr "repo.clone_https_description"}}"> |
| 136 | + HTTPS |
| 137 | + </div> |
131 | 138 | {{end}} |
132 | | - {{range .OpenWithEditorApps}} |
133 | | - <a class="item js-clone-url-editor" data-href-template="{{.OpenURL}}">{{.IconHTML}}{{ctx.Locale.Tr "repo.open_with_editor" .DisplayName}}</a> |
| 139 | + {{if $.CloneButtonShowSSH}} |
| 140 | + <div class="ui clone tabs" id="repo-clone-ssh" data-link="{{$.CloneButtonOriginLink.SSH}}" data-description="{{ctx.Locale.Tr "repo.clone_ssh_description"}}"> |
| 141 | + SSH |
| 142 | + </div> |
134 | 143 | {{end}} |
135 | 144 | </div> |
136 | | - </button> |
137 | | - {{template "repo/clone_script" .}}{{/* the script will update `.js-clone-url` and related elements */}} |
138 | | - </div> |
| 145 | + <div class="ui input tiny action gt-mt-4 gt-mb-0"> |
| 146 | + <input id="repo-clone-url" size="30" class="js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}" readonly> |
| 147 | + <div class="ui basic small compact icon button tooltip" id="clipboard-btn" data-tooltip-content="{{ctx.Locale.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{ctx.Locale.Tr "copy_url"}}"> |
| 148 | + {{svg "octicon-copy" 14}} |
| 149 | + </div> |
| 150 | + </div> |
| 151 | + <div id="repo-clone-method-description" class="ui input text tiny grey gt-mt-3"></div> |
| 152 | + {{range .OpenWithEditorApps}} |
| 153 | + <a class="item js-clone-url-editor" data-href-template="{{.OpenURL}}">{{.IconHTML}}{{ctx.Locale.Tr "repo.open_with_editor" .DisplayName}}</a> |
| 154 | + {{end}} |
| 155 | + {{if not $.DisableDownloadSourceArchives}} |
| 156 | + <div class="ui divider"></div> |
| 157 | + <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.download_zip"}}</a> |
| 158 | + <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.download_tar"}}</a> |
| 159 | + <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.bundle" rel="nofollow">{{svg "octicon-package" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.download_bundle"}}</a> |
| 160 | + {{end}} |
| 161 | + {{if .CitiationExist}} |
| 162 | + <div class="ui divider"></div> |
| 163 | + <a class="item" id="cite-repo-button">{{svg "octicon-cross-reference" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.cite_this_repo"}}</a> |
| 164 | + {{end}} |
| 165 | + </div> |
| 166 | + </button> |
| 167 | + {{template "repo/clone_script" .}}{{/* the script will update `.js-clone-url` and related elements */}} |
| 168 | + </div> |
139 | 169 | {{template "repo/cite/cite_modal" .}} |
140 | 170 | {{end}} |
141 | 171 | {{if and (not $isHomepage) (not .IsViewFile) (not .IsBlame)}}{{/* IsViewDirectory (not home), TODO: split the templates, avoid using "if" tricks */}} |
|
0 commit comments