mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-12 16:35:52 +01:00
Improve the pull request creation form
This commit is contained in:
@@ -10,90 +10,90 @@
|
|||||||
@navigation("issues", false, repository)
|
@navigation("issues", false, repository)
|
||||||
<br/><br/><hr style="margin-bottom: 10px;">
|
<br/><br/><hr style="margin-bottom: 10px;">
|
||||||
<form action="@url(repository)/issues/new" method="POST" validate="true">
|
<form action="@url(repository)/issues/new" method="POST" validate="true">
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span9">
|
<div class="span9">
|
||||||
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
|
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
|
||||||
<div class="box issue-box">
|
<div class="box issue-box">
|
||||||
<div class="box-content">
|
<div class="box-content">
|
||||||
<span id="error-title" class="error"></span>
|
<span id="error-title" class="error"></span>
|
||||||
<input type="text" name="title" value="" placeholder="Title" style="width: 565px;" autofocus/>
|
<input type="text" name="title" value="" placeholder="Title" style="width: 565px;" autofocus/>
|
||||||
<div>
|
<div>
|
||||||
<span id="label-assigned">No one is assigned</span>
|
<span id="label-assigned">No one is assigned</span>
|
||||||
@if(hasWritePermission){
|
|
||||||
<input type="hidden" name="assignedUserName" value=""/>
|
|
||||||
@helper.html.dropdown() {
|
|
||||||
<li><a href="javascript:void(0);" class="assign" data-name=""><i class="icon-remove-circle"></i> Clear assignee</a></li>
|
|
||||||
@collaborators.map { collaborator =>
|
|
||||||
<li><a href="javascript:void(0);" class="assign" data-name="@collaborator"><i class="icon-while"></i>@avatar(collaborator, 20) @collaborator</a></li>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<div class="pull-right">
|
|
||||||
<span id="label-milestone">No milestone</span>
|
|
||||||
@if(hasWritePermission){
|
@if(hasWritePermission){
|
||||||
<input type="hidden" name="milestoneId" value=""/>
|
<input type="hidden" name="assignedUserName" value=""/>
|
||||||
@helper.html.dropdown() {
|
@helper.html.dropdown() {
|
||||||
<li><a href="javascript:void(0);" class="milestone" data-id=""><i class="icon-remove-circle"></i> Clear this milestone</a></li>
|
<li><a href="javascript:void(0);" class="assign" data-name=""><i class="icon-remove-circle"></i> Clear assignee</a></li>
|
||||||
@milestones.filter(_.closedDate.isEmpty).map { milestone =>
|
@collaborators.map { collaborator =>
|
||||||
<li>
|
<li><a href="javascript:void(0);" class="assign" data-name="@collaborator"><i class="icon-while"></i>@avatar(collaborator, 20) @collaborator</a></li>
|
||||||
<a href="javascript:void(0);" class="milestone" data-id="@milestone.milestoneId" data-title="@milestone.title">
|
|
||||||
<i class="icon-while"></i> @milestone.title
|
|
||||||
<div class="small" style="padding-left: 20px;">
|
|
||||||
@milestone.dueDate.map { dueDate =>
|
|
||||||
@if(isPast(dueDate)){
|
|
||||||
<i class="octicon octicon-alert" style="color:#BD2C00;"></i><span class="milestone-alert">Due by @date(dueDate)</span>
|
|
||||||
} else {
|
|
||||||
<span class="muted">Due by @date(dueDate)</span>
|
|
||||||
}
|
|
||||||
}.getOrElse {
|
|
||||||
<span class="muted">No due date</span>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
<div class="pull-right">
|
||||||
|
<span id="label-milestone">No milestone</span>
|
||||||
|
@if(hasWritePermission){
|
||||||
|
<input type="hidden" name="milestoneId" value=""/>
|
||||||
|
@helper.html.dropdown() {
|
||||||
|
<li><a href="javascript:void(0);" class="milestone" data-id=""><i class="icon-remove-circle"></i> Clear this milestone</a></li>
|
||||||
|
@milestones.filter(_.closedDate.isEmpty).map { milestone =>
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" class="milestone" data-id="@milestone.milestoneId" data-title="@milestone.title">
|
||||||
|
<i class="icon-while"></i> @milestone.title
|
||||||
|
<div class="small" style="padding-left: 20px;">
|
||||||
|
@milestone.dueDate.map { dueDate =>
|
||||||
|
@if(isPast(dueDate)){
|
||||||
|
<i class="octicon octicon-alert" style="color:#BD2C00;"></i><span class="milestone-alert">Due by @date(dueDate)</span>
|
||||||
|
} else {
|
||||||
|
<span class="muted">Due by @date(dueDate)</span>
|
||||||
|
}
|
||||||
|
}.getOrElse {
|
||||||
|
<span class="muted">No due date</span>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
@helper.html.preview(
|
||||||
|
repository = repository,
|
||||||
|
content = "",
|
||||||
|
enableWikiLink = false,
|
||||||
|
enableRefsLink = true,
|
||||||
|
enableTaskList = true,
|
||||||
|
hasWritePermission = hasWritePermission,
|
||||||
|
style = "width: 565px; height: 200px; max-height: 250px;",
|
||||||
|
elastic = true
|
||||||
|
)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pull-right">
|
||||||
|
<input type="submit" class="btn btn-success" value="Submit new issue"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="span3">
|
||||||
|
@if(hasWritePermission){
|
||||||
|
<span class="strong">Labels</span>
|
||||||
|
<div>
|
||||||
|
<div id="label-list">
|
||||||
|
<ul class="label-list nav nav-pills nav-stacked">
|
||||||
|
@labels.map { label =>
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" class="toggle-label" data-label="@label.labelName" data-bgcolor="@label.color" data-fgcolor="@label.fontColor">
|
||||||
|
<span style="background-color: #@label.color;" class="label-color"> </span>
|
||||||
|
@label.labelName
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
<input type="hidden" name="labelNames" value=""/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
}
|
||||||
@helper.html.preview(
|
|
||||||
repository = repository,
|
|
||||||
content = "",
|
|
||||||
enableWikiLink = false,
|
|
||||||
enableRefsLink = true,
|
|
||||||
enableTaskList = true,
|
|
||||||
hasWritePermission = hasWritePermission,
|
|
||||||
style = "width: 565px; height: 200px; max-height: 250px;",
|
|
||||||
elastic = true
|
|
||||||
)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="pull-right">
|
|
||||||
<input type="submit" class="btn btn-success" value="Submit new issue"/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="span3">
|
|
||||||
@if(hasWritePermission){
|
|
||||||
<span class="strong">Labels</span>
|
|
||||||
<div>
|
|
||||||
<div id="label-list">
|
|
||||||
<ul class="label-list nav nav-pills nav-stacked">
|
|
||||||
@labels.map { label =>
|
|
||||||
<li>
|
|
||||||
<a href="javascript:void(0);" class="toggle-label" data-label="@label.labelName" data-bgcolor="@label.color" data-fgcolor="@label.fontColor">
|
|
||||||
<span style="background-color: #@label.color;" class="label-color"> </span>
|
|
||||||
@label.labelName
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
</ul>
|
|
||||||
<input type="hidden" name="labelNames" value=""/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<div style="margin-top: 8px; margin-bottom: 8px;" class="muted">
|
<div style="margin-top: 8px; margin-bottom: 8px;" class="muted">
|
||||||
Commits on @date(day.head.commitTime)
|
Commits on @date(day.head.commitTime)
|
||||||
</div>
|
</div>
|
||||||
<table style="width: 98%; margin-left: 4px; margin-right: 4px;" align="center">
|
<table style="width: 100%;">
|
||||||
@day.map { commit =>
|
@day.map { commit =>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 20%;">
|
<td style="width: 20%;">
|
||||||
|
|||||||
@@ -43,41 +43,49 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="check-conflict" style="display: none;">
|
||||||
|
<img src="@assets/common/images/indicator.gif"/> Checking...
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if(commits.nonEmpty && hasWritePermission){
|
@if(commits.nonEmpty && hasWritePermission){
|
||||||
<div style="margin-bottom: 10px;" id="create-pull-request">
|
<div style="margin-bottom: 10px;" id="create-pull-request">
|
||||||
<a href="#" class="btn btn-success" id="show-form">Create pull request</a>
|
<a href="#" class="btn btn-success" id="show-form">Create pull request</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="pull-request-form" class="box" style="display: none;">
|
<div id="pull-request-form" @*class="box"*@ style="display: none; margin-bottom: 20px;">
|
||||||
<div class="box-content">
|
<form method="POST" action="@path/@originRepository.owner/@originRepository.name/pulls/new" validate="true">
|
||||||
<form method="POST" action="@path/@originRepository.owner/@originRepository.name/pulls/new" validate="true">
|
<div class="row-fluid">
|
||||||
<div style="width: 240px; position: absolute; margin-left: 610px;">
|
<div class="span9">
|
||||||
<div class="check-conflict" style="display: none;">
|
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
|
||||||
<img src="@assets/common/images/indicator.gif"/> Checking...
|
<div class="box issue-box">
|
||||||
|
<div class="box-content">
|
||||||
|
<span class="error" id="error-title"></span>
|
||||||
|
<input type="text" name="title" style="width: 580px" placeholder="Title"/>
|
||||||
|
@helper.html.preview(
|
||||||
|
repository = repository,
|
||||||
|
content = "",
|
||||||
|
enableWikiLink = false,
|
||||||
|
enableRefsLink = true,
|
||||||
|
enableTaskList = true,
|
||||||
|
hasWritePermission = hasWritePermission,
|
||||||
|
style = "width: 580px; height: 200px;"
|
||||||
|
)
|
||||||
|
<input type="hidden" name="targetUserName" value="@originRepository.owner"/>
|
||||||
|
<input type="hidden" name="targetBranch" value="@originId"/>
|
||||||
|
<input type="hidden" name="requestUserName" value="@forkedRepository.owner"/>
|
||||||
|
<input type="hidden" name="requestRepositoryName" value="@forkedRepository.name"/>
|
||||||
|
<input type="hidden" name="requestBranch" value="@forkedId"/>
|
||||||
|
<input type="hidden" name="commitIdFrom" value="@sourceId"/>
|
||||||
|
<input type="hidden" name="commitIdTo" value="@commitId"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pull-right">
|
||||||
|
<input type="submit" class="btn btn-success" value="Create pull request"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 600px; border-right: 1px solid #d4d4d4;">
|
</div>
|
||||||
<span class="error" id="error-title"></span>
|
<div class="span3">
|
||||||
<input type="text" name="title" style="width: 580px" placeholder="Title"/>
|
</div>
|
||||||
@helper.html.preview(
|
</form>
|
||||||
repository = repository,
|
|
||||||
content = "",
|
|
||||||
enableWikiLink = false,
|
|
||||||
enableRefsLink = true,
|
|
||||||
enableTaskList = true,
|
|
||||||
hasWritePermission = hasWritePermission,
|
|
||||||
style = "width: 580px; height: 200px;"
|
|
||||||
)
|
|
||||||
<input type="hidden" name="targetUserName" value="@originRepository.owner"/>
|
|
||||||
<input type="hidden" name="targetBranch" value="@originId"/>
|
|
||||||
<input type="hidden" name="requestUserName" value="@forkedRepository.owner"/>
|
|
||||||
<input type="hidden" name="requestRepositoryName" value="@forkedRepository.name"/>
|
|
||||||
<input type="hidden" name="requestBranch" value="@forkedId"/>
|
|
||||||
<input type="hidden" name="commitIdFrom" value="@sourceId"/>
|
|
||||||
<input type="hidden" name="commitIdTo" value="@commitId"/>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@if(commits.isEmpty){
|
@if(commits.isEmpty){
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
@(hasConflict: Boolean)
|
@(hasConflict: Boolean)
|
||||||
@if(hasConflict){
|
<div style="margin-top: 8px;">
|
||||||
<h4>We can’t automatically merge these branches</h4>
|
@if(hasConflict){
|
||||||
<p>Don't worry, you can still submit the pull request.</p>
|
<i class="octicon octicon-x" style="color: #bd2c00"></i>
|
||||||
} else {
|
<span class="strong" style="color: #bd2c00;">Can’t automatically merge.</span>
|
||||||
<h4 style="color: #468847;">Able to merge</h4>
|
<span class="muted">Don’t worry, you can still create the pull request.</span>
|
||||||
<p>These branches can be automatically merged.</p>
|
} else {
|
||||||
}
|
<i class="octicon octicon-check" style="color: #6cc644"></i>
|
||||||
<input type="submit" class="btn btn-success btn-block" value="Create pull request"/>
|
<span class="strong" style="color: #6cc644">Able to merge.</span>
|
||||||
|
<span class="muted">These branches can be automatically merged.</span>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user