@(state: String, milestones: List[(model.Milestone, Int, Int)], repository: service.RepositoryService.RepositoryInfo, hasWritePermission: Boolean)(implicit context: app.Context) @import context._ @import view.helpers._ @html.main("Milestones - " + repository.owner + "/" + repository.name){ @html.header("milestones", repository) @issues.html.tab("milestones", repository)
@if(hasWritePermission){

Create a new milestone }

@defining(milestones.filter { case (milestone, _, _) => milestone.closedDate.map(_ => state == "closed").getOrElse(state == "open") }){ milestones => @milestones.map { case (milestone, openCount, closedCount) =>
@milestone.title @if(milestone.closedDate.isDefined){ Closed @datetime(milestone.closedDate.get) } else { @if(milestone.dueDate.isDefined){ Due in @date(milestone.dueDate.get) } else { No due date } } @if(closedCount > 0){ } @if(closedCount == 0){ 0% } else { @((closedCount.toDouble / (openCount + closedCount).toDouble * 100).toInt)% } @if(milestone.description.isDefined){ @markdown(milestone.description.get, repository, false, false, false) }
} @if(milestones.isEmpty){
No milestones to show. @if(hasWritePermission){ Create a new milestone. }
} }

}