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.

commit_form.tmpl 4.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <div class="commit-form-wrapper">
  2. {{ctx.AvatarUtils.Avatar .SignedUser 48 "commit-avatar"}}
  3. <div class="commit-form">
  4. <h3>{{- if .CanCommitToBranch.WillSign}}
  5. <span title="{{ctx.Locale.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}">{{svg "octicon-lock" 24}}</span>
  6. {{ctx.Locale.Tr "repo.editor.commit_signed_changes"}}
  7. {{- else}}
  8. <span title="{{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .CanCommitToBranch.WontSignReason)}}">{{svg "octicon-unlock" 24}}</span>
  9. {{ctx.Locale.Tr "repo.editor.commit_changes"}}
  10. {{- end}}</h3>
  11. <div class="field">
  12. <input name="commit_summary" maxlength="100" placeholder="{{if .PageIsDelete}}{{ctx.Locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{ctx.Locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.add_tmpl"}}{{else if .PageIsPatch}}{{ctx.Locale.Tr "repo.editor.patch"}}{{else}}{{ctx.Locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus>
  13. </div>
  14. <div class="field">
  15. <textarea name="commit_message" placeholder="{{ctx.Locale.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea>
  16. </div>
  17. <div class="inline field">
  18. <div class="ui checkbox">
  19. <input name="signoff" type="checkbox">
  20. <label>{{ctx.Locale.Tr "repo.editor.signoff_desc"}}</label>
  21. </div>
  22. </div>
  23. <div class="quick-pull-choice js-quick-pull-choice">
  24. <div class="field">
  25. <div class="ui radio checkbox {{if not .CanCommitToBranch.CanCommitToBranch}}disabled{{end}}">
  26. <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" button_text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}>
  27. <label>
  28. {{svg "octicon-git-commit"}}
  29. {{ctx.Locale.Tr "repo.editor.commit_directly_to_this_branch" (.BranchName|Escape) | Safe}}
  30. {{if not .CanCommitToBranch.CanCommitToBranch}}
  31. <div class="ui visible small warning message">
  32. {{ctx.Locale.Tr "repo.editor.no_commit_to_branch"}}
  33. <ul>
  34. {{if not .CanCommitToBranch.UserCanPush}}<li>{{ctx.Locale.Tr "repo.editor.user_no_push_to_branch"}}</li>{{end}}
  35. {{if and .CanCommitToBranch.RequireSigned (not .CanCommitToBranch.WillSign)}}<li>{{ctx.Locale.Tr "repo.editor.require_signed_commit"}}</li>{{end}}
  36. </ul>
  37. </div>
  38. {{end}}
  39. </label>
  40. </div>
  41. </div>
  42. {{if not .Repository.IsEmpty}}
  43. <div class="field">
  44. <div class="ui radio checkbox">
  45. {{if .CanCreatePullRequest}}
  46. <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{ctx.Locale.Tr "repo.editor.propose_file_change"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
  47. {{else}}
  48. <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
  49. {{end}}
  50. <label>
  51. {{svg "octicon-git-pull-request"}}
  52. {{if .CanCreatePullRequest}}
  53. {{ctx.Locale.Tr "repo.editor.create_new_branch" | Safe}}
  54. {{else}}
  55. {{ctx.Locale.Tr "repo.editor.create_new_branch_np" | Safe}}
  56. {{end}}
  57. </label>
  58. </div>
  59. </div>
  60. <div class="quick-pull-branch-name {{if not (eq .commit_choice "commit-to-new-branch")}}gt-hidden{{end}}">
  61. <div class="new-branch-name-input field {{if .Err_NewBranchName}}error{{end}}">
  62. {{svg "octicon-git-branch"}}
  63. <input type="text" name="new_branch_name" maxlength="100" value="{{.new_branch_name}}" class="input-contrast gt-mr-2 js-quick-pull-new-branch-name" placeholder="{{ctx.Locale.Tr "repo.editor.new_branch_name_desc"}}" {{if eq .commit_choice "commit-to-new-branch"}}required{{end}} title="{{ctx.Locale.Tr "repo.editor.new_branch_name"}}">
  64. <span class="text-muted js-quick-pull-normalization-info"></span>
  65. </div>
  66. </div>
  67. {{end}}
  68. </div>
  69. </div>
  70. <button id="commit-button" type="submit" class="ui primary button">
  71. {{if eq .commit_choice "commit-to-new-branch"}}{{ctx.Locale.Tr "repo.editor.propose_file_change"}}{{else}}{{ctx.Locale.Tr "repo.editor.commit_changes"}}{{end}}
  72. </button>
  73. <a class="ui button red" href="{{$.BranchLink}}/{{PathEscapeSegments .TreePath}}">{{ctx.Locale.Tr "repo.editor.cancel"}}</a>
  74. </div>