|
27 | 27 | </td> |
28 | 28 | <td class="right aligned overflow-visible"> |
29 | 29 | {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} |
30 | | - <button class="ui basic jump button icon show-create-branch-modal" data-tooltip-content="{{$.locale.Tr "repo.branch.new_branch_from" ($.DefaultBranch)}}" data-branch-from="{{$.DefaultBranch}}" data-branch-from-urlcomponent="{{PathEscapeSegments $.DefaultBranch}}" data-modal="#create-branch-modal"> |
| 30 | + <button class="ui tertiary button show-create-branch-modal gt-mx-3" |
| 31 | + data-modal="#create-branch-modal" |
| 32 | + data-branch-from="{{$.DefaultBranch}}" |
| 33 | + data-branch-from-urlcomponent="{{PathEscapeSegments $.DefaultBranch}}" |
| 34 | + data-tooltip-content="{{$.locale.Tr "repo.branch.new_branch_from" ($.DefaultBranch)}}" |
| 35 | + > |
31 | 36 | {{svg "octicon-git-branch"}} |
32 | 37 | </button> |
33 | 38 | {{end}} |
34 | 39 | {{if .EnableFeed}} |
35 | | - <a role="button" class="ui basic button icon" href="{{$.FeedURL}}/rss/branch/{{PathEscapeSegments .DefaultBranch}}"> |
| 40 | + <a role="button" class="ui tertiary button gt-mx-3" href="{{$.FeedURL}}/rss/branch/{{PathEscapeSegments .DefaultBranch}}"> |
36 | 41 | {{svg "octicon-rss"}} |
37 | 42 | </a> |
38 | 43 | {{end}} |
39 | 44 | {{if not $.DisableDownloadSourceArchives}} |
40 | | - <button class="ui basic jump dropdown icon button" data-tooltip-content="{{$.locale.Tr "repo.branch.download" ($.DefaultBranch)}}"> |
| 45 | + <div class="ui dropdown tertiary button gt-mx-3" data-tooltip-content="{{$.locale.Tr "repo.branch.download" ($.DefaultBranch)}}"> |
41 | 46 | {{svg "octicon-download"}} |
42 | 47 | <div class="menu"> |
43 | 48 | <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.DefaultBranch}}.zip" rel="nofollow">{{svg "octicon-file-zip"}} ZIP</a> |
44 | 49 | <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.DefaultBranch}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}} TAR.GZ</a> |
45 | 50 | </div> |
| 51 | + </div> |
| 52 | + {{end}} |
| 53 | + {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted) (not $.IsMirror)}} |
| 54 | + <button class="ui tertiary button show-modal show-rename-branch-modal gt-mx-3" |
| 55 | + data-modal="#rename-branch-modal" |
| 56 | + data-old-branch-name="{{$.DefaultBranch}}" |
| 57 | + data-tooltip-content="{{$.locale.Tr "repo.branch.rename" ($.DefaultBranch)}}" |
| 58 | + > |
| 59 | + {{svg "octicon-pencil"}} |
46 | 60 | </button> |
47 | 61 | {{end}} |
48 | 62 | </td> |
|
119 | 133 | </td> |
120 | 134 | <td class="three wide right aligned overflow-visible"> |
121 | 135 | {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} |
122 | | - <button class="ui basic jump button icon show-create-branch-modal" data-branch-from="{{.Name}}" data-branch-from-urlcomponent="{{PathEscapeSegments .Name}}" data-tooltip-content="{{$.locale.Tr "repo.branch.new_branch_from" .Name}}" data-modal="#create-branch-modal" data-name="{{.Name}}"> |
| 136 | + <button class="ui tertiary button show-modal show-create-branch-modal gt-mx-3" |
| 137 | + data-branch-from="{{.Name}}" |
| 138 | + data-branch-from-urlcomponent="{{PathEscapeSegments .Name}}" |
| 139 | + data-tooltip-content="{{$.locale.Tr "repo.branch.new_branch_from" .Name}}" |
| 140 | + data-modal="#create-branch-modal" data-name="{{.Name}}" |
| 141 | + > |
123 | 142 | {{svg "octicon-git-branch"}} |
124 | 143 | </button> |
125 | 144 | {{end}} |
126 | 145 | {{if $.EnableFeed}} |
127 | | - <a role="button" class="ui basic button icon" href="{{$.FeedURL}}/rss/branch/{{PathEscapeSegments .Name}}"> |
| 146 | + <a role="button" class="ui tertiary button gt-mx-3" href="{{$.FeedURL}}/rss/branch/{{PathEscapeSegments .Name}}"> |
128 | 147 | {{svg "octicon-rss"}} |
129 | 148 | </a> |
130 | 149 | {{end}} |
131 | 150 | {{if and (not .IsDeleted) (not $.DisableDownloadSourceArchives)}} |
132 | | - <button class="ui basic jump dropdown icon button" data-tooltip-content="{{$.locale.Tr "repo.branch.download" (.Name)}}"> |
| 151 | + <div class="ui dropdown tertiary button gt-mx-3" data-tooltip-content="{{$.locale.Tr "repo.branch.download" (.Name)}}"> |
133 | 152 | {{svg "octicon-download"}} |
134 | 153 | <div class="menu"> |
135 | 154 | <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .Name}}.zip" rel="nofollow">{{svg "octicon-file-zip"}} ZIP</a> |
136 | 155 | <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .Name}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}} TAR.GZ</a> |
137 | 156 | </div> |
| 157 | + </div> |
| 158 | + {{end}} |
| 159 | + {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted) (not $.IsMirror)}} |
| 160 | + <button class="ui tertiary button show-modal show-rename-branch-modal gt-mx-3" |
| 161 | + data-old-branch-name="{{.Name}}" |
| 162 | + data-modal="#rename-branch-modal" |
| 163 | + data-tooltip-content="{{$.locale.Tr "repo.branch.rename" (.Name)}}" |
| 164 | + > |
| 165 | + {{svg "octicon-pencil"}} |
138 | 166 | </button> |
139 | 167 | {{end}} |
140 | 168 | {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}} |
141 | 169 | {{if .IsDeleted}} |
142 | | - <button class="ui basic jump button icon undo-button" data-url="{{$.Link}}/restore?branch_id={{.DeletedBranch.ID}}&name={{.DeletedBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{$.locale.Tr "repo.branch.restore" (.Name)}}"> |
| 170 | + <button class="ui tertiary button undo-button gt-mx-3" data-url="{{$.Link}}/restore?branch_id={{.DeletedBranch.ID}}&name={{.DeletedBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{$.locale.Tr "repo.branch.restore" (.Name)}}"> |
143 | 171 | <span class="text blue"> |
144 | 172 | {{svg "octicon-reply"}} |
145 | 173 | </span> |
146 | 174 | </button> |
147 | 175 | {{else}} |
148 | | - <button class="ui basic jump button icon delete-button delete-branch-button" data-url="{{$.Link}}/delete?name={{.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{$.locale.Tr "repo.branch.delete" (.Name)}}" data-name="{{.Name}}"> |
| 176 | + <button class="ui tertiary button delete-button delete-branch-button gt-mx-3" data-url="{{$.Link}}/delete?name={{.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{$.locale.Tr "repo.branch.delete" (.Name)}}" data-name="{{.Name}}"> |
149 | 177 | {{svg "octicon-trash"}} |
150 | 178 | </button> |
151 | 179 | {{end}} |
|
173 | 201 | {{template "base/modal_actions_confirm" .}} |
174 | 202 | </div> |
175 | 203 |
|
176 | | -<div class="ui small modal" id="create-branch-modal"> |
| 204 | +<div class="ui mini modal" id="create-branch-modal"> |
177 | 205 | <div class="header"> |
178 | 206 | {{.locale.Tr "repo.branch.new_branch"}} |
179 | 207 | </div> |
180 | | - <div class="content"> |
181 | | - <form class="ui form" id="create-branch-form" action="" data-base-action="{{.Link}}/_new/branch/" method="post"> |
| 208 | + |
| 209 | + <form class="ui form" id="create-branch-form" action="" data-base-action="{{.Link}}/_new/branch/" method="post"> |
| 210 | + <div class="content"> |
182 | 211 | {{.CsrfTokenHtml}} |
183 | 212 | <div class="field"> |
184 | | - <label> |
185 | | - {{.locale.Tr "repo.branch.create_new_branch"}} |
186 | | - <span class="text" id="modal-create-branch-from-span"></span> |
187 | | - </label> |
| 213 | + {{.locale.Tr "repo.branch.create_new_branch"}} |
| 214 | + <span id="modal-create-branch-from-span"></span> |
188 | 215 | </div> |
189 | 216 | <div class="required field"> |
190 | 217 | <label for="new_branch_name">{{.locale.Tr "repo.branch.name"}}</label> |
191 | 218 | <input id="new_branch_name" name="new_branch_name" required> |
192 | 219 | </div> |
| 220 | + </div> |
| 221 | + {{template "base/modal_actions_confirm" (dict "locale" $.locale "ModalButtonTypes" "confirm")}} |
| 222 | + </form> |
| 223 | +</div> |
193 | 224 |
|
194 | | - <div class="text right actions"> |
195 | | - <button class="ui cancel button">{{.locale.Tr "settings.cancel"}}</button> |
196 | | - <button class="ui green button">{{.locale.Tr "repo.branch.confirm_create_branch"}}</button> |
197 | | - </div> |
198 | | - </form> |
| 225 | +<div class="ui mini modal" id="rename-branch-modal"> |
| 226 | + <div class="header"> |
| 227 | + {{.locale.Tr "repo.settings.rename_branch"}} |
199 | 228 | </div> |
| 229 | + <form class="ui form" action="{{$.Repository.Link}}/settings/rename_branch" method="post"> |
| 230 | + <div class="content"> |
| 231 | + {{.CsrfTokenHtml}} |
| 232 | + <div class="field"> |
| 233 | + <span class="text" data-rename-branch-to="{{.locale.Tr "repo.branch.rename_branch_to"}}"></span> |
| 234 | + </div> |
| 235 | + <input name="from" type="hidden" required> |
| 236 | + <div class="required field"> |
| 237 | + <input name="to" required> |
| 238 | + </div> |
| 239 | + </div> |
| 240 | + {{template "base/modal_actions_confirm" (dict "locale" $.locale "ModalButtonTypes" "confirm")}} |
| 241 | + </form> |
200 | 242 | </div> |
201 | 243 | {{template "base/footer" .}} |
0 commit comments