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"> <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%;">

View File

@@ -43,20 +43,21 @@
} }
} }
</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 style="width: 240px; position: absolute; margin-left: 610px;"> <div class="row-fluid">
<div class="check-conflict" style="display: none;"> <div class="span9">
<img src="@assets/common/images/indicator.gif"/> Checking... <div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
</div> <div class="box issue-box">
</div> <div class="box-content">
<div style="width: 600px; border-right: 1px solid #d4d4d4;">
<span class="error" id="error-title"></span> <span class="error" id="error-title"></span>
<input type="text" name="title" style="width: 580px" placeholder="Title"/> <input type="text" name="title" style="width: 580px" placeholder="Title"/>
@helper.html.preview( @helper.html.preview(
@@ -76,8 +77,15 @@
<input type="hidden" name="commitIdFrom" value="@sourceId"/> <input type="hidden" name="commitIdFrom" value="@sourceId"/>
<input type="hidden" name="commitIdTo" value="@commitId"/> <input type="hidden" name="commitIdTo" value="@commitId"/>
</div> </div>
</form>
</div> </div>
<div class="pull-right">
<input type="submit" class="btn btn-success" value="Create pull request"/>
</div>
</div>
</div>
<div class="span3">
</div>
</form>
</div> </div>
} }
@if(commits.isEmpty){ @if(commits.isEmpty){

View File

@@ -1,9 +1,12 @@
@(hasConflict: Boolean) @(hasConflict: Boolean)
@if(hasConflict){ <div style="margin-top: 8px;">
<h4>We cant 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;">Cant automatically merge.</span>
<h4 style="color: #468847;">Able to merge</h4> <span class="muted">Dont 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>