You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

upload.tmpl 4.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. {{template "base/head" .}}
  2. <div class="repository file upload">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. {{.branchName}}
  6. {{template "base/alert" .}}
  7. <form class="ui comment form" action="{{EscapePound $.Link}}" method="post">
  8. {{.CsrfTokenHtml}}
  9. <div class="ui secondary menu">
  10. <div class="item fitted" style="width:100%;">
  11. <div class="ui breadcrumb field{{if .Err_Directory}} error{{end}}">
  12. <a class="section" href="{{EscapePound $.BranchLink}}">{{.Repository.Name}}</a>
  13. {{ $n := len .TreeNames}}
  14. {{ $l := Subtract $n 1}}
  15. {{range $i, $v := .TreeNames}}
  16. <div class="divider"> / </div>
  17. {{if eq $i $l}}
  18. <input type="text" id="file-name" value="{{$v}}" placeholder="{{$.i18n.Tr "repo.add_subdir"}}">
  19. {{else}}
  20. <span class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $v}}">{{$v}}</a></span>
  21. {{end}}
  22. {{end}}
  23. <button class="clipboard-tree-name icon octicon octicon-clippy poping up" type="button" data-content="{{.i18n.Tr "repo.copy_file_path_to_clipboard"}}" data-position="bottom center" data-variation="tiny inverted"></button>
  24. <span class="repo-edit-file-cancel">{{.i18n.Tr "repo.or"}} <a href="{{EscapePound $.BranchLink}}/{{EscapePound $.TreeName}}">{{.i18n.Tr "repo.cancel_lower"}}</a></span>
  25. <input type="hidden" id="tree-name" name="tree_name" value="{{.TreeName}}">
  26. </div>
  27. </div>
  28. </div>
  29. <div class="field ui upload">
  30. <div class="files"></div>
  31. <div class="ui basic button dropzone" id="dropzone" data-upload-url="{{.RepoLink}}/upload-file" data-remove-url="{{.RepoLink}}/upload-remove" data-csrf="{{.CsrfToken}}" data-accepts="{{.UploadAllowedTypes}}" data-max-file="{{.UploadMaxFiles}}" data-max-size="{{.UploadMaxSize}}" data-default-message="{{.i18n.Tr "dropzone.default_message"}}" data-invalid-input-type="{{.i18n.Tr "dropzone.invalid_input_type"}}" data-file-too-big="{{.i18n.Tr "dropzone.file_too_big"}}" data-remove-file="{{.i18n.Tr "dropzone.remove_file"}}"></div>
  32. </div>
  33. <div class="commit-form-wrapper">
  34. <img width="48" height="48" class="ui rounded image commit-form-avatar" src="{{.SignedUser.AvatarLink}}">
  35. <div class="commit-form">
  36. <h3>{{.i18n.Tr "repo.commit_changes"}}</h3>
  37. <div class="field">
  38. <input name="commit_summary" placeholder="{{.i18n.Tr "repo.add_files_to_dir" .TreeName}}" value="{{.CommitSummary}}">
  39. </div>
  40. <div class="field">
  41. <textarea name="commit_message" placeholder="{{.i18n.Tr "repo.default_commit_message"}}">{{.CommitMessage}}</textarea>
  42. </div>
  43. <div class="quick-pull-choice js-quick-pull-choice ">
  44. <dl class="form-group">
  45. <dd>
  46. <div class="form-checkbox">
  47. <label>
  48. <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct"{{if eq .CommitChoice "direct"}} checked="checked"{{end}}>
  49. <i class="octicon octicon-git-commit" height="16" width="14"></i>
  50. {{.CommitDirectlyToThisBranch | Safe}}
  51. </label>
  52. </div>
  53. <div class="form-checkbox">
  54. <label>
  55. <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch"{{if eq .CommitChoice "commit-to-new-branch"}} checked="checked"{{end}}>
  56. <i class="octicon octicon-git-pull-request" height="16" width="12"></i>
  57. {{.CreateNewBranch | Safe}}
  58. </label>
  59. </div>
  60. </dd>
  61. </dl>
  62. <div class="quick-pull-branch-name">
  63. <div class="new-branch-name-input{{if .Err_Branchname}} error{{end}}">
  64. <i class="octicon octicon-git-branch quick-pull-new-branch-icon" height="16" width="10"></i>
  65. <input type="text" name="new_branch_name" value="{{.NewBranchName}}" class="form-control input-contrast mr-2 js-quick-pull-new-branch-name" placeholder="New branch name…">
  66. <span class="text-muted js-quick-pull-normalization-info"></span>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. <button type="submit" class="ui green button">
  72. {{.i18n.Tr "repo.commit_changes"}}
  73. </button>
  74. <a class="ui button red" href="{{EscapePound $.BranchLink}}/{{EscapePound $.TreeName}}">{{.i18n.Tr "repo.cancel"}}</a>
  75. </div>
  76. </form>
  77. </div>
  78. </div>
  79. {{template "base/footer" .}}