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 3.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <div class="commit-form-wrapper">
  2. <img width="48" height="48" class="ui image commit-avatar" src="{{.SignedUser.RelAvatarLink}}">
  3. <div class="commit-form">
  4. <h3>{{.i18n.Tr "repo.editor.commit_changes"}}</h3>
  5. <div class="field">
  6. <input name="commit_summary" placeholder="{{if .PageIsDelete}}{{.i18n.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{.i18n.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{.i18n.Tr "repo.editor.add_tmpl"}}{{else}}{{.i18n.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus>
  7. </div>
  8. <div class="field">
  9. <textarea name="commit_message" placeholder="{{.i18n.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea>
  10. </div>
  11. <div class="quick-pull-choice js-quick-pull-choice">
  12. <div class="field">
  13. <div class="ui radio checkbox {{if not .CanCommitToBranch}}disabled{{end}}">
  14. <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" button_text="{{.i18n.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}>
  15. <label>
  16. <i class="octicon octicon-git-commit" height="16" width="14"></i>
  17. {{.i18n.Tr "repo.editor.commit_directly_to_this_branch" (.BranchName|Escape) | Safe}}
  18. </label>
  19. </div>
  20. </div>
  21. <div class="field">
  22. {{$pullRequestEnabled := .Repository.UnitEnabled $.UnitTypePullRequests}}
  23. {{$prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}}
  24. <div class="ui radio checkbox">
  25. {{if $pullRequestEnabled}}
  26. <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{.i18n.Tr "repo.editor.propose_file_change"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
  27. {{else}}
  28. <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{.i18n.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
  29. {{end}}
  30. <label>
  31. <i class="octicon octicon-git-pull-request" height="16" width="12"></i>
  32. {{if $pullRequestEnabled}}
  33. {{.i18n.Tr "repo.editor.create_new_branch" | Safe}}
  34. {{else}}
  35. {{.i18n.Tr "repo.editor.create_new_branch_np" | Safe}}
  36. {{end}}
  37. </label>
  38. </div>
  39. </div>
  40. <div class="quick-pull-branch-name {{if not (eq .commit_choice "commit-to-new-branch")}}hide{{end}}">
  41. <div class="new-branch-name-input field {{if .Err_NewBranchName}}error{{end}}">
  42. <i class="octicon octicon-git-branch" height="16" width="10"></i>
  43. <input type="text" name="new_branch_name" value="{{.new_branch_name}}" class="input-contrast mr-2 js-quick-pull-new-branch-name" placeholder="{{.i18n.Tr "repo.editor.new_branch_name_desc"}}" {{if eq .commit_choice "commit-to-new-branch"}}required{{end}}>
  44. <span class="text-muted js-quick-pull-normalization-info"></span>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <button id="commit-button" type="submit" class="ui green button">
  50. {{if eq .commit_choice "commit-to-new-branch"}}{{.i18n.Tr "repo.editor.propose_file_change"}}{{else}}{{.i18n.Tr "repo.editor.commit_changes"}}{{end}}
  51. </button>
  52. <a class="ui button red" href="{{EscapePound $.BranchLink}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.editor.cancel"}}</a>
  53. </div>