diff --git a/src/main/scala/app/PullRequestsController.scala b/src/main/scala/app/PullRequestsController.scala index c3d110a..1f8453c 100644 --- a/src/main/scala/app/PullRequestsController.scala +++ b/src/main/scala/app/PullRequestsController.scala @@ -21,12 +21,12 @@ import service.WebHookService.WebHookPayload class PullRequestsController extends PullRequestsControllerBase - with RepositoryService with AccountService with IssuesService with PullRequestService with MilestonesService with ActivityService with WebHookService - with ReferrerAuthenticator with CollaboratorsAuthenticator + with RepositoryService with AccountService with IssuesService with PullRequestService with MilestonesService with LabelsService + with ActivityService with WebHookService with ReferrerAuthenticator with CollaboratorsAuthenticator trait PullRequestsControllerBase extends ControllerBase { - self: RepositoryService with AccountService with IssuesService with MilestonesService with ActivityService with PullRequestService with WebHookService - with ReferrerAuthenticator with CollaboratorsAuthenticator => + self: RepositoryService with AccountService with IssuesService with MilestonesService with LabelsService + with ActivityService with PullRequestService with WebHookService with ReferrerAuthenticator with CollaboratorsAuthenticator => private val logger = LoggerFactory.getLogger(classOf[PullRequestsControllerBase]) @@ -79,8 +79,10 @@ pulls.html.pullreq( issue, pullreq, getComments(owner, name, issueId), + getIssueLabels(owner, name, issueId.toInt), (getCollaborators(owner, name) ::: (if(getAccountByUserName(owner).get.isGroupAccount) Nil else List(owner))).sorted, getMilestonesWithIssueCount(owner, name), + getLabels(owner, name), commits, diffs, hasWritePermission(owner, name, context.loginAccount), diff --git a/src/main/twirl/issues/issue.scala.html b/src/main/twirl/issues/issue.scala.html index bb8c8df..fdeda57 100644 --- a/src/main/twirl/issues/issue.scala.html +++ b/src/main/twirl/issues/issue.scala.html @@ -33,51 +33,7 @@ }
-
- Labels - @if(hasWritePermission){ -
- @helper.html.dropdown() { - @labels.map { label => -
  • - - @helper.html.checkicon(issueLabels.exists(_.labelId == label.labelId)) -   - @label.labelName - -
  • - } - } -
    - } -
    - + @issues.html.labels(issue, issueLabels, labels, hasWritePermission, repository) } - \ No newline at end of file diff --git a/src/main/twirl/issues/labels.scala.html b/src/main/twirl/issues/labels.scala.html new file mode 100644 index 0000000..187e68e --- /dev/null +++ b/src/main/twirl/issues/labels.scala.html @@ -0,0 +1,51 @@ +@(issue: model.Issue, + issueLabels: List[model.Label], + labels: List[model.Label], + hasWritePermission: Boolean, + repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context) +@import view.helpers._ +
    + Labels + @if(hasWritePermission){ +
    + @helper.html.dropdown() { + @labels.map { label => +
  • + + @helper.html.checkicon(issueLabels.exists(_.labelId == label.labelId)) +   + @label.labelName + +
  • + } + } +
    + } +
    + + diff --git a/src/main/twirl/pulls/discussion.scala.html b/src/main/twirl/pulls/discussion.scala.html index 85e9040..2927caa 100644 --- a/src/main/twirl/pulls/discussion.scala.html +++ b/src/main/twirl/pulls/discussion.scala.html @@ -1,8 +1,10 @@ @(issue: model.Issue, pullreq: model.PullRequest, comments: List[model.IssueComment], + issueLabels: List[model.Label], collaborators: List[String], milestones: List[(model.Milestone, Int, Int)], + labels: List[model.Label], hasWritePermission: Boolean, repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context) @import context._ @@ -63,6 +65,7 @@ @comments.size @plural(comments.size, "comment")
    + @issues.html.labels(issue, issueLabels, labels, hasWritePermission, repository)