mirror of
https://github.com/go-gitea/gitea
synced 2025-01-24 16:44:28 +00:00
fill default branch name
This commit is contained in:
parent
c0d1960efb
commit
267a2ec367
@ -40,7 +40,8 @@ func CreateBranchFromIssue(ctx *context.Context) {
|
|||||||
form := web.GetForm(ctx).(*forms.NewBranchForm)
|
form := web.GetForm(ctx).(*forms.NewBranchForm)
|
||||||
repo := ctx.Repo.Repository
|
repo := ctx.Repo.Repository
|
||||||
gitRepo := ctx.Repo.GitRepo
|
gitRepo := ctx.Repo.GitRepo
|
||||||
if form.RepoID > 0 {
|
// if create branch in a forked repository
|
||||||
|
if form.RepoID > 0 && form.RepoID != repo.ID {
|
||||||
var err error
|
var err error
|
||||||
repo, err = repo_model.GetRepositoryByID(ctx, form.RepoID)
|
repo, err = repo_model.GetRepositoryByID(ctx, form.RepoID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -57,12 +57,12 @@
|
|||||||
<form class="ui form form-fetch-action" action="{{.Issue.Link}}/create_branch"
|
<form class="ui form form-fetch-action" action="{{.Issue.Link}}/create_branch"
|
||||||
method="post">
|
method="post">
|
||||||
{{.CsrfTokenHtml}}
|
{{.CsrfTokenHtml}}
|
||||||
<div class="field">
|
<div class="required field">
|
||||||
<label for="new_branch_name">{{ctx.Locale.Tr "form.NewBranchName"}}</label>
|
<label for="new_branch_name">{{ctx.Locale.Tr "form.NewBranchName"}}</label>
|
||||||
<input name="new_branch_name" type="text">
|
<input name="new_branch_name" type="text" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field">
|
<div class="required field">
|
||||||
<label for="source_repository">{{ctx.Locale.Tr "repo.issues.create_branch_from_repository"}}</label>
|
<label for="source_repository">{{ctx.Locale.Tr "repo.issues.create_branch_from_repository"}}</label>
|
||||||
<div class="ui fluid dropdown selection">
|
<div class="ui fluid dropdown selection">
|
||||||
<select name="repo_id">
|
<select name="repo_id">
|
||||||
@ -82,21 +82,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field">
|
<div class="required field">
|
||||||
<label for="source_branch_name">{{ctx.Locale.Tr "repo.issues.base_branch"}}</label>
|
<label for="source_branch_name">{{ctx.Locale.Tr "repo.issues.base_branch"}}</label>
|
||||||
<div class="ui fluid dropdown selection">
|
<div class="ui selection dropdown">
|
||||||
<select name="source_branch_name">
|
<input type="hidden" id="source_branch_name" name="source_branch_name" value="{{.Issue.Repo.DefaultBranch}}" required>
|
||||||
{{range .Branches}}
|
<span class="text truncated-item-container" data-value="{{.Issue.Repo.DefaultBranch}}" title="{{.Issue.Repo.DefaultBranch}}">
|
||||||
<option value="{{.}}">{{.}}</option>
|
<span class="truncated-item-name">{{.Issue.Repo.DefaultBranch}}</span>
|
||||||
{{end}}
|
</span>
|
||||||
</select>
|
|
||||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||||
|
<div class="menu">
|
||||||
<div class="default text"> </div>
|
|
||||||
|
|
||||||
<div class="menu tw-overflow-hidden tw-max-w-full">
|
|
||||||
{{range .Branches}}
|
{{range .Branches}}
|
||||||
<div data-value="{{.}}" data-tooltip-content="{{.}}" class="item tw-overflow-hidden gt-ellipsis tw-whitespace-nowrap">{{.}}</div>
|
<div class="item truncated-item-container" data-value="{{.}}" title="{{.}}">
|
||||||
|
<span class="truncated-item-name">{{.}}</span>
|
||||||
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user