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}}
{{if .CanCreateOrgRepo}} -
+
{{ctx.Locale.Tr "new_repo"}} {{if not .DisableNewPullMirrors}} {{ctx.Locale.Tr "new_migrate"}} {{end}}
-
{{end}} {{if .NumMembers}}

@@ -33,7 +32,7 @@ {{$isMember := .IsOrganizationMember}} {{range .Members}} {{if or $isMember (call $.IsPublicMember .ID)}} - {{ctx.AvatarUtils.Avatar . 48}} + {{ctx.AvatarUtils.Avatar . 24}} {{end}} {{end}}

diff --git a/templates/org/menu.tmpl b/templates/org/menu.tmpl index 29238f8d6b..3d490f6787 100644 --- a/templates/org/menu.tmpl +++ b/templates/org/menu.tmpl @@ -20,6 +20,11 @@ {{end}} {{end}} + {{if .HasProfileWiki}} + + {{svg "octicon-book"}} {{ctx.Locale.Tr "repo.wiki"}} + + {{end}} {{if and .IsPackageEnabled .CanReadPackages}} {{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}}