Skip to content

Commit 4d227f3

Browse files
committed
fix
1 parent 35c86af commit 4d227f3

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

routers/web/org/home.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func home(ctx *context.Context, viewRepositories bool) {
111111
ctx.Data["DisableNewPullMirrors"] = setting.Mirror.DisableNewPull
112112
ctx.Data["ShowMemberAndTeamTab"] = ctx.Org.IsMember || len(members) > 0
113113

114-
if !prepareOrgProfileReadme(ctx, viewRepositories) {
114+
if !prepareOrgProfileRepo(ctx, viewRepositories) {
115115
ctx.Data["PageIsViewRepositories"] = true
116116
}
117117

@@ -168,15 +168,18 @@ func home(ctx *context.Context, viewRepositories bool) {
168168
ctx.HTML(http.StatusOK, tplOrgHome)
169169
}
170170

171-
func prepareOrgProfileReadme(ctx *context.Context, viewRepositories bool) bool {
171+
func prepareOrgProfileRepo(ctx *context.Context, viewRepositories bool) bool {
172172
profileDbRepo, profileGitRepo, profileReadme, profileClose := shared_user.FindUserProfileReadme(ctx, ctx.Doer)
173173
defer profileClose()
174-
ctx.Data["HasProfileReadme"] = profileReadme != nil
175174

176175
if profileGitRepo == nil || profileReadme == nil || viewRepositories {
177176
return false
178177
}
179178

179+
ctx.Data["OrgProfileRepo"] = profileDbRepo
180+
ctx.Data["HasProfileWiki"] = profileDbRepo.HasWiki()
181+
ctx.Data["HasProfileReadme"] = true
182+
180183
if bytes, err := profileReadme.GetBlobContent(setting.UI.MaxDisplayFileSize); err != nil {
181184
log.Error("failed to GetBlobContent: %v", err)
182185
} else {

templates/org/menu.tmpl

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
{{end}}
2121
</a>
2222
{{end}}
23+
{{if .HasProfileWiki}}
24+
<a class="item" href="{{$.OrgProfileRepo.Link}}/wiki">
25+
{{svg "octicon-book"}} {{ctx.Locale.Tr "repo.wiki"}}
26+
</a>
27+
{{end}}
2328
{{if and .IsPackageEnabled .CanReadPackages}}
2429
<a class="{{if .IsPackagesPage}}active {{end}}item" href="{{$.Org.HomeLink}}/-/packages">
2530
{{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}}

0 commit comments

Comments
 (0)