Merge pull request #1211 from gitbucket/pull-request-title

Default value of pull request title
This commit is contained in:
Naoki Takezoe
2016-06-01 01:26:55 +09:00
2 changed files with 11 additions and 2 deletions

View File

@@ -354,7 +354,15 @@ trait PullRequestsControllerBase extends ControllerBase {
originRepository.owner, originRepository.name, oldId.getName,
forkedRepository.owner, forkedRepository.name, newId.getName)
val title = if(commits.flatten.length == 1){
commits.flatten.head.shortMessage
} else {
val text = forkedId.replaceAll("[\\-_]", " ")
text.substring(0, 1).toUpperCase + text.substring(1)
}
html.compare(
title,
commits,
diffs,
(forkedRepository.repository.originUserName, forkedRepository.repository.originRepositoryName) match {

View File

@@ -1,4 +1,5 @@
@(commits: Seq[Seq[gitbucket.core.util.JGitUtil.CommitInfo]],
@(title: String,
commits: Seq[Seq[gitbucket.core.util.JGitUtil.CommitInfo]],
diffs: Seq[gitbucket.core.util.JGitUtil.DiffInfo],
members: List[(String, String)],
comments: List[gitbucket.core.model.Comment],
@@ -56,7 +57,7 @@
<div class="row">
<div class="col-md-9">
<span class="error" id="error-title"></span>
<input type="text" name="title" class="form-control" style="margin-bottom: 6px;" placeholder="Title"/>
<input type="text" name="title" value="@title" class="form-control" style="margin-bottom: 6px;" placeholder="Title"/>
@helper.html.preview(
repository = repository,
content = "",