1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-09-28 03:06:03 -04:00

show repos in overview also

Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
a1012112796 2024-06-17 17:54:32 +08:00
parent 123a02790c
commit 990584f9bd
No known key found for this signature in database
GPG Key ID: E5FB19032C2C2A64
2 changed files with 6 additions and 10 deletions

View File

@ -120,9 +120,8 @@ func Home(ctx *context.Context) {
ctx.Data["DisableNewPullMirrors"] = setting.Mirror.DisableNewPull
ctx.Data["ShowMemberAndTeamTab"] = ctx.Org.IsMember || len(members) > 0
prepareOrgProfileReadme(ctx)
if ctx.Written() {
return
if !prepareOrgProfileReadme(ctx) {
ctx.Data["PageIsViewRepositories"] = true
}
var (
@ -154,7 +153,6 @@ func Home(ctx *context.Context) {
ctx.Data["Repos"] = repos
ctx.Data["Total"] = count
ctx.Data["PageIsViewRepositories"] = true
pager := context.NewPagination(int(count), setting.UI.User.RepoPagingNum, page, 5)
pager.SetDefaultParams(ctx)
@ -164,18 +162,18 @@ func Home(ctx *context.Context) {
ctx.HTML(http.StatusOK, tplOrgHome)
}
func prepareOrgProfileReadme(ctx *context.Context) {
func prepareOrgProfileReadme(ctx *context.Context) bool {
profileDbRepo, profileGitRepo, profileReadme, profileClose := shared_user.FindUserProfileReadme(ctx, ctx.Doer)
defer profileClose()
ctx.Data["HasProfileReadme"] = profileReadme != nil
if profileGitRepo == nil || profileReadme == nil {
return
return false
}
viewRepositorys := ctx.FormOptionalBool("view_repositorys")
if viewRepositorys.Value() {
return
return false
}
if bytes, err := profileReadme.GetBlobContent(setting.UI.MaxDisplayFileSize); err != nil {
@ -199,5 +197,5 @@ func prepareOrgProfileReadme(ctx *context.Context) {
}
ctx.Data["PageIsViewOverview"] = true
ctx.HTML(http.StatusOK, tplOrgHome)
return true
}

View File

@ -8,11 +8,9 @@
{{if .ProfileReadme}}
<div id="readme_profile" class="markup">{{.ProfileReadme}}</div>
{{end}}
{{if .PageIsViewRepositories}}
{{template "shared/repo_search" .}}
{{template "explore/repo_list" .}}
{{template "base/paginate" .}}
{{end}}
</div>
{{if .ShowMemberAndTeamTab}}