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

Create a new milestone }

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

}