Skip to content

Commit c0168bf

Browse files
committed
fix
1 parent 35c86af commit c0168bf

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
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/home.tmpl

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616
{{if .ShowMemberAndTeamTab}}
1717
<div class="ui five wide column">
1818
{{if .CanCreateOrgRepo}}
19-
<div class="center aligned tw-mb-4">
19+
<div class="flex-text-block tw-flex-wrap tw-justify-end tw-mb-4">
2020
<a class="ui primary button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}">{{ctx.Locale.Tr "new_repo"}}</a>
2121
{{if not .DisableNewPullMirrors}}
2222
<a class="ui primary button" href="{{AppSubUrl}}/repo/migrate?org={{.Org.ID}}&mirror=1">{{ctx.Locale.Tr "new_migrate"}}</a>
2323
{{end}}
2424
</div>
25-
<div class="divider"></div>
2625
{{end}}
2726
{{if .NumMembers}}
2827
<h4 class="ui top attached header tw-flex">
@@ -33,7 +32,7 @@
3332
{{$isMember := .IsOrganizationMember}}
3433
{{range .Members}}
3534
{{if or $isMember (call $.IsPublicMember .ID)}}
36-
<a href="{{.HomeLink}}" title="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}">{{ctx.AvatarUtils.Avatar . 48}}</a>
35+
<a href="{{.HomeLink}}" data-tooltip-content="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}">{{ctx.AvatarUtils.Avatar . 24}}</a>
3736
{{end}}
3837
{{end}}
3938
</div>

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)