A fork of Gitea (see branch `mj`) adding Majority Judgment Polls 𐄷 over Issues and Merge Requests. https://git.mieuxvoter.fr
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.

68 lines
4.0 KiB

  1. <div class="commit-form-wrapper">
  2. {{avatar .SignedUser 48 "commit-avatar"}}
  3. <div class="commit-form">
  4. <h3>{{- if .CanCommitToBranch.WillSign}}
  5. <span title="{{.i18n.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}">{{svg "octicon-lock" 24}}</span>
  6. {{.i18n.Tr "repo.editor.commit_signed_changes"}}
  7. {{- else}}
  8. <span title="{{.i18n.Tr (printf "repo.signing.wont_sign.%s" .CanCommitToBranch.WontSignReason)}}">{{svg "octicon-unlock" 24}}</span>
  9. {{.i18n.Tr "repo.editor.commit_changes"}}
  10. {{- end}}</h3>
  11. <div class="field">
  12. <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>
  13. </div>
  14. <div class="field">
  15. <textarea name="commit_message" placeholder="{{.i18n.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea>
  16. </div>
  17. <div class="quick-pull-choice js-quick-pull-choice">
  18. <div class="field">
  19. <div class="ui radio checkbox {{if not .CanCommitToBranch.CanCommitToBranch}}disabled{{end}}">
  20. <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}}>
  21. <label>
  22. {{svg "octicon-git-commit"}}
  23. {{.i18n.Tr "repo.editor.commit_directly_to_this_branch" (.BranchName|Escape) | Safe}}
  24. {{if not .CanCommitToBranch.CanCommitToBranch}}
  25. <div class="ui visible small warning message">
  26. {{.i18n.Tr "repo.editor.no_commit_to_branch"}}
  27. <ul>
  28. {{if not .CanCommitToBranch.UserCanPush}}<li>{{.i18n.Tr "repo.editor.user_no_push_to_branch"}}</li>{{end}}
  29. {{if and .CanCommitToBranch.RequireSigned (not .CanCommitToBranch.WillSign)}}<li>{{.i18n.Tr "repo.editor.require_signed_commit"}}</li>{{end}}
  30. </ul>
  31. </div>
  32. {{end}}
  33. </label>
  34. </div>
  35. </div>
  36. <div class="field">
  37. {{$pullRequestEnabled := .Repository.UnitEnabled $.UnitTypePullRequests}}
  38. {{$prUnit := .Repository.MustGetUnit $.UnitTypePullRequests}}
  39. <div class="ui radio checkbox">
  40. {{if $pullRequestEnabled}}
  41. <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}}>
  42. {{else}}
  43. <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}}>
  44. {{end}}
  45. <label>
  46. {{svg "octicon-git-pull-request"}}
  47. {{if $pullRequestEnabled}}
  48. {{.i18n.Tr "repo.editor.create_new_branch" | Safe}}
  49. {{else}}
  50. {{.i18n.Tr "repo.editor.create_new_branch_np" | Safe}}
  51. {{end}}
  52. </label>
  53. </div>
  54. </div>
  55. <div class="quick-pull-branch-name {{if not (eq .commit_choice "commit-to-new-branch")}}hide{{end}}">
  56. <div class="new-branch-name-input field {{if .Err_NewBranchName}}error{{end}}">
  57. {{svg "octicon-git-branch"}}
  58. <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}}>
  59. <span class="text-muted js-quick-pull-normalization-info"></span>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. <button id="commit-button" type="submit" class="ui green button">
  65. {{if eq .commit_choice "commit-to-new-branch"}}{{.i18n.Tr "repo.editor.propose_file_change"}}{{else}}{{.i18n.Tr "repo.editor.commit_changes"}}{{end}}
  66. </button>
  67. <a class="ui button red" href="{{EscapePound $.BranchLink}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.editor.cancel"}}</a>
  68. </div>