mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-05-05 18:07:04 +02:00
Merge pull request #1211 from gitbucket/pull-request-title
Default value of pull request title
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 = "",
|
||||
|
||||
Reference in New Issue
Block a user