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.
 
 
 
 
 
 

152 lines
6.6 KiB

@**
* Yobi, Project Hosting SW
*
* Copyright 2012 NAVER Corp.
* http://yobi.io
*
* @Author Ahn Hyeok Jun
*
* 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.
**@
@(post:Posting, commentForm: play.data.Form[PostingComment], project:Project)
@import utils.JodaDateUtil
@import utils.TemplateHelper._
@import utils.AccessControl._
@import models.enumeration._
@import play.libs.Json.toJson
@import utils.Markdown
@implicitField = @{ helper.FieldConstructor(simpleForm) }
@urlToPostings = @{ urlToList(requestHeader.headers.get("Referer").get, routes.BoardApp.posts(project.owner, project.name).toString()) }
@projectLayout(post.title, project, utils.MenuType.BOARD){
@projectMenu(project, utils.MenuType.BOARD, "main-menu-only")
<div class="page-wrap-outer">
<div class="project-page-wrap board-view">
@** Post Info **@
<div class="board-header issue">
<div class="pull-right mr10 mt10">
<div class="date" title="@JodaDateUtil.getDateString(post.createdDate)">
@agoOrDateString(post.createdDate)
</div>
</div>
<div class="title">
<strong class="board-id">@post.getNumber</strong> @post.title
</div>
</div>
@** Content body **@
<div class="board-body">
<div class="author-info">
<a href="@routes.UserApp.userInfo(post.authorLoginId)" class="usf-group">
<span class="avatar-wrap smaller">
<img src="@User.findByLoginId(post.authorLoginId).avatarUrl" width="20" height="20">
</span>
@if(post.authorLoginId != null){
<strong class="name">@post.authorName</strong>
<span class="loginid"> <strong>@{"@"}</strong>@post.authorLoginId</span>
} else {
<strong class="name">@Messages("common.noAuthor")</strong>
}
</a>
</div>
<div class="markdown-loader">
<i class="yobicon-loading2"></i> @Messages("common.loading")
</div>
<div class="content markdown-wrap">@Html(Markdown.render(post.body, post.asResource().getProject()))</div>
<div class="attachments" id="attachments" data-attachments="@toJson(AttachmentApp.getFileList(ResourceType.BOARD_POST.toString(), post.id.toString()))"></div>
</div>
<div class="board-footer board-actrow">
<div class="pull-left">
@if(isAllowed(UserApp.currentUser(), post.asResource(), Operation.WATCH)){
<button id="watch-button" type="button" class="ybtn @if(post.getWatchers.contains(UserApp.currentUser())){ybtn-watching}" data-toggle="button" data-watching="@if(post.getWatchers.contains(UserApp.currentUser())){true}else{false}">
@if(post.getWatchers.contains(UserApp.currentUser())) { @Messages("project.unwatch") } else { @Messages("project.watch") }
</button>
}
</div>
@if(isAllowed(UserApp.currentUser(), post.asResource(), Operation.DELETE)){
<a href="#deleteConfirm" class="ybtn ybtn-danger" data-toggle="modal">@Messages("button.delete")</a>
}
@if(isAllowed(UserApp.currentUser(), post.asResource(), Operation.UPDATE)){
<a href="@routes.BoardApp.editPostForm(project.owner, project.name, post.getNumber)" class="ybtn">@Messages("button.edit")</a>
}
</div>
@** Comment **@
<div id="comments" class="board-comment-wrap">
@partial_comments(project, post)
@common.commentForm(post.asResource(), ResourceType.NONISSUE_COMMENT, routes.BoardApp.newComment(project.owner, project.name, post.getNumber).toString())
</div>
<a href="@urlToPostings" class="ybtn pull-left">@Messages("button.list")</a>
@help.keymap("boardDetail", project)
</div>
</div>
<script type="text/x-jquery-tmpl" id="tplAttachedFile"><!--
--><li class="attached-file" data-name="${fileName}" data-href="${fileHref}" data-mime="${mimeType}" data-size="${fileSize}">
<strong>${fileName}(${fileSizeReadable})${notice}</strong><!--
--><a class="attached-delete"><i class="ico btn-delete"></i></a></li>
</script>
@** Confirm to delete post **@
<div id="deleteConfirm" class="modal hide fade">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>@Messages("button.confirm")</h3>
</div>
<div class="modal-body">
<p>@Messages("post.delete.confirm")</p>
</div>
<div class="modal-footer">
<button type="button" class="ybtn ybtn-danger" data-request-method="delete" data-request-uri="@routes.BoardApp.deletePost(project.owner, project.name, post.getNumber)">@Messages("button.yes")</button>
<button type="button" class="ybtn" data-dismiss="modal">@Messages("button.no")</button>
</div>
</div>
@common.markdown(project)
@common.commentDeleteModal()
<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">
$(document).ready(function(){
$yobi.loadModule("board.View", {
"sWatchUrl" : "@routes.WatchApp.watch(post.asResource.asParameter)",
"sUnwatchUrl": "@routes.WatchApp.unwatch(post.asResource.asParameter)"
});
// yobi.ShortcutKey
yobi.ShortcutKey.setKeymapLink({
"L": "@urlToPostings"
@if(project.menuSetting.board) {
,"N": "@routes.BoardApp.newPostForm(project.owner, project.name)"
}
@if(isAllowed(UserApp.currentUser(), post.asResource(), Operation.UPDATE)){
,"E": "@routes.BoardApp.editPostForm(project.owner, project.name, post.getNumber)"
}
});
// yobi.Mention
yobi.Mention({
"target": "textarea[id^=editor-]",
"url" : "@Html(routes.ProjectApp.mentionList(project.owner, project.name, post.getNumber, post.asResource().getType.resource()).toString())"
});
});
</script>
}