mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-03 03:55:58 +01:00
Add assignee and milestone to the issue editing form.
This commit is contained in:
@@ -61,6 +61,8 @@ trait IssuesControllerBase extends ControllerBase {
|
|||||||
_,
|
_,
|
||||||
getComments(owner, repository, issueId.toInt),
|
getComments(owner, repository, issueId.toInt),
|
||||||
getIssueLabel(owner, repository, issueId.toInt),
|
getIssueLabel(owner, repository, issueId.toInt),
|
||||||
|
(getCollaborators(owner, repository) :+ owner).sorted,
|
||||||
|
getMilestones(owner, repository),
|
||||||
getLabels(owner, repository),
|
getLabels(owner, repository),
|
||||||
getRepository(owner, repository, baseUrl).get)
|
getRepository(owner, repository, baseUrl).get)
|
||||||
} getOrElse NotFound
|
} getOrElse NotFound
|
||||||
@@ -71,10 +73,13 @@ trait IssuesControllerBase extends ControllerBase {
|
|||||||
val owner = params("owner")
|
val owner = params("owner")
|
||||||
val repository = params("repository")
|
val repository = params("repository")
|
||||||
|
|
||||||
getRepository(owner, repository, baseUrl)
|
getRepository(owner, repository, baseUrl).map {
|
||||||
.map (issues.html.create((getCollaborators(owner, repository) :+ owner).sorted,
|
issues.html.create(
|
||||||
getMilestones(owner, repository), getLabels(owner, repository), _))
|
(getCollaborators(owner, repository) :+ owner).sorted,
|
||||||
.getOrElse (NotFound)
|
getMilestones(owner, repository),
|
||||||
|
getLabels(owner, repository),
|
||||||
|
_)
|
||||||
|
} getOrElse NotFound
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO requires users only and readable repository checking
|
// TODO requires users only and readable repository checking
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
@(issue: model.Issue,
|
@(issue: model.Issue,
|
||||||
comments: List[model.IssueComment],
|
comments: List[model.IssueComment],
|
||||||
issueLabels: List[model.Label],
|
issueLabels: List[model.Label],
|
||||||
|
collaborators: List[String],
|
||||||
|
milestones: List[model.Milestone],
|
||||||
labels: List[model.Label],
|
labels: List[model.Label],
|
||||||
repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@@ -15,25 +17,59 @@
|
|||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span10">
|
<div class="span10">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-content">
|
<div class="box-content" style="padding: 0px;">
|
||||||
<span class="pull-right"><a class="btn btn-small" href="#" id="edit">Edit</a></span>
|
<div class="issue-header">
|
||||||
<div class="small"><a href="@url(issue.openedUserName)">@issue.openedUserName</a> opened this issue @datetime(issue.registeredDate)</div>
|
<span class="pull-right"><a class="btn btn-small" href="#" id="edit">Edit</a></span>
|
||||||
<h4 id="issueTitle">@issue.title</h4>
|
<div class="small muted">
|
||||||
</div>
|
<a href="@url(issue.openedUserName)" class="username">@issue.openedUserName</a> opened this issue @datetime(issue.registeredDate)
|
||||||
<div class="box-content" style="background-color: #f5f5f5;" id="issueContent">
|
</div>
|
||||||
@markdown(issue.content getOrElse "No description given.", repository, false, true, true)
|
<h4 id="issueTitle">@issue.title</h4>
|
||||||
|
</div>
|
||||||
|
<div class="issue-info">
|
||||||
|
<span id="label-assigned">
|
||||||
|
@issue.assignedUserName.map { userName =>
|
||||||
|
<a href="@url(userName)" class="username strong">@userName</a> is assigned
|
||||||
|
}.getOrElse("No one is assigned")
|
||||||
|
</span>
|
||||||
|
@helper.html.dropdown {
|
||||||
|
<li><a href="javascript:void(0);" class="assign" data-name="">Clear assignee</a></li>
|
||||||
|
<li class="divider"></li>
|
||||||
|
@collaborators.map { collaborator =>
|
||||||
|
<li><a href="javascript:void(0);" class="assign" data-name="@collaborator">@collaborator</a></li>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<div class="pull-right">
|
||||||
|
<span id="label-milestone">
|
||||||
|
@issue.milestoneId.map { milestoneId =>
|
||||||
|
@milestones.find(_.milestoneId == milestoneId).map { milestone =>
|
||||||
|
Milestone: <strong>@milestone.title</strong>
|
||||||
|
}
|
||||||
|
}.getOrElse("No milestone")
|
||||||
|
</span>
|
||||||
|
@helper.html.dropdown {
|
||||||
|
<li><a href="javascript:void(0);" class="milestone" data-id="">No milestone</a></li>
|
||||||
|
<li class="divider"></li>
|
||||||
|
@milestones.map { milestone =>
|
||||||
|
<li><a href="javascript:void(0);" class="milestone" data-id="@milestone.milestoneId">@milestone.title</a></li>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="issue-content" id="issueContent">
|
||||||
|
@markdown(issue.content getOrElse "No description given.", repository, false, true, true)
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@comments.map { comment =>
|
@comments.map { comment =>
|
||||||
<div class="box" id="comment-@comment.commentId">
|
<div class="box" id="comment-@comment.commentId">
|
||||||
<div class="box-header-small">
|
<div class="box-header-small">
|
||||||
<a href="@url(comment.commentedUserName)">@comment.commentedUserName</a> commented
|
<a href="@url(comment.commentedUserName)" class="username strong">@comment.commentedUserName</a> commented
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
@datetime(comment.registeredDate)
|
@datetime(comment.registeredDate)
|
||||||
<a href="#" data-comment-id="@comment.commentId"><i class="icon-pencil"></i></a>
|
<a href="#" data-comment-id="@comment.commentId"><i class="icon-pencil"></i></a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-content" style="background-color: #f5f5f5;" id="commentContent-@comment.commentId">
|
<div class="box-content"class="issue-content" id="commentContent-@comment.commentId">
|
||||||
@markdown(comment.content, repository, false, true, true)
|
@markdown(comment.content, repository, false, true, true)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -109,6 +145,14 @@ $(function(){
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('a.assign').click(function(){
|
||||||
|
alert($(this).data('name'));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('a.milestone').click(function(){
|
||||||
|
alert($(this).data('id'));
|
||||||
|
});
|
||||||
|
|
||||||
$('i.icon-pencil').click(function(){
|
$('i.icon-pencil').click(function(){
|
||||||
var id = $(this).closest('a').data('comment-id');
|
var id = $(this).closest('a').data('comment-id');
|
||||||
$.get('@url(repository)/issue_comments/_data/' + id,
|
$.get('@url(repository)/issue_comments/_data/' + id,
|
||||||
|
|||||||
@@ -401,6 +401,35 @@ span.milestone-percentage {
|
|||||||
padding-left: 8px;
|
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 */
|
/* Wiki */
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user