@** * 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. **@ @(title:String, issue:Issue, issueForm: play.data.Form[Issue], commentForm: play.data.Form[Comment],project:Project) @import org.apache.commons.lang.StringUtils @import helper._ @import scala.collection.mutable.Map @import models.enumeration.ResourceType @import models.enumeration.Operation @import models.Milestone @import java.net._ @import java.text.SimpleDateFormat @import java.security.MessageDigest @import utils.JodaDateUtil @import utils.TemplateHelper._ @import utils.AccessControl._ @import utils.Config @import play.libs.Json.toJson @import utils.Markdown @getTitle(issue:Issue) = @{ "#" + issue.getNumber + " " + issue.title } @isFirstState(state:State) = {@if(issue.state.state == Issue.availableStates.get(0).state()){dirty}} @urlToIssues = @{ requestHeader.headers.get("Referer") match { case Some(u) => urlToList(u, routes.IssueApp.issues(project.owner, project.name, "open").toString()) case _ => routes.IssueApp.issues(project.owner, project.name, "open").toString() } } @urlToVote = @{ if(issue.isVotedBy(UserApp.currentUser)){ routes.VoteApp.unvote(project.owner, project.name, issue.getNumber).toString } else { routes.VoteApp.vote(project.owner, project.name, issue.getNumber).toString } } @getVoteButtonTitle = { @if(issue.isVotedBy(UserApp.currentUser)){ @Messages("issue.unvote.description") } else { @Messages("issue.vote.description") } } @projectLayout(getTitle(issue), project, utils.MenuType.ISSUE){ @projectMenu(project, utils.MenuType.ISSUE, "main-menu-only")
@** Post Info **@
@agoOrDateString(issue.createdDate)
@Messages("issue.state." + issue.state.state)
#@issue.getNumber @issue.title
@** Content body **@
@if(StringUtils.isEmpty(issue.body)){
} else {
@Html(Markdown.render(issue.body, issue.project))
}
@if(isAllowed(UserApp.currentUser(), issue.asResource(), Operation.WATCH)) { }
@if(isResourceCreatable(UserApp.currentUser, issue.asResource(), ResourceType.ISSUE_COMMENT)) { @Messages("issue.vote") @if(issue.voters.size > 0) { @issue.voters.size } } else { @Messages("issue.vote") @if(issue.voters.size > 0) { @issue.voters.size } } @if(issue.voters.size > 0){ @partial_voters(issue, 3) }
@if(issue.canBeDeleted) { @if(isAllowed(UserApp.currentUser(), issue.asResource(), Operation.DELETE)) { @Messages("button.delete") } } else { } @if(isAllowed(UserApp.currentUser(), issue.asResource(), Operation.UPDATE)) { @Messages("button.edit") }
@** Comment **@
@partial_comments(project, issue)
@common.commentForm(issue.asResource(), ResourceType.ISSUE_COMMENT, routes.IssueApp.newComment(project.owner, project.name, issue.getNumber).toString())
@** // Comment **@
@****@
@Messages("issue.assignee")
@defining(issue.assigneeName != null) { isAssigned => @if(isAllowed(UserApp.currentUser(), issue.asResource(), Operation.UPDATE)) { @partial_assignee(project, issue) } else { @if(isAssigned){ @issue.assigneeName @{"@"}@issue.assignee.user.loginId } else {
@Messages("issue.noAssignee")
} } }
@****@ @****@ @if(project.menuSetting.milestone) {
@Messages("milestone")
@if(Milestone.findByProjectId(project.id).isEmpty()){ @Messages("milestone.menu.new") } else { @defining(issue.milestone != null) { hasMilestone => @if(isAllowed(UserApp.currentUser(), issue.asResource(), Operation.UPDATE)) { } else { @if(hasMilestone){ @issue.milestone.title } else { @Messages("issue.noMilestone") } } } }
} @****@
@Messages("issue.dueDate") @if(issue.dueDate != null) { @if(issue.isOverDueDate) { (@Messages("issue.dueDate.overdue")) } else { (@issue.until) } }
@if(isAllowed(UserApp.currentUser(), issue.asResource(), Operation.UPDATE)) { } else { @if(issue.dueDate != null) { @issue.getDueDateString } else { @Messages("issue.noDuedate") } }
@****@ @if(!IssueLabel.findByProject(project).isEmpty){ @if(isAllowed(UserApp.currentUser(), issue.asResource(), Operation.UPDATE)){ @partial_select_label(IssueLabel.findByProject(project), issue.getLabelIds) } else { @partial_show_selected_label(issue.labels.toList, routes.IssueApp.issues(project.owner, project.name, issue.state.state(), "html", 1).toString) } } @****@
@** Confirm to delete post **@
@common.markdown(project) @common.commentDeleteModal() @common.select2() @common.calendar() }