@@ -116,13 +116,12 @@ func home(ctx *context.Context, viewRepositories bool) {
116116 }
117117
118118 // if no profile readme, it still means "view repositories"
119- ctx .Data ["PageIsViewRepositories" ] = viewRepositories || ! prepareOrgProfileReadme (ctx , prepareResult )
119+ isViewOverview := ! viewRepositories && prepareOrgProfileReadme (ctx , prepareResult )
120+ ctx .Data ["PageIsViewRepositories" ] = ! isViewOverview
121+ ctx .Data ["PageIsViewOverview" ] = isViewOverview
122+ ctx .Data ["ShowOrgProfileReadmeSelector" ] = isViewOverview && prepareResult .ProfilePublicReadmeBlob != nil && prepareResult .ProfilePrivateReadmeBlob != nil
120123
121- var (
122- repos []* repo_model.Repository
123- count int64
124- )
125- repos , count , err = repo_model .SearchRepository (ctx , & repo_model.SearchRepoOptions {
124+ repos , count , err := repo_model .SearchRepository (ctx , & repo_model.SearchRepoOptions {
126125 ListOptions : db.ListOptions {
127126 PageSize : setting .UI .User .RepoPagingNum ,
128127 Page : page ,
@@ -156,7 +155,7 @@ func home(ctx *context.Context, viewRepositories bool) {
156155}
157156
158157func prepareOrgProfileReadme (ctx * context.Context , prepareResult * shared_user.PrepareOrgHeaderResult ) bool {
159- viewAs := ctx .FormString ("view_as" )
158+ viewAs := ctx .FormString ("view_as" , util . Iif ( ctx . Org . IsMember , "member" , "public" ) )
160159 viewAsMember := viewAs == "member"
161160
162161 var profileRepo * repo_model.Repository
0 commit comments