commit_form.tmpl 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <div class="commit-form-wrapper">
  2. <img width="48" height="48" class="ui image commit-avatar" src="{{.LoggedUser.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" .TreePath}}{{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">
  14. <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" {{if eq .commit_choice "direct"}}checked{{end}}>
  15. <label>
  16. <i class="octicon octicon-git-commit" height="16" width="14"></i>
  17. {{$branchName := .BranchName | Str2HTML}}
  18. {{.i18n.Tr "repo.editor.commit_directly_to_this_branch" $branchName | Safe}}
  19. </label>
  20. </div>
  21. </div>
  22. <div class="field">
  23. <div class="ui radio checkbox">
  24. <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}>
  25. <label>
  26. <i class="octicon octicon-git-pull-request" height="16" width="12"></i>
  27. {{.i18n.Tr "repo.editor.create_new_branch" | Safe}}
  28. </label>
  29. </div>
  30. </div>
  31. <div class="quick-pull-branch-name {{if not (eq .commit_choice "commit-to-new-branch")}}hide{{end}}">
  32. <div class="new-branch-name-input field {{if .Err_NewBranchName}}error{{end}}">
  33. <i class="octicon octicon-git-branch" height="16" width="10"></i>
  34. <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}}>
  35. <span class="text-muted js-quick-pull-normalization-info"></span>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. <button type="submit" class="ui green button">
  41. {{.i18n.Tr "repo.editor.commit_changes"}}
  42. </button>
  43. <a class="ui button red" href="{{EscapePound $.BranchLink}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.editor.cancel"}}</a>
  44. </div>