Improve the pull request creation form

This commit is contained in:
Naoki Takezoe
2015-08-16 02:30:13 +09:00
parent e5b8d81bb4
commit 9b377c727d
4 changed files with 123 additions and 112 deletions

View File

@@ -9,7 +9,7 @@
<div style="margin-top: 8px; margin-bottom: 8px;" class="muted">
Commits on @date(day.head.commitTime)
</div>
<table style="width: 98%; margin-left: 4px; margin-right: 4px;" align="center">
<table style="width: 100%;">
@day.map { commit =>
<tr>
<td style="width: 20%;">

View File

@@ -43,41 +43,49 @@
}
}
</div>
<div class="check-conflict" style="display: none;">
<img src="@assets/common/images/indicator.gif"/> Checking...
</div>
</div>
@if(commits.nonEmpty && hasWritePermission){
<div style="margin-bottom: 10px;" id="create-pull-request">
<a href="#" class="btn btn-success" id="show-form">Create pull request</a>
</div>
<div id="pull-request-form" class="box" style="display: none;">
<div class="box-content">
<form method="POST" action="@path/@originRepository.owner/@originRepository.name/pulls/new" validate="true">
<div style="width: 240px; position: absolute; margin-left: 610px;">
<div class="check-conflict" style="display: none;">
<img src="@assets/common/images/indicator.gif"/> Checking...
<div id="pull-request-form" @*class="box"*@ style="display: none; margin-bottom: 20px;">
<form method="POST" action="@path/@originRepository.owner/@originRepository.name/pulls/new" validate="true">
<div class="row-fluid">
<div class="span9">
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
<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 style="width: 600px; border-right: 1px solid #d4d4d4;">
<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>
</form>
</div>
</div>
<div class="span3">
</div>
</form>
</div>
}
@if(commits.isEmpty){

View File

@@ -1,9 +1,12 @@
@(hasConflict: Boolean)
@if(hasConflict){
<h4>We cant automatically merge these branches</h4>
<p>Don't worry, you can still submit the pull request.</p>
} else {
<h4 style="color: #468847;">Able to merge</h4>
<p>These branches can be automatically merged.</p>
}
<input type="submit" class="btn btn-success btn-block" value="Create pull request"/>
<div style="margin-top: 8px;">
@if(hasConflict){
<i class="octicon octicon-x" style="color: #bd2c00"></i>
<span class="strong" style="color: #bd2c00;">Cant automatically merge.</span>
<span class="muted">Dont worry, you can still create the pull request.</span>
} else {
<i class="octicon octicon-check" style="color: #6cc644"></i>
<span class="strong" style="color: #6cc644">Able to merge.</span>
<span class="muted">These branches can be automatically merged.</span>
}
</div>