THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

test
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

99 lines
4.6 KiB

@**
* Yobi, Project Hosting SW
*
* Copyright 2013 NAVER Corp.
* http://yobi.io
*
* @Author Keesun Baik, Wansoon Park
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(project: Project, pull: PullRequest, canDeleteBranch: Boolean, canRestoreBranch: Boolean)
@import utils.JodaDateUtil._
@import utils.TemplateHelper._
@import utils.AccessControl._
@import models.enumeration
@import scala.collection.JavaConversions._
@getCodeURL(project: Project) = @{
if(ProjectUser.isMember(project.id, UserApp.currentUser().id)){
CodeApp.getURL(project.owner, project.name).replace("://", "://" + UserApp.currentUser.loginId + "@")
} else {
CodeApp.getURL(project.owner, project.name)
}
}
@if(pull.isMerging == false && !pull.isClosed && !pull.isMerged){
@if(pull.isConflict == false){
<div class="alert alert-success">
<i class="yobicon-check-circle-alt mr5"></i>
<span>@Messages("pullRequest.is.safe")</span>
</div>
} else {
<div class="alert alert-error">
<i class="yobicon-error mr5"></i>
<span>@Messages("pullRequest.is.not.safe")</span>
@if(UserApp.currentUser().equals(pull.contributor)){
<div class="howto-resolve-conflict">
<h6>@Messages("pullRequest.resolve.conflict")</h6>
<div class="help">
<ol>
<li>@Messages("pullRequest.resolver.step1") <code>git checkout @branchItemName(pull.fromBranch)</code></li>
<li>@Messages("pullRequest.resolver.step2") <code>git remote add upstream @getCodeURL(pull.toProject)</code></li>
<li>@Messages("pullRequest.resolver.step3") <code>git fetch upstream</code></li>
<li>@Messages("pullRequest.resolver.step4") <code>git rebase upstream/@branchItemName(pull.toBranch)</code></li>
<li>@Messages("pullRequest.resolver.step5") </li>
<li>@Messages("pullRequest.resolver.step6") <code>git add resolved_file</code></li>
<li>@Messages("pullRequest.resolver.step7") <code>git rebase --continue</code></li>
<li>@Messages("pullRequest.resolver.step8") </li>
<li>@Messages("pullRequest.resolver.step9") <code>git push -f origin @branchItemName(pull.fromBranch)</code></li>
<li>@Messages("pullRequest.resolver.step10") <a href="@routes.PullRequestApp.pullRequest(project.owner, project.name, pull.number)" class="ybtn ybtn-mini ybtn-primary">@Messages("button.page.refresh")</a>@Messages("pullRequest.resolver.step11")</li>
</ol>
</div>
</div>
}
</div>
}
}
@if(pull.isMerging == true){
<div class="alert alert-warnning">
<i class="yobicon-supportrequest mr5"></i>
<span>@Messages("pullRequest.is.merging")</span>
</div>
}
@if(pull.isMerged){
<div class="alert alert-info">
<a href="@routes.UserApp.userInfo(pull.receiver.loginId)" class="usf-group">
<span class="avatar-wrap smaller">
<img src="@pull.receiver.avatarUrl" width="25" height="25">
</span>
<strong class="name">@pull.receiver.name</strong>
<span class="loginid"> <strong>@{"@"}</strong>@pull.receiver.loginId</span>
</a>
@Html(Messages("pullRequest.merged.the.pullrequest", pull.receiver.name, routes.UserApp.userInfo(pull.receiver.loginId)))
@if(UserApp.currentUser().equals(pull.contributor)) {
@if(canDeleteBranch) {
<code>@pull.fromBranch</code> @Messages("pullRequest.delete.frombranch.message")
<button class="ybtn ybtn-danger ybtn-mini pull-right" data-request-method="delete" data-request-uri="@routes.PullRequestApp.deleteFromBranch(project.owner, project.name, pull.number)">@Messages("pullRequest.delete.branch")</button>
}
@if(canRestoreBranch) {
<code>@pull.fromBranch</code> @Messages("pullRequest.restore.frombranch.message")
<a href="@routes.PullRequestApp.restoreFromBranch(project.owner, project.name, pull.number)" class="ybtn ybtn-info ybtn-mini pull-right" data-request-method="post">@Messages("pullRequest.restore.branch")</a>
}
}
</div>
}