|
24 | 24 | {{end}}
|
25 | 25 | </td>
|
26 | 26 | <td class="right aligned overflow-visible">
|
| 27 | + {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} |
| 28 | + <div class="ui basic jump button icon poping up show-create-branch-modal" data-content="{{$.i18n.Tr "repo.branch.new_branch_from" ($.DefaultBranch)}}" data-variation="tiny inverted" data-branch-from="{{EscapePound $.DefaultBranch}}" data-modal="#create-branch-modal" data-position="top right"> |
| 29 | + {{svg "octicon-git-branch"}} |
| 30 | + </div> |
| 31 | + {{end}} |
27 | 32 | <div class="ui basic jump dropdown icon button poping up" data-content="{{$.i18n.Tr "repo.branch.download" ($.DefaultBranch)}}" data-variation="tiny inverted" data-position="top right">
|
28 | 33 | {{svg "octicon-download"}}
|
29 | 34 | <div class="menu">
|
|
102 | 107 | {{end}}
|
103 | 108 | </td>
|
104 | 109 | <td class="two wide right aligned overflow-visible">
|
| 110 | + {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} |
| 111 | + <div class="ui basic jump button icon poping up show-create-branch-modal" data-branch-from="{{EscapePound .Name}}" data-content="{{$.i18n.Tr "repo.branch.new_branch_from" .Name}}" data-variation="tiny inverted" data-position="top right" data-modal="#create-branch-modal" data-name="{{.Name}}"> |
| 112 | + {{svg "octicon-git-branch"}} |
| 113 | + </div> |
| 114 | + {{end}} |
105 | 115 | {{if (not .IsDeleted)}}
|
106 | 116 | <div class="ui basic jump dropdown icon button poping up" data-content="{{$.i18n.Tr "repo.branch.download" (.Name)}}" data-variation="tiny inverted" data-position="top right">
|
107 | 117 | {{svg "octicon-download"}}
|
|
142 | 152 | </div>
|
143 | 153 | {{template "base/delete_modal_actions" .}}
|
144 | 154 | </div>
|
| 155 | + |
| 156 | +<div class="ui small modal" id="create-branch-modal"> |
| 157 | + <div class="header"> |
| 158 | + {{.i18n.Tr "repo.branch.new_branch"}} |
| 159 | + </div> |
| 160 | + <div class="content"> |
| 161 | + <form class="ui form" id="create-branch-form" action="" data-base-action="{{.Link}}/_new/branch/" method="post"> |
| 162 | + {{.CsrfTokenHtml}} |
| 163 | + <div class="field"> |
| 164 | + <label> |
| 165 | + {{.i18n.Tr "repo.branch.create_new_branch"}} |
| 166 | + <span class="text" id="modal-create-branch-from-span"></span> |
| 167 | + </label> |
| 168 | + </div> |
| 169 | + <div class="required field"> |
| 170 | + <label for="new_branch_name">{{.i18n.Tr "repo.branch.name"}}</label> |
| 171 | + <input id="new_branch_name" name="new_branch_name" required> |
| 172 | + </div> |
| 173 | + |
| 174 | + <div class="text right actions"> |
| 175 | + <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div> |
| 176 | + <button class="ui green button">{{.i18n.Tr "repo.branch.confirm_create_branch"}}</button> |
| 177 | + </div> |
| 178 | + </form> |
| 179 | + </div> |
| 180 | +</div> |
145 | 181 | {{template "base/footer" .}}
|
0 commit comments