@(issues: List[(model.Issue, List[model.Label], Int)], page: Int, openCount: Int, closedCount: Int, condition: service.IssuesService.IssueSearchCondition, collaborators: List[String] = Nil, milestones: List[model.Milestone] = Nil, labels: List[model.Label] = Nil, repository: Option[service.RepositoryService.RepositoryInfo] = None, hasWritePermission: Boolean = false)(implicit context: app.Context) @import context._ @import view.helpers._
@if(condition.labels.nonEmpty || condition.milestoneId.isDefined){ Clear milestone and label filters } @if(condition.repo.isDefined){ Clear filter on @condition.repo }
@helper.html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.IssuesService.IssueLimit, 7, condition.toURL)
@openCount Open @closedCount Closed
@helper.html.dropdown( value = (condition.sort, condition.direction) match { case ("created" , "desc") => "Newest" case ("created" , "asc" ) => "Oldest" case ("comments", "desc") => "Most commented" case ("comments", "asc" ) => "Least commented" case ("updated" , "desc") => "Recently updated" case ("updated" , "asc" ) => "Least recently updated" }, prefix = "Sort", mini = false ){
- @helper.html.checkicon(condition.sort == "created" && condition.direction == "desc") Newest
- @helper.html.checkicon(condition.sort == "created" && condition.direction == "asc") Oldest
- @helper.html.checkicon(condition.sort == "comments" && condition.direction == "desc") Most commented
- @helper.html.checkicon(condition.sort == "comments" && condition.direction == "asc") Least commented
- @helper.html.checkicon(condition.sort == "updated" && condition.direction == "desc") Recently updated
- @helper.html.checkicon(condition.sort == "updated" && condition.direction == "asc") Least recently updated
}

@if(issues.isEmpty){
No issues to show. @if(condition.labels.nonEmpty || condition.milestoneId.isDefined){ Clear active filters. } else { @if(repository.isDefined){ Create a new issue. } }
} else { @if(hasWritePermission){

@helper.html.dropdown("Label") { @labels.map { label =>
- @label.labelName
} } @helper.html.dropdown("Assignee") {
- Clear assignee
@collaborators.map { collaborator =>
- @avatar(collaborator, 20) @collaborator
} } @helper.html.dropdown("Milestone") {
- Clear this milestone
@milestones.map { milestone =>
- @milestone.title
  @milestone.dueDate.map { dueDate => @if(isPast(dueDate)){ Due in @date(dueDate) } else { Due in @date(dueDate) } }.getOrElse { No due date }
} }

} } @issues.map { case (issue, labels, commentCount) =>

@if(hasWritePermission){ } @if(issue.isPullRequest){ } else { } @if(repository.isEmpty){ @issue.repositoryName ･ } @if(issue.isPullRequest){ @issue.title } else { @issue.title } @labels.map { label => @label.labelName } @issue.assignedUserName.map { userName => @avatar(userName, 20, tooltip = true) } #@issue.issueId
Opened by @issue.openedUserName @datetime(issue.registeredDate) @if(commentCount > 0){ @commentCount @plural(commentCount, "comment") }
@if(hasWritePermission){ }

}

@helper.html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.IssuesService.IssueLimit, 10, condition.toURL)