aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/shared/user/header.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/shared/user/header.go')
-rw-r--r--routers/web/shared/user/header.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/routers/web/shared/user/header.go b/routers/web/shared/user/header.go
index 2934f8206e..2e4a8b2a4c 100644
--- a/routers/web/shared/user/header.go
+++ b/routers/web/shared/user/header.go
@@ -44,10 +44,8 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) {
if len(ctx.ContextUser.Description) != 0 {
content, err := markdown.RenderString(&markup.RenderContext{
- URLPrefix: ctx.Repo.RepoLink,
- Metas: map[string]string{"mode": "document"},
- GitRepo: ctx.Repo.GitRepo,
- Ctx: ctx,
+ Metas: map[string]string{"mode": "document"},
+ Ctx: ctx,
}, ctx.ContextUser.Description)
if err != nil {
ctx.ServerError("RenderString", err)
@@ -84,7 +82,7 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) {
}
}
-func FindUserProfileReadme(ctx *context.Context) (profileGitRepo *git.Repository, profileReadmeBlob *git.Blob, profileClose func()) {
+func FindUserProfileReadme(ctx *context.Context) (profileDbRepo *repo_model.Repository, profileGitRepo *git.Repository, profileReadmeBlob *git.Blob, profileClose func()) {
profileDbRepo, err := repo_model.GetRepositoryByName(ctx.ContextUser.ID, ".profile")
if err == nil && !profileDbRepo.IsEmpty && !profileDbRepo.IsPrivate {
if profileGitRepo, err = git.OpenRepository(ctx, profileDbRepo.RepoPath()); err != nil {
@@ -97,7 +95,7 @@ func FindUserProfileReadme(ctx *context.Context) (profileGitRepo *git.Repository
}
}
}
- return profileGitRepo, profileReadmeBlob, func() {
+ return profileDbRepo, profileGitRepo, profileReadmeBlob, func() {
if profileGitRepo != nil {
_ = profileGitRepo.Close()
}
@@ -107,7 +105,7 @@ func FindUserProfileReadme(ctx *context.Context) (profileGitRepo *git.Repository
func RenderUserHeader(ctx *context.Context) {
prepareContextForCommonProfile(ctx)
- _, profileReadmeBlob, profileClose := FindUserProfileReadme(ctx)
+ _, _, profileReadmeBlob, profileClose := FindUserProfileReadme(ctx)
defer profileClose()
ctx.Data["HasProfileReadme"] = profileReadmeBlob != nil
}