@(issue: model.Issue, comments: List[model.IssueComment], issueLabels: List[model.Label], collaborators: List[String], milestones: List[(model.Milestone, Int, Int)], labels: List[model.Label], hasWritePermission: Boolean, repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context) @import context._ @import view.helpers._ @html.main(s"${issue.title} - Issue #${issue.issueId} - ${repository.owner}/${repository.name}", Some(repository)){ @html.header("issues", repository) @tab("issues", repository)
@avatar(issue.openedUserName, 48)
@if(hasWritePermission || loginAccount.map(_.userName == issue.openedUserName).getOrElse(false)){ Edit }
@issue.openedUserName opened this issue @datetime(issue.registeredDate)

#### @issue.title

@issue.assignedUserName.map { userName => @avatar(userName, 20) @userName is assigned }.getOrElse("No one is assigned") @if(hasWritePermission){ @helper.html.dropdown() {
- Clear assignee
@collaborators.map { collaborator =>
- @avatar(collaborator, 20) @collaborator
} } }
@issue.milestoneId.map { milestoneId => @milestones.collect { case (milestone, _, _) if(milestone.milestoneId == milestoneId) => Milestone: @milestone.title } }.getOrElse("No milestone")
@issue.milestoneId.map { milestoneId => @milestones.collect { case (milestone, openCount, closeCount) if(milestone.milestoneId == milestoneId) => @issues.milestones.html.progress(openCount + closeCount, closeCount, false) } }
@if(hasWritePermission){ @helper.html.dropdown() {
- No milestone
@milestones.map { case (milestone, _, _) =>
- @milestone.title
  @milestone.dueDate.map { dueDate => @if(isPast(dueDate)){ Due in @date(dueDate) } else { Due in @date(dueDate) } }.getOrElse { No due date }
} } }
@markdown(issue.content getOrElse "No description given.", repository, false, true)
@defining((issue.openedUserName :: comments.map(_.commentedUserName)).distinct){ participants => @participants.size @plural(participants.size, "participant") @participants.map { participant => @avatar(participant, 20, tooltip = true) } }
@comments.map { comment => @if(comment.action != "close" && comment.action != "reopen"){
@avatar(comment.commentedUserName, 48)
@comment.commentedUserName commented @datetime(comment.registeredDate) @if(comment.action != "commit" && (hasWritePermission || loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false))){ }
@markdown(comment.content, repository, false, true)
} @if(comment.action == "close" || comment.action == "close_comment"){
Closed @comment.commentedUserName closed the issue @datetime(comment.registeredDate)
} @if(comment.action == "reopen" || comment.action == "reopen_comment"){
Reopened @comment.commentedUserName reopened the issue @datetime(comment.registeredDate)
} } @if(loginAccount.isDefined){
@avatar(loginAccount.get.userName, 48)
@helper.html.preview(repository, "", false, true, "width: 680px; height: 100px;")
@if(hasWritePermission || issue.openedUserName == loginAccount.get.userName){ }
}
@if(issue.closed) { Closed } else { Open }
@defining(comments.filter( _.action.contains("comment") ).size){ count => @count @plural(count, "comment") }

Labels @if(hasWritePermission){
@helper.html.dropdown() { @labels.map { label =>
- @label.labelName
} }
}
}