diff --git a/routers/web/org/home.go b/routers/web/org/home.go index deeb18ae7c..1dc988a324 100644 --- a/routers/web/org/home.go +++ b/routers/web/org/home.go @@ -110,7 +110,7 @@ func home(ctx *context.Context, viewRepositories bool) { ctx.Data["DisableNewPullMirrors"] = setting.Mirror.DisableNewPull ctx.Data["ShowMemberAndTeamTab"] = ctx.Org.IsMember || len(members) > 0 - if !prepareOrgProfileReadme(ctx, viewRepositories) { + if !prepareOrgProfileRepo(ctx, viewRepositories) { ctx.Data["PageIsViewRepositories"] = true } @@ -151,15 +151,18 @@ func home(ctx *context.Context, viewRepositories bool) { ctx.HTML(http.StatusOK, tplOrgHome) } -func prepareOrgProfileReadme(ctx *context.Context, viewRepositories bool) bool { +func prepareOrgProfileRepo(ctx *context.Context, viewRepositories bool) bool { profileDbRepo, profileGitRepo, profileReadme, profileClose := shared_user.FindUserProfileReadme(ctx, ctx.Doer) defer profileClose() - ctx.Data["HasProfileReadme"] = profileReadme != nil if profileGitRepo == nil || profileReadme == nil || viewRepositories { return false } + ctx.Data["OrgProfileRepo"] = profileDbRepo + ctx.Data["HasProfileWiki"] = profileDbRepo.HasWiki() + ctx.Data["HasProfileReadme"] = true + if bytes, err := profileReadme.GetBlobContent(setting.UI.MaxDisplayFileSize); err != nil { log.Error("failed to GetBlobContent: %v", err) } else { diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index 4851b69979..f3e1613fd7 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -16,13 +16,12 @@ {{if .ShowMemberAndTeamTab}}