File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
2013-10-22
@(form: Form[PullRequest], project: Project, result:models.PullRequestMergeResult, pullRequest:models.PullRequest)
@import utils.JodaDateUtil._
@import utils.TemplateHelper._
@import utils.AccessControl._
@import models.enumeration
@import playRepository.GitCommit
@implicitField = @{ helper.FieldConstructor(simpleForm) }
@branchName(branch:String) = @{
branch.replace("refs/heads/", "")
}
@getCodeURL(project: Project) = @{
if(session == null){
CodeApp.getURL(project.owner, project.name)
} else {
defining(ProjectUser.roleOf(session.get("loginId"), project)) { role =>
if(role == "manager" || role == "member"){
CodeApp.getURL(project.owner, project.name).replace("://", "://" + session.get("loginId") + "@")
} else {
CodeApp.getURL(project.owner, project.name)
}
}
}
}
@helper.inputText(form("title"), 'class->"text title", 'maxlength -> "250", 'tabindex -> 1)
@helper.textarea(form("body"), 'markdown -> true, 'class->"text content", 'tabindex -> 2)
@common.fileUploader(ResourceType.PULL_REQUEST, null)
@common.markdown(project)
<div class="actions">
<button type="submit" class="ybtn ybtn-success">@Messages("button.save")</button>
<a href="javascript:history.back();" class="ybtn">@Messages("button.cancel")</a>
</div>
<div id="spin" style="position: absolute; top:50%; left:50%"></div>
<div id="diff">
@if(result != null) {
@if(result.getGitCommits().isEmpty()) {
<h4>@Messages("pullRequest.diff.noChanges")</h4>
} else {
<div style="margin-top:20px;">
@if(result.getGitConflicts() == null){
<div class="alert alert-success">
<h5>@Messages("pullRequest.is.safe")</h5>
</div>
} else {
<div class="alert alert-error">
<h5>@Messages("pullRequest.is.not.safe")</h5>
</div>
}
</div>
<ul class="nav nav-tabs nm">
<li class="active"><a href="#__commits" data-toggle="tab">@Messages("pullRequest.menu.commit")</a></li>
<li><a href="#__changes" data-toggle="tab">@Messages("pullRequest.menu.changes")</a></li>
</ul>
<div class="tab-content">
<div id="__commits" class="code-browse-wrap tab-pane active">
<div id="history" class="commit-wrap mt20">
<table class="code-table commits">
<thead class="thead">
<tr>
<td class="commit-id"><strong>@{"@"}</strong></td>
<td class="messages"><strong>@Messages("code.commitMsg")</strong></td>
<td class="date"><strong>@Messages("code.commitDate")</strong></td>
<td class="author"><strong>@Messages("code.author")</strong></td>
</tr>
</thead>
<tbody class="tbody">
@for(commit <- result.getGitCommits()) {
<tr>
<td class="commit-id">
<a href="@routes.CodeHistoryApp.show(pullRequest.fromProject.owner, pullRequest.fromProject.name, commit.getId())">
@commit.getShortId()
<i class="yobicon-right"></i>
</a>
</td>
<td class="messages">
@defining(CommitComment.count(pullRequest.fromProject, commit.getId, null)){ numOfComment =>
@if(numOfComment > 0) {
<span class="number-of-comments"><i class="yobicon-comments"></i> @numOfComment</span>
}
}
@defining(commit.getMessage()){ commitMsg =>
<a href="@routes.CodeHistoryApp.show(pullRequest.fromProject.owner, pullRequest.fromProject.name, commit.getId())">
@commitMsg.split("\n")(0)
</a>
@if(commitMsg.split("\n").length > 1){
<button type="button" class="more"><i class="yobicon-ellipsis-horizontal"></i></button>
<pre class="hidden">@commitMsg.replace(commitMsg.split("\n")(0)+"\n", "")</pre>
}
}
</td>
<td class="date">@agoString(ago(commit.getAuthorDate()))</td>
<td class="author @commit.getAuthorEmail">
@defining(User.find.where.eq("email", commit.getAuthorEmail).findUnique) { user =>
@if(user != null) {
<a href="@routes.UserApp.userInfo(user.loginId)" class="avatar-wrap">
<img src="@user.avatarUrl" alt="@user.name" width="32" height="32"/>
</a>
} else {
<div class="avatar-wrap">
<img src="@urlToPicture(commit.getAuthorEmail(), 32)" width="32" height="32"/>
</div>
}
}
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
<div id="__changes" class="tab-pane">
<pre>@pullRequest.getPatch()</pre>
</div>
</div>
}
}
</div>