diff --git a/src/main/scala/app/DashboardController.scala b/src/main/scala/app/DashboardController.scala index b470f0e..9a3c28f 100644 --- a/src/main/scala/app/DashboardController.scala +++ b/src/main/scala/app/DashboardController.scala @@ -12,7 +12,7 @@ self: IssuesService with PullRequestService with RepositoryService with UsersAuthenticator => get("/dashboard/issues/repos")(usersOnly { - searchIssues("all") + searchIssues("created_by") }) get("/dashboard/issues/assigned")(usersOnly { @@ -54,19 +54,12 @@ val page = IssueSearchCondition.page(request) dashboard.html.issues( - dashboard.html.issueslist( - searchIssue(condition, filterUser, false, (page - 1) * IssueLimit, IssueLimit, userRepos: _*), - page, - countIssue(condition.copy(state = "open" ), filterUser, false, userRepos: _*), - countIssue(condition.copy(state = "closed"), filterUser, false, userRepos: _*), - condition), - countIssue(condition.copy(assigned = None, author = None), filterUser, false, userRepos: _*), - countIssue(condition.copy(assigned = Some(userName), author = None), filterUser, false, userRepos: _*), - countIssue(condition.copy(assigned = None, author = Some(userName)), filterUser, false, userRepos: _*), - countIssueGroupByRepository(condition, filterUser, false, userRepos: _*), - condition, - filter) - + searchIssue(condition, filterUser, false, (page - 1) * IssueLimit, IssueLimit, userRepos: _*), + page, + countIssue(condition.copy(state = "open" ), filterUser, false, userRepos: _*), + countIssue(condition.copy(state = "closed"), filterUser, false, userRepos: _*), + condition, + filter) } private def searchPullRequests(filter: String, repository: Option[String]) = { diff --git a/src/main/twirl/dashboard/issues.scala.html b/src/main/twirl/dashboard/issues.scala.html index f6f9bbb..4d5af5d 100644 --- a/src/main/twirl/dashboard/issues.scala.html +++ b/src/main/twirl/dashboard/issues.scala.html @@ -1,50 +1,14 @@ -@(listparts: play.twirl.api.Html, - allCount: Int, - assignedCount: Int, - createdByCount: Int, - repositories: List[(String, String, Int)], +@(issues: List[service.IssuesService.IssueInfo], + page: Int, + openCount: Int, + closedCount: Int, condition: service.IssuesService.IssueSearchCondition, filter: String)(implicit context: app.Context) @import context._ @import view.helpers._ -@html.main("Your Issues"){ -
- @dashboard.html.tab("issues") -
- - @listparts +@html.main("Issues"){ +
+ @dashboard.html.tab("issues") + @issueslist(issues, page, openCount, closedCount, condition, filter)
-
} diff --git a/src/main/twirl/dashboard/issueslist.scala.html b/src/main/twirl/dashboard/issueslist.scala.html index 4f27ea8..248f688 100644 --- a/src/main/twirl/dashboard/issueslist.scala.html +++ b/src/main/twirl/dashboard/issueslist.scala.html @@ -3,182 +3,113 @@ 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) + filter: String)(implicit context: app.Context) @import context._ @import view.helpers._ @import service.IssuesService.IssueInfo -
- @if(condition.labels.nonEmpty || condition.milestoneId.isDefined){ - - Clear milestone and label filters + + + + + + @issues.map { case IssueInfo(issue, labels, milestone, commentCount) => + + + + } +
+ + + + @openCount Open +    + + + @closedCount Closed - } - @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) -
- - @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){ - - - - } else { - @if(hasWritePermission){ - - - + +
    + @helper.html.dropdown("Visibility", flat = true){ +
  • TODO
  • } - } - @issues.map { case IssueInfo(issue, labels, milestone, commentCount) => -
    - - - } -
    - No issues to show. - @if(condition.labels.nonEmpty || condition.milestoneId.isDefined){ - Clear active filters. - } else { - @if(repository.isDefined){ - Create a new issue. - } - } -
    -
    - -
    - @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 by @date(dueDate) - } else { - Due by @date(dueDate) - } - }.getOrElse { - No due date - } -
    -
    -
  • - } - } -
    - @if(hasWritePermission){ - - } -
    - - - +
    + @if(issue.isPullRequest){ + + } else { + + } + @issue.repositoryName ・ + @if(issue.isPullRequest){ + @issue.title + } else { + @issue.title + } + @labels.map { label => + @label.labelName + } + + @issue.assignedUserName.map { userName => + @avatar(userName, 20, tooltip = true) + } + @if(commentCount > 0){ + + @commentCount + + } else { + + @commentCount + + } + +
    + #@issue.issueId opened by @user(issue.openedUserName, styleClass="username") @datetime(issue.registeredDate) + @milestone.map { milestone => + @milestone + } +
    +
    +
    + @helper.html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.IssuesService.IssueLimit, 10, condition.toURL) +