Skip to content

Commit 990584f

Browse files
committed
show repos in overview also
Signed-off-by: a1012112796 <[email protected]>
1 parent 123a027 commit 990584f

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

routers/web/org/home.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,8 @@ func Home(ctx *context.Context) {
120120
ctx.Data["DisableNewPullMirrors"] = setting.Mirror.DisableNewPull
121121
ctx.Data["ShowMemberAndTeamTab"] = ctx.Org.IsMember || len(members) > 0
122122

123-
prepareOrgProfileReadme(ctx)
124-
if ctx.Written() {
125-
return
123+
if !prepareOrgProfileReadme(ctx) {
124+
ctx.Data["PageIsViewRepositories"] = true
126125
}
127126

128127
var (
@@ -154,7 +153,6 @@ func Home(ctx *context.Context) {
154153

155154
ctx.Data["Repos"] = repos
156155
ctx.Data["Total"] = count
157-
ctx.Data["PageIsViewRepositories"] = true
158156

159157
pager := context.NewPagination(int(count), setting.UI.User.RepoPagingNum, page, 5)
160158
pager.SetDefaultParams(ctx)
@@ -164,18 +162,18 @@ func Home(ctx *context.Context) {
164162
ctx.HTML(http.StatusOK, tplOrgHome)
165163
}
166164

167-
func prepareOrgProfileReadme(ctx *context.Context) {
165+
func prepareOrgProfileReadme(ctx *context.Context) bool {
168166
profileDbRepo, profileGitRepo, profileReadme, profileClose := shared_user.FindUserProfileReadme(ctx, ctx.Doer)
169167
defer profileClose()
170168
ctx.Data["HasProfileReadme"] = profileReadme != nil
171169

172170
if profileGitRepo == nil || profileReadme == nil {
173-
return
171+
return false
174172
}
175173

176174
viewRepositorys := ctx.FormOptionalBool("view_repositorys")
177175
if viewRepositorys.Value() {
178-
return
176+
return false
179177
}
180178

181179
if bytes, err := profileReadme.GetBlobContent(setting.UI.MaxDisplayFileSize); err != nil {
@@ -199,5 +197,5 @@ func prepareOrgProfileReadme(ctx *context.Context) {
199197
}
200198

201199
ctx.Data["PageIsViewOverview"] = true
202-
ctx.HTML(http.StatusOK, tplOrgHome)
200+
return true
203201
}

templates/org/home.tmpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88
{{if .ProfileReadme}}
99
<div id="readme_profile" class="markup">{{.ProfileReadme}}</div>
1010
{{end}}
11-
{{if .PageIsViewRepositories}}
1211
{{template "shared/repo_search" .}}
1312
{{template "explore/repo_list" .}}
1413
{{template "base/paginate" .}}
15-
{{end}}
1614
</div>
1715

1816
{{if .ShowMemberAndTeamTab}}

0 commit comments

Comments
 (0)