diff --git a/src/main/scala/gitbucket/core/view/helpers.scala b/src/main/scala/gitbucket/core/view/helpers.scala index 33fdce9..570e9b1 100644 --- a/src/main/scala/gitbucket/core/view/helpers.scala +++ b/src/main/scala/gitbucket/core/view/helpers.scala @@ -225,6 +225,13 @@ def avatarLink(userName: String, size: Int, mailAddress: String = "", tooltip: Boolean = false)(implicit context: Context): Html = userWithContent(userName, mailAddress)(avatar(userName, size, tooltip, mailAddress)) + /** + * Generates the avatar link to the account page. + * If user does not exist or disabled, this method returns avatar image without link. + */ + def avatarLink(commit: JGitUtil.CommitInfo, size: Int)(implicit context: Context): Html = + userWithContent(commit.authorName, commit.authorEmailAddress)(avatar(commit, size)) + private def userWithContent(userName: String, mailAddress: String = "", styleClass: String = "")(content: Html)(implicit context: Context): Html = (if(mailAddress.isEmpty){ getAccountByUserName(userName) diff --git a/src/main/twirl/gitbucket/core/account/main.scala.html b/src/main/twirl/gitbucket/core/account/main.scala.html index 0e17090..dcf5a40 100644 --- a/src/main/twirl/gitbucket/core/account/main.scala.html +++ b/src/main/twirl/gitbucket/core/account/main.scala.html @@ -22,7 +22,7 @@