diff --git a/src/main/scala/app/IssuesController.scala b/src/main/scala/app/IssuesController.scala index 31e7e29..c87c7fc 100644 --- a/src/main/scala/app/IssuesController.scala +++ b/src/main/scala/app/IssuesController.scala @@ -61,6 +61,8 @@ _, getComments(owner, repository, issueId.toInt), getIssueLabel(owner, repository, issueId.toInt), + (getCollaborators(owner, repository) :+ owner).sorted, + getMilestones(owner, repository), getLabels(owner, repository), getRepository(owner, repository, baseUrl).get) } getOrElse NotFound @@ -71,10 +73,13 @@ val owner = params("owner") val repository = params("repository") - getRepository(owner, repository, baseUrl) - .map (issues.html.create((getCollaborators(owner, repository) :+ owner).sorted, - getMilestones(owner, repository), getLabels(owner, repository), _)) - .getOrElse (NotFound) + getRepository(owner, repository, baseUrl).map { + issues.html.create( + (getCollaborators(owner, repository) :+ owner).sorted, + getMilestones(owner, repository), + getLabels(owner, repository), + _) + } getOrElse NotFound }) // TODO requires users only and readable repository checking diff --git a/src/main/twirl/issues/issue.scala.html b/src/main/twirl/issues/issue.scala.html index 9c47585..631dffd 100644 --- a/src/main/twirl/issues/issue.scala.html +++ b/src/main/twirl/issues/issue.scala.html @@ -1,6 +1,8 @@ @(issue: model.Issue, comments: List[model.IssueComment], issueLabels: List[model.Label], + collaborators: List[String], + milestones: List[model.Milestone], labels: List[model.Label], repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context) @import context._ @@ -15,25 +17,59 @@
-
- Edit -
@issue.openedUserName opened this issue @datetime(issue.registeredDate)
-

@issue.title

-
-
- @markdown(issue.content getOrElse "No description given.", repository, false, true, true) +
+
+ Edit +
+ @issue.openedUserName opened this issue @datetime(issue.registeredDate) +
+

@issue.title

+
+
+ + @issue.assignedUserName.map { userName => + @userName is assigned + }.getOrElse("No one is assigned") + + @helper.html.dropdown { +
  • Clear assignee
  • +
  • + @collaborators.map { collaborator => +
  • @collaborator
  • + } + } +
    + + @issue.milestoneId.map { milestoneId => + @milestones.find(_.milestoneId == milestoneId).map { milestone => + Milestone: @milestone.title + } + }.getOrElse("No milestone") + + @helper.html.dropdown { +
  • No milestone
  • +
  • + @milestones.map { milestone => +
  • @milestone.title
  • + } + } +
    +
    +
    + @markdown(issue.content getOrElse "No description given.", repository, false, true, true) +
    @comments.map { comment =>
    - @comment.commentedUserName commented + @comment.commentedUserName commented @datetime(comment.registeredDate)
    -
    +
    @markdown(comment.content, repository, false, true, true)
    @@ -109,6 +145,14 @@ return false; }); + $('a.assign').click(function(){ + alert($(this).data('name')); + }); + + $('a.milestone').click(function(){ + alert($(this).data('id')); + }); + $('i.icon-pencil').click(function(){ var id = $(this).closest('a').data('comment-id'); $.get('@url(repository)/issue_comments/_data/' + id, diff --git a/src/main/webapp/assets/common/css/gitbucket.css b/src/main/webapp/assets/common/css/gitbucket.css index 4440b2a..12c3f2e 100644 --- a/src/main/webapp/assets/common/css/gitbucket.css +++ b/src/main/webapp/assets/common/css/gitbucket.css @@ -401,6 +401,35 @@ padding-left: 8px; } +div.issue-header { + padding-left: 8px; + padding-right: 8px; + padding-top: 12px; + padding-bottom: 12px; +} + +div.issue-info { + border-top: 1px solid #e5e5e5; + border-bottom: 1px solid #e5e5e5; + background-color: #f5f5f5; + padding: 8px; + margin-left: 0px; + margin-right: 0px; +} + +div.issue-content { + padding: 8px; + background-color: #fbfbfb; +} + +h4#issueTitle { + font-size: large; + font-weight: bold; + margin-top: 2px; + margin-bottom: 0px; + padding: 0px; +} + /****************************************************************************/ /* Wiki */ /****************************************************************************/