diff --git a/src/main/scala/gitbucket/core/controller/IssuesController.scala b/src/main/scala/gitbucket/core/controller/IssuesController.scala index 8fb441a..7c93fa5 100644 --- a/src/main/scala/gitbucket/core/controller/IssuesController.scala +++ b/src/main/scala/gitbucket/core/controller/IssuesController.scala @@ -154,15 +154,25 @@ ajaxPost("/:owner/:repository/issues/edit_title/:id", issueTitleEditForm)(readableUsersOnly { (title, repository) => defining(repository.owner, repository.name) { case (owner, name) => - getIssue(owner, name, params("id")).map { issue => - if (isEditableContent(owner, name, issue.openedUserName)) { - // update issue - updateIssue(owner, name, issue.issueId, title, issue.content) - // extract references and create refer comment - createReferComment(owner, name, issue.copy(title = title), title, context.loginAccount.get) - - redirect(s"/${owner}/${name}/issues/_data/${issue.issueId}") - } else Unauthorized() + getIssue(owner, name, params("id")).map { + issue => + if (isEditableContent(owner, name, issue.openedUserName)) { + if (issue.title != title) { + // update issue + updateIssue(owner, name, issue.issueId, title, issue.content) + // extract references and create refer comment + createReferComment(owner, name, issue.copy(title = title), title, context.loginAccount.get) + createComment( + owner, + name, + context.loginAccount.get.userName, + issue.issueId, + issue.title + "\r\n" + title, + "change_title" + ) + } + redirect(s"/${owner}/${name}/issues/_data/${issue.issueId}") + } else Unauthorized() } getOrElse NotFound() } }) diff --git a/src/main/twirl/gitbucket/core/issues/commentlist.scala.html b/src/main/twirl/gitbucket/core/issues/commentlist.scala.html index b4d87aa..8b49ead 100644 --- a/src/main/twirl/gitbucket/core/issues/commentlist.scala.html +++ b/src/main/twirl/gitbucket/core/issues/commentlist.scala.html @@ -228,6 +228,17 @@ } + case "change_title" => { +
+
+ + @helpers.avatar(comment.commentedUserName, 16) + @helpers.user(comment.commentedUserName, styleClass="username strong") + change title from @comment.content.split("\r\n")(0) to @comment.content.split("\r\n")(1) + @gitbucket.core.helper.html.datetimeago(comment.registeredDate) +
+
+ } case _ => { @showFormattedComment(comment) }