@import org.json4s.scalap.scalasig.ClassFileParser.field @(issue: Option[gitbucket.core.model.Issue], comments: List[gitbucket.core.model.Comment], issueLabels: List[gitbucket.core.model.Label], issueAssignees: List[gitbucket.core.model.IssueAssignee], collaborators: List[String], milestones: List[(gitbucket.core.model.Milestone, Int, Int)], priorities: List[gitbucket.core.model.Priority], defaultPriority: Option[gitbucket.core.model.Priority], labels: List[gitbucket.core.model.Label], customFields: List[(gitbucket.core.model.CustomField, Option[gitbucket.core.model.IssueCustomField])], isManageable: Boolean, repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context) @import gitbucket.core.view.helpers
Labels @if(isManageable){
@gitbucket.core.helper.html.dropdown("Edit", right = true, filter = ("labels", "Filter Labels")) { @labels.map { label =>
- @gitbucket.core.helper.html.checkicon(issueLabels.exists(_.labelId == label.labelId)) @label.labelName
} } @if(issue.isEmpty){ }
}

Priority @if(isManageable){
@gitbucket.core.helper.html.dropdown("Edit", right = true, filter = ("priority", "Filter Priority")) {
- Clear priority
@priorities.map { priority =>
- @gitbucket.core.helper.html.checkicon(issue.flatMap(_.priorityId).orElse(defaultPriority.map(_.priorityId)).map(id => id == priority.priorityId).getOrElse(false)) @priority.priorityName
} }
}
@issue.flatMap(_.priorityId).orElse(defaultPriority.map(_.priorityId)).map { priorityId => @priorities.collect { case priority if(priority.priorityId == priorityId) => { @priority.priorityName }} }.getOrElse { No priority } @if(issue.isEmpty){ }

Milestone @if(isManageable){
@gitbucket.core.helper.html.dropdown("Edit", right = true, filter = ("milestone", "Filter Milestone")) {
- Clear this milestone
@milestones.filter(_._1.closedDate.isEmpty).map { case (milestone, _, _) =>
- @issue.map { issue => @gitbucket.core.helper.html.checkicon(Some(milestone.milestoneId) == issue.milestoneId) } @milestone.title
  @milestone.dueDate.map { dueDate => @if(helpers.isPast(dueDate)){ Due by @helpers.date(dueDate) } else { Due by @helpers.date(dueDate) } }.getOrElse { No due date }
} }
}
@issue.flatMap(_.milestoneId).map { milestoneId => @milestones.collect { case (milestone, openCount, closeCount) if(milestone.milestoneId == milestoneId) => @gitbucket.core.issues.milestones.html.progress(openCount + closeCount, closeCount) } }
@issue.flatMap(_.milestoneId).map { milestoneId => @milestones.collect { case (milestone, _, _) if(milestone.milestoneId == milestoneId) => @milestone.title } }.getOrElse { No milestone } @if(issue.isEmpty){ }

Assignee @if(isManageable){
@gitbucket.core.helper.html.dropdown("Edit", right = true, filter = ("assignee", "Filter Assignee")) { @collaborators.map { collaborator =>
- @gitbucket.core.helper.html.checkicon(issueAssignees.exists(_.assigneeUserName == collaborator))@helpers.avatar(collaborator, 20) @collaborator
} }
}
@issueAssignees.map { asignee =>
@helpers.avatarLink(asignee.assigneeUserName, 20) @helpers.user(asignee.assigneeUserName, styleClass="username strong small")
} @if(issueAssignees.isEmpty) { No one assigned } @if(issue.isEmpty){ } @customFields.map { case (field, value) =>

@field.fieldName
@gitbucket.core.model.CustomFieldBehavior(field.fieldType).map { behavior => @if(issue.nonEmpty) { @Html(behavior.fieldHtml(repository, issue.get.issueId, field.fieldId, value.map(_.value).getOrElse(""), isManageable)) } @if(issue.isEmpty) { @Html(behavior.createHtml(repository, field.fieldId)) } }
} @issue.map { issue => @gitbucket.core.plugin.PluginRegistry().getIssueSidebars.map { sidebarComponent => @sidebarComponent(issue, repository, context) }

@defining((issue.openedUserName :: comments.map(_.commentedUserName)).distinct){ participants =>
@participants.size @helpers.plural(participants.size, "participant")
}
@defining((issue.openedUserName :: comments.map(_.commentedUserName)).distinct){ participants => @participants.map { participant => @helpers.avatarLink(participant, 20, tooltip = true) } } }