[Notice] Announcing the End of Demo Server [Read me]
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
@**
* Yobi, Project Hosting SW
*
* Copyright 2012 NAVER Corp.
* http://yobi.io
*
* @author Yi EungJun
*
* 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, commit:playRepository.Commit, parentCommit:playRepository.Commit, patch: String, comments:List[CommitComment], selectedBranch:String, path:String)
@import playRepository.RepositoryService
@import java.net.URLEncoder
@import utils.TemplateHelper._
@import utils.JodaDateUtil
@import utils.AccessControl._
@import play.libs.Json.toJson
@import utils.Markdown
@projectLayout(Messages("code.commits") + " @" + commit.getId, project, utils.MenuType.CODE) {
@projectMenu(project, utils.MenuType.CODE, "main-menu-only")
<div class="page-wrap-outer">
<div class="project-page-wrap">
<div id="code-browse-wrap" class="code-browse-wrap">
<div id="branches" class="btn-group branches pull-right" data-name="branch" data-activate="manual">
<button class="btn dropdown-toggle large" data-toggle="dropdown">
<span class="d-label">@if(selectedBranch){ @selectedBranch } else { HEAD }</span>
<span class="d-caret"><span class="caret"></span></span>
</button>
<ul class="dropdown-menu">
@defining(RepositoryService.getRepository(project).getRefNames()) { branches =>
@for(branch <- branches){
@common.branchItem("history", project, branch, null,
utils.TemplateHelper.equals(branch, selectedBranch))
}
}
</ul>
</div>
<ul class="nav nav-tabs" style="margin-bottom:20px;">
<li>
<a href="@routes.CodeApp.codeBrowser(project.owner, project.name)">@Messages("code.files")</a>
</li>
<li class="active">
<a href="@routes.CodeHistoryApp.historyUntilHead(project.owner, project.name)">@Messages("code.commits")</a>
</li>
</ul>
<p class="commitInfo">
@(commit.getAuthor, commit.getAuthorEmail, commit.getAuthorName) match {
case (user: User, _, _) if !user.isAnonymous => {
<a href="@routes.UserApp.userInfo(commit.getAuthor.loginId)" class="avatar-wrap">
<img src="@commit.getAuthor.avatarUrl" alt="@commit.getAuthor.name" width="32" height="32"/>
</a>
<strong>@commit.getAuthor.name</strong>
}
case (_, email, name) if email != null => {
<span class="avatar-wrap">
<img src="@urlToPicture(commit.getAuthorEmail, 32)" width="32" height="32">
</span>
@if(name != null) {
<strong>@name</strong>
}
}
case (_, _, name) if name != null => {
<strong>@name</strong>
}
case (_, _, _) => {
<strong>@User.anonymous.name</strong>
}
}
<span class="ago" title="@JodaDateUtil.getDateString(commit.getAuthorDate)">
@agoOrDateString(commit.getAuthorDate)
</span>
<strong class="commitId pull-right">@{"@"}@commit.getId</strong>
@if(comments.size > 0) {
<span class="pull-right mt5 mr10">
<input id="toggle-comments" type="checkbox" checked="checked" class="checkbox">
<label for="toggle-comments" class="form-label">@Messages("code.showcomments")</label>
</span>
}
</p>
<pre class="commitMsg">@commit.getMessage</pre>
<div class="diff-wrap">
<div id="commit" data-commit-origin="true" class="diff-body hide">@patch</div>
</div>
@** Comment **@
<div class="board-comment-wrap">
@if(comments.size > 0) {
<ul class="comments">
@for(comment <- comments){
<li id="comment-@comment.id" data-path="@comment.path" data-side="@comment.side" data-line="@comment.line" class="comment">
<div class="comment-avatar">
<a href="@routes.UserApp.userInfo(comment.authorLoginId)" class="avatar-wrap" data-toggle="tooltip" data-placement="top" title="@comment.authorName">
<img src="@User.findByLoginId(comment.authorLoginId).avatarUrl" width="32" height="32" alt="@comment.authorLoginId">
</a>
</div>
<div class="media-body">
<div class="meta-info">
<span class="comment_author pull-left">
<a href="@routes.UserApp.userInfo(comment.authorLoginId)" data-toggle="tooltip" data-placement="top" title="@comment.authorName">
<strong>@comment.authorLoginId </strong>
</a>
</span>
<span class="ago">
<a href="#comment-@comment.id" title="@JodaDateUtil.getDateString(commit.getAuthorDate)">
@agoOrDateString(comment.createdDate)
</a>
</span>
@if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.DELETE)){
<span class="edit pull-right">
<button class="btn-transparent pull-right close" data-toggle="comment-delete" data-request-uri="@routes.CodeHistoryApp.deleteComment(project.owner, project.name, commit.getId, comment.id)" title="@Messages("common.comment.delete")"><i class="yobicon-trash"></i></button>
</span>
}
</div>
<div class="comment-body markdown-wrap" data-via-email="@OriginalEmail.exists(comment.asResource)">@Html(Markdown.render(comment.contents, comment.asResource().getProject()))</div>
<div class="attachments" data-attachments="@toJson(AttachmentApp.getFileList(ResourceType.COMMIT_COMMENT.toString(), comment.id.toString()))"></div>
</div>
</li>
}
</ul>
}
@common.commentForm(commit.asResource(project), ResourceType.COMMIT_COMMENT, routes.CodeHistoryApp.newComment(project.owner, project.name, commit.getId).toString())
</div>
@** // Comment **@
</div>
<button id="watch-button" type="button" class="ybtn @if(commit.getWatchers(project).contains(UserApp.currentUser())) { active }" data-toggle="button">@Messages("notification.watch")</button>
<a href="@routes.CodeHistoryApp.history(project.owner, project.name, selectedBranch, path)" class="ybtn pull-right">@Messages("button.list")</a>
<div id="minimap" class="minimap-outer">
<div class="minimap-wrap">
<div class="minimap-curr"></div>
<div class="minimap-links"></div>
</div>
</div>
</div>
</div>
@common.markdown(project)
@common.commentDeleteModal("#code-browse-wrap")
<script type="text/x-jquery-tmpl" id="comment-icon-template">
<i class="yobicon-comments"></i>
</script>
<script type="text/x-jquery-tmpl" id="linenum-column-template">
<td class="linenum"></td>
</script>
<script type="text/x-jquery-tmpl" id="comment-button-template">
<button class="ybtn medium btn-thread"></button>
</script>
<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")">
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script>
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script>
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/diff.js")"></script>
<script type="text/javascript">
$(document).ready(function(){
$yobi.loadModule("code.SvnDiff", {
"bCommentable" : @if(isProjectResourceCreatable(UserApp.currentUser, project, ResourceType.COMMIT_COMMENT)){true}else{false},
"sWatchUrl" : "@routes.WatchApp.watch(commit.asResource(project).asParameter)",
"sUnwatchUrl" : "@routes.WatchApp.unwatch(commit.asResource(project).asParameter)",
"sParentCommitId": "@if(parentCommit != null){@parentCommit.getId}",
"sCommitId" : "@commit.getId",
"sTplFileURL" : "@routes.CodeApp.codeBrowserWithBranch(project.owner, project.name, "${commitId}", "${path}")",
"sTplRawURL" : "@routes.CodeApp.showRawFile(project.owner, project.name, "${commitId}", "${path}")"
});
yobi.Mention({
target:'textarea[id^=editor-]',
url : "@Html(routes.ProjectApp.mentionListAtCommitDiff(project.owner, project.name, commit.getId).toString)"
});
});
</script>
}