@(projects: Seq[ReportInfo], watchedProjects: Set[String])(implicit req: DefaultRequest)
@import helper._
@button(action: Call)(label: String) = {
@form(action, 'style -> "display: inline-block"){
@CSRF.formField
}
}
@main("Watch projects"){
@for(
project <- projects;
fullId = project.fullId;
isWatchedThroughParent = project.subprojectNameOption.isDefined && (watchedProjects contains project.projectId);
isWatchedDirectly = watchedProjects contains fullId;
isWatched = isWatchedDirectly || isWatchedThroughParent
){
-
@friendlyProjectName(project)
@if(isWatchedThroughParent){
watched through parent
}else{
@if(isWatchedDirectly){
@button(routes.Notifications.unwatch(fullId))("unwatch")
}else{
@button(routes.Notifications.watch(fullId))("watch")
}
}
}
}