Support choose email when creating a commit via web UI (#33432)

Initial PR for #24469
This commit is contained in:
wxiaoguang 2025-01-30 09:24:57 +08:00 committed by GitHub
parent ac2d97cb61
commit 256b94e9e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 356 additions and 182 deletions

View file

@ -66,6 +66,16 @@
</div>
{{end}}
</div>
{{if and .CommitCandidateEmails (gt (len .CommitCandidateEmails) 1)}}
<div class="field {{if .Err_CommitEmail}}error{{end}}">
<label>{{ctx.Locale.Tr "repo.editor.commit_email"}}</label>
<select class="ui selection dropdown" name="commit_email">
{{- range $email := .CommitCandidateEmails -}}
<option {{if eq $email $.CommitDefaultEmail}}selected{{end}} value="{{$email}}">{{$email}}</option>
{{- end -}}
</select>
</div>
{{end}}
</div>
<button id="commit-button" type="submit" class="ui primary button">
{{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}}