mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 15:05:50 +01:00
Merge branch 'master' into asciidoctorj
Conflicts: src/main/scala/app/RepositoryViewerController.scala
This commit is contained in:
@@ -16,7 +16,7 @@ trait AvatarImageProvider { self: RequestCache =>
|
||||
val src = if(mailAddress.isEmpty){
|
||||
// by user name
|
||||
getAccountByUserName(userName).map { account =>
|
||||
if(account.image.isEmpty && getSystemSettings().gravatar){
|
||||
if(account.image.isEmpty && context.settings.gravatar){
|
||||
s"""https://www.gravatar.com/avatar/${StringUtil.md5(account.mailAddress.toLowerCase)}?s=${size}"""
|
||||
} else {
|
||||
s"""${context.path}/${account.userName}/_avatar"""
|
||||
@@ -27,13 +27,13 @@ trait AvatarImageProvider { self: RequestCache =>
|
||||
} else {
|
||||
// by mail address
|
||||
getAccountByMailAddress(mailAddress).map { account =>
|
||||
if(account.image.isEmpty && getSystemSettings().gravatar){
|
||||
if(account.image.isEmpty && context.settings.gravatar){
|
||||
s"""https://www.gravatar.com/avatar/${StringUtil.md5(account.mailAddress.toLowerCase)}?s=${size}"""
|
||||
} else {
|
||||
s"""${context.path}/${account.userName}/_avatar"""
|
||||
}
|
||||
} getOrElse {
|
||||
if(getSystemSettings().gravatar){
|
||||
if(context.settings.gravatar){
|
||||
s"""https://www.gravatar.com/avatar/${StringUtil.md5(mailAddress.toLowerCase)}?s=${size}"""
|
||||
} else {
|
||||
s"""${context.path}/_unknown/_avatar"""
|
||||
|
||||
@@ -45,7 +45,7 @@ class GitBucketLinkRender(context: app.Context, repository: service.RepositorySe
|
||||
(text, text)
|
||||
}
|
||||
|
||||
val url = repository.url.replaceFirst("/git/", "/").replaceFirst("\\.git$", "") + "/wiki/" + StringUtil.urlEncode(page)
|
||||
val url = repository.httpUrl.replaceFirst("/git/", "/").replaceFirst("\\.git$", "") + "/wiki/" + StringUtil.urlEncode(page)
|
||||
|
||||
if(getWikiPage(repository.owner, repository.name, page).isDefined){
|
||||
new Rendering(url, label)
|
||||
@@ -104,7 +104,7 @@ class GitBucketHtmlSerializer(
|
||||
if(!enableWikiLink || url.startsWith("http://") || url.startsWith("https://")){
|
||||
url
|
||||
} else {
|
||||
repository.url.replaceFirst("/git/", "/").replaceFirst("\\.git$", "") + "/wiki/_blob/" + url
|
||||
repository.httpUrl.replaceFirst("/git/", "/").replaceFirst("\\.git$", "") + "/wiki/_blob/" + url
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user