|
74 | 74 | <span class="btn-octicon disabled" data-tooltip-content="{{.EditFileTooltip}}">{{svg "octicon-pencil"}}</span> |
75 | 75 | {{end}} |
76 | 76 | {{if .CanDeleteFile}} |
77 | | - <a class="btn-octicon btn-octicon-danger" data-tooltip-content="{{.DeleteFileTooltip}}" href="{{.RepoLink}}/_delete/{{PathEscapeSegments .BranchName}}/{{PathEscapeSegments .TreePath}}">{{svg "octicon-trash"}}</a> |
| 77 | + <a type="button" class="btn-octicon btn-octicon-danger" data-tooltip-content="{{.DeleteFileTooltip}}" id="delete-file-button">{{svg "octicon-trash"}}</a> |
78 | 78 | {{else}} |
79 | 79 | <span class="btn-octicon disabled" data-tooltip-content="{{.DeleteFileTooltip}}">{{svg "octicon-trash"}}</span> |
80 | 80 | {{end}} |
|
148 | 148 | <a class="item copy-line-permalink" role="menuitem" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{ctx.Locale.Tr "repo.file_copy_permalink"}}</a> |
149 | 149 | </div> |
150 | 150 | </div> |
| 151 | + |
| 152 | + {{/* Delete File Modal */}} |
| 153 | + {{if .CanDeleteFile}} |
| 154 | + <div class="ui modal" id="delete-file-modal"> |
| 155 | + <i class="close icon"></i> |
| 156 | + <div class="content"> |
| 157 | + <form id="delete-file-form" class="ui form form-fetch-action" method="post" action="{{.RepoLink}}/_delete/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}"> |
| 158 | + {{.CsrfTokenHtml}} |
| 159 | + <input type="hidden" name="last_commit" value="{{.CommitID}}"> |
| 160 | + <input type="hidden" name="tree_path" value="{{.TreePath}}"> |
| 161 | + <div class="commit-form-wrapper"> |
| 162 | + {{ctx.AvatarUtils.Avatar .SignedUser 40 "commit-avatar"}} |
| 163 | + <div class="commit-form avatar-content-left-arrow"> |
| 164 | + <h3> |
| 165 | + <span>{{svg "octicon-unlock" 24}}</span> |
| 166 | + {{ctx.Locale.Tr "repo.editor.commit_changes"}} |
| 167 | + </h3> |
| 168 | + <div class="field"> |
| 169 | + <input name="commit_summary" maxlength="100" placeholder="Delete {{.TreePath}}" value="Delete {{.TreePath}}" autofocus> |
| 170 | + </div> |
| 171 | + <div class="field"> |
| 172 | + <textarea name="commit_message" placeholder="{{ctx.Locale.Tr "repo.editor.commit_message_desc"}}" rows="5"></textarea> |
| 173 | + </div> |
| 174 | + <div class="inline field"> |
| 175 | + <div class="ui checkbox"> |
| 176 | + <input name="signoff" type="checkbox"> |
| 177 | + <label>{{ctx.Locale.Tr "repo.editor.signoff_desc"}}</label> |
| 178 | + </div> |
| 179 | + </div> |
| 180 | + <div class="quick-pull-choice"> |
| 181 | + <div class="field"> |
| 182 | + <div class="ui radio checkbox"> |
| 183 | + <input type="radio" name="commit_choice" value="direct" checked> |
| 184 | + <label> |
| 185 | + {{svg "octicon-git-commit"}} |
| 186 | + {{ctx.Locale.Tr "repo.editor.commit_directly_to_this_branch" .BranchName}} |
| 187 | + </label> |
| 188 | + </div> |
| 189 | + </div> |
| 190 | + {{if not .Repository.IsEmpty}} |
| 191 | + <div class="field"> |
| 192 | + <div class="ui radio checkbox"> |
| 193 | + <input type="radio" name="commit_choice" value="commit-to-new-branch"> |
| 194 | + <label> |
| 195 | + {{svg "octicon-git-pull-request"}} |
| 196 | + {{ctx.Locale.Tr "repo.editor.create_new_branch_np"}} |
| 197 | + </label> |
| 198 | + </div> |
| 199 | + </div> |
| 200 | + <div class="quick-pull-branch-name tw-hidden"> |
| 201 | + <div class="new-branch-name-input field"> |
| 202 | + {{svg "octicon-git-branch"}} |
| 203 | + <input type="text" name="new_branch_name" maxlength="100" value="{{.new_branch_name}}" class="input-contrast tw-mr-1" placeholder="{{ctx.Locale.Tr "repo.editor.new_branch_name_desc"}}" title="{{ctx.Locale.Tr "repo.editor.new_branch_name"}}"> |
| 204 | + <span class="text-muted"></span> |
| 205 | + </div> |
| 206 | + </div> |
| 207 | + {{end}} |
| 208 | + </div> |
| 209 | + </div> |
| 210 | + </div> |
| 211 | + <div class="tw-text-right tw-mt-4"> |
| 212 | + <button type="button" class="ui button" onclick="$('#delete-file-modal').modal('hide')">{{ctx.Locale.Tr "cancel"}}</button> |
| 213 | + <button type="submit" class="ui red button"> |
| 214 | + {{svg "octicon-trash" 16}} |
| 215 | + {{ctx.Locale.Tr "repo.editor.delete_this_file"}} |
| 216 | + </button> |
| 217 | + </div> |
| 218 | + </form> |
| 219 | + </div> |
| 220 | + </div> |
| 221 | + {{end}} |
151 | 222 | </div> |
0 commit comments