From 287a0b66694f66379f90e8c4659cab4443917ff9 Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Mon, 15 Sep 2014 23:47:06 +0900 Subject: [PATCH 01/41] (refs #488)Copy listparts.scala.html from issues/pulls to dashboard. --- src/main/scala/app/DashboardController.scala | 4 +- .../twirl/dashboard/issueslist.scala.html | 184 ++++++++++++++++++ src/main/twirl/dashboard/pullslist.scala.html | 100 ++++++++++ 3 files changed, 286 insertions(+), 2 deletions(-) create mode 100644 src/main/twirl/dashboard/issueslist.scala.html create mode 100644 src/main/twirl/dashboard/pullslist.scala.html diff --git a/src/main/scala/app/DashboardController.scala b/src/main/scala/app/DashboardController.scala index d0a40f092..030f875c8 100644 --- a/src/main/scala/app/DashboardController.scala +++ b/src/main/scala/app/DashboardController.scala @@ -54,7 +54,7 @@ trait DashboardControllerBase extends ControllerBase { val page = IssueSearchCondition.page(request) dashboard.html.issues( - issues.html.listparts( + dashboard.html.issueslist( searchIssue(condition, filterUser, false, (page - 1) * IssueLimit, IssueLimit, userRepos: _*), page, countIssue(condition.copy(state = "open" ), filterUser, false, userRepos: _*), @@ -89,7 +89,7 @@ trait DashboardControllerBase extends ControllerBase { IssueSearchCondition().copy(state = condition.state), Map.empty, true, userRepos: _*) dashboard.html.pulls( - pulls.html.listparts( + dashboard.html.pullslist( searchIssue(condition, filterUser, true, (page - 1) * PullRequestLimit, PullRequestLimit, allRepos: _*), page, countIssue(condition.copy(state = "open" ), filterUser, true, allRepos: _*), diff --git a/src/main/twirl/dashboard/issueslist.scala.html b/src/main/twirl/dashboard/issueslist.scala.html new file mode 100644 index 000000000..8a96492c3 --- /dev/null +++ b/src/main/twirl/dashboard/issueslist.scala.html @@ -0,0 +1,184 @@ +@(issues: List[(model.Issue, List[model.Label], Int)], + page: Int, + 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) +@import context._ +@import view.helpers._ + +
+ @if(condition.labels.nonEmpty || condition.milestoneId.isDefined){ + + Clear milestone and label filters + + } + @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){ + + + + } + } + @issues.map { case (issue, labels, 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 in @date(dueDate) + } else { + Due in @date(dueDate) + } + }.getOrElse { + No due date + } +
    +
    +
  • + } + } +
    + @if(hasWritePermission){ + + } +
    +
    + @helper.html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.IssuesService.IssueLimit, 10, condition.toURL) +
    +
    + diff --git a/src/main/twirl/dashboard/pullslist.scala.html b/src/main/twirl/dashboard/pullslist.scala.html new file mode 100644 index 000000000..c0d0cdc90 --- /dev/null +++ b/src/main/twirl/dashboard/pullslist.scala.html @@ -0,0 +1,100 @@ +@(issues: List[(model.Issue, List[model.Label], Int)], + page: Int, + openCount: Int, + closedCount: Int, + condition: service.IssuesService.IssueSearchCondition, + repository: Option[service.RepositoryService.RepositoryInfo], + hasWritePermission: Boolean)(implicit context: app.Context) +@import context._ +@import view.helpers._ +
    + @repository.map { repository => + @if(hasWritePermission){ +
    + @helper.html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.PullRequestService.PullRequestLimit, 7, condition.toURL) + New pull request +
    + } + } + + @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){ + + + + } + @issues.map { case (issue, labels, commentCount) => + + + + } +
    + No pull requests to show. +
    + + @issue.title + #@issue.issueId +
    + @issue.content.map { content => + @cut(content, 90) + }.getOrElse { + No description available + } +
    +
    + @avatarLink(issue.openedUserName, 20) by @user(issue.openedUserName, styleClass="username") @datetime(issue.registeredDate)  + @if(commentCount > 0){ + @commentCount @plural(commentCount, "comment") + } +
    +
    +
    + @helper.html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.PullRequestService.PullRequestLimit, 10, condition.toURL) +
    +
    \ No newline at end of file From f4e4506517c2f073174720f1be1ad6233648694f Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Tue, 16 Sep 2014 00:46:38 +0900 Subject: [PATCH 02/41] (refs #488)Start to apply new issue UI to the issue list. --- src/main/twirl/issues/list.scala.html | 2 + src/main/twirl/issues/listparts.scala.html | 182 +++++++++--------- src/main/twirl/issues/tab.scala.html | 8 +- .../webapp/assets/common/css/gitbucket.css | 12 +- 4 files changed, 113 insertions(+), 91 deletions(-) diff --git a/src/main/twirl/issues/list.scala.html b/src/main/twirl/issues/list.scala.html index 0e41fbae0..4264e54ba 100644 --- a/src/main/twirl/issues/list.scala.html +++ b/src/main/twirl/issues/list.scala.html @@ -19,6 +19,7 @@ @html.menu("issues", repository){ @tab("issues", false, repository)
    + @*
    + *@ @***** show issue list *****@ @listparts(issues, page, openCount, closedCount, condition, collaborators, milestones, labels, Some(repository), hasWritePermission)
    diff --git a/src/main/twirl/issues/listparts.scala.html b/src/main/twirl/issues/listparts.scala.html index 8a96492c3..972166431 100644 --- a/src/main/twirl/issues/listparts.scala.html +++ b/src/main/twirl/issues/listparts.scala.html @@ -11,7 +11,8 @@ @import context._ @import view.helpers._ -
    +
    + @* @if(condition.labels.nonEmpty || condition.milestoneId.isDefined){ Clear milestone and label filters @@ -72,110 +73,117 @@ } + *@ - @if(issues.isEmpty){ - + - } else { - @if(hasWritePermission){ - - - - } - } - @issues.map { case (issue, labels, commentCount) => - - + + + } else { + @* + @if(hasWritePermission){ + + + + } + *@ + } + @issues.map { case (issue, labels, commentCount) => + + - - } + @if(hasWritePermission){ + + } + + + }
    - No issues to show. - @if(condition.labels.nonEmpty || condition.milestoneId.isDefined){ - Clear active filters. - } else { - @if(repository.isDefined){ - Create a new issue. - } - } - + + @openCount Open + @closedCount Closed +
    -
    - -
    - @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 in @date(dueDate) - } else { - Due in @date(dueDate) - } - }.getOrElse { - No due date - } -
    -
    -
  • - } - } -
    - @if(hasWritePermission){ -
    + 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 in @date(dueDate) + } else { + Due in @date(dueDate) + } + }.getOrElse { + No due date + } +
    +
    +
  • + } + } +
    + @if(hasWritePermission){ +
    @helper.html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.IssuesService.IssueLimit, 10, condition.toURL) diff --git a/src/main/twirl/issues/tab.scala.html b/src/main/twirl/issues/tab.scala.html index b5cfe32f5..f6a4ebded 100644 --- a/src/main/twirl/issues/tab.scala.html +++ b/src/main/twirl/issues/tab.scala.html @@ -1,9 +1,11 @@ @(active: String, create: Boolean, repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context) @import context._ @import view.helpers._ -