|
113 | 113 | </span> |
114 | 114 | {{end}} |
115 | 115 | </div> |
116 | | - <div class="repo-button-row-right"> |
117 | | - <!-- Only show clone panel in repository home page --> |
118 | | - {{if $isHomepage}} |
119 | | - <div id="clone-panel"> |
120 | | - <button class="ui tiny primary button tw-pr-1 tw-flex js-btn-clone-panel"> |
121 | | - <span>{{svg "octicon-code" 16}} Code</span> |
122 | | - {{svg "octicon-triangle-down" 14 "dropdown icon"}} |
123 | | - </button> |
124 | | - <div class="clone-panel tippy-target"> |
125 | | - <div class="ui segment"> |
126 | | - <div class="field tw-flex tw-items-center"> |
127 | | - <div class="tw-flex-1">{{svg "octicon-terminal" 16}} Clone</div> |
128 | | - <a class="muted close">{{svg "octicon-x" 16}}</a> |
129 | | - </div> |
130 | | - <div class="ui input tw-mb-0"> |
131 | | - <!-- there is always at least one button (by context/repo.go) --> |
132 | | - {{if $.CloneButtonShowHTTPS}} |
133 | | - <div class="ui clone tabs" id="repo-clone-https" data-link="{{$.CloneButtonOriginLink.HTTPS}}" data-description="{{ctx.Locale.Tr "repo.clone_https_description"}}"> |
134 | | - HTTPS |
135 | | - </div> |
136 | | - {{end}} |
137 | | - {{if $.CloneButtonShowSSH}} |
138 | | - <div class="ui clone tabs" id="repo-clone-ssh" data-link="{{$.CloneButtonOriginLink.SSH}}" data-description="{{ctx.Locale.Tr "repo.clone_ssh_description"}}"> |
139 | | - SSH |
140 | | - </div> |
141 | | - {{end}} |
142 | | - </div> |
143 | | - <div class="ui input tiny action tw-mt-4 tw-mb-0 field"> |
144 | | - <input id="repo-clone-url" size="30" class="js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}" readonly> |
145 | | - <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"}}"> |
146 | | - {{svg "octicon-copy" 14}} |
147 | | - </div> |
148 | | - </div> |
149 | | - <div class="divider"></div> |
150 | | - <div id="repo-clone-method-description" class="ui input text tiny grey tw-mt-3"></div> |
151 | | - <ul class="ui list tw-w-full"> |
152 | | - {{range .OpenWithEditorApps}} |
153 | | - <li> |
154 | | - <a class="item js-clone-url-editor" data-href-template="{{.OpenURL}}">{{.IconHTML}}{{ctx.Locale.Tr "repo.open_with_editor" .DisplayName}}</a> |
155 | | - </li> |
156 | | - {{end}} |
157 | | - </ul> |
158 | | - {{if not $.DisableDownloadSourceArchives}} |
159 | | - <div class="divider"></div> |
160 | | - <ul class="ui list tw-w-full"> |
161 | | - <li> |
162 | | - <a class="item archive-lnk" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.download_zip"}}</a> |
163 | | - </li> |
164 | | - <li> |
165 | | - <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> |
166 | | - </li> |
167 | | - <li> |
168 | | - <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> |
169 | | - </li> |
170 | | - </ul> |
171 | | - {{end}} |
172 | | - {{if .CitiationExist}} |
173 | | - <div class="divider"></div> |
174 | | - <a class="item" id="cite-repo-button">{{svg "octicon-cross-reference" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.cite_this_repo"}}</a> |
175 | | - {{end}} |
176 | | - </div> |
177 | | - </div> |
178 | | - {{template "repo/clone_script" .}}{{/* the script will update `.js-clone-url` and related elements */}} |
179 | | - {{template "repo/cite/cite_modal" .}} |
180 | | - </div> |
181 | | - {{end}} |
182 | | - |
183 | | - {{if and (not $isHomepage) (not .IsViewFile) (not .IsBlame)}}{{/* IsViewDirectory (not home), TODO: split the templates, avoid using "if" tricks */}} |
184 | | - <a class="ui button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}"> |
185 | | - {{svg "octicon-history" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.file_history"}} |
186 | | - </a> |
187 | | - {{end}} |
188 | | - </div> |
| 116 | + {{template "repo/clone_panel" .}} |
189 | 117 | </div> |
190 | 118 | {{if .IsViewFile}} |
191 | 119 | {{template "repo/view_file" .}} |
|
0 commit comments