|
@@ -259,7 +259,11 @@ func ExploreRepos(ctx *context.Context) { |
|
|
ctx.Data["PageIsExplore"] = true |
|
|
ctx.Data["PageIsExplore"] = true |
|
|
ctx.Data["PageIsExploreRepositories"] = true |
|
|
ctx.Data["PageIsExploreRepositories"] = true |
|
|
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled |
|
|
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled |
|
|
|
|
|
|
|
|
|
|
|
pictureInfo, err := getImageInfo("dashboard-picture") |
|
|
|
|
|
if err == nil && len(pictureInfo) > 0 { |
|
|
|
|
|
ctx.Data["image_url"] = pictureInfo[0]["url"] |
|
|
|
|
|
ctx.Data["image_link"] = pictureInfo[0]["image_link"] |
|
|
|
|
|
} |
|
|
var ownerID int64 |
|
|
var ownerID int64 |
|
|
if ctx.User != nil && !ctx.User.IsAdmin { |
|
|
if ctx.User != nil && !ctx.User.IsAdmin { |
|
|
ownerID = ctx.User.ID |
|
|
ownerID = ctx.User.ID |
|
@@ -434,7 +438,11 @@ func ExploreUsers(ctx *context.Context) { |
|
|
ctx.Data["PageIsExplore"] = true |
|
|
ctx.Data["PageIsExplore"] = true |
|
|
ctx.Data["PageIsExploreUsers"] = true |
|
|
ctx.Data["PageIsExploreUsers"] = true |
|
|
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled |
|
|
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled |
|
|
|
|
|
|
|
|
|
|
|
pictureInfo, err := getImageInfo("explore-user-picture") |
|
|
|
|
|
if err == nil && len(pictureInfo) > 0 { |
|
|
|
|
|
ctx.Data["image_url"] = pictureInfo[0]["url"] |
|
|
|
|
|
ctx.Data["image_link"] = pictureInfo[0]["image_link"] |
|
|
|
|
|
} |
|
|
RenderUserSearch(ctx, &models.SearchUserOptions{ |
|
|
RenderUserSearch(ctx, &models.SearchUserOptions{ |
|
|
Actor: ctx.User, |
|
|
Actor: ctx.User, |
|
|
Type: models.UserTypeIndividual, |
|
|
Type: models.UserTypeIndividual, |
|
@@ -668,8 +676,9 @@ func getRecommendOrg() ([]map[string]interface{}, error) { |
|
|
} |
|
|
} |
|
|
return resultOrg, nil |
|
|
return resultOrg, nil |
|
|
} |
|
|
} |
|
|
func getImageInfo() ([]map[string]interface{}, error) { |
|
|
|
|
|
url := setting.RecommentRepoAddr + "picture_info" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func getImageInfo(filename string) ([]map[string]interface{}, error) { |
|
|
|
|
|
url := setting.RecommentRepoAddr + filename |
|
|
result, err := repository.RecommendFromPromote(url) |
|
|
result, err := repository.RecommendFromPromote(url) |
|
|
|
|
|
|
|
|
if err != nil { |
|
|
if err != nil { |
|
@@ -759,7 +768,7 @@ func RecommendHomeInfo(ctx *context.Context) { |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
log.Info("error." + err.Error()) |
|
|
log.Info("error." + err.Error()) |
|
|
} |
|
|
} |
|
|
resultImage, err := getImageInfo() |
|
|
|
|
|
|
|
|
resultImage, err := getImageInfo("picture_info") |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
log.Info("error." + err.Error()) |
|
|
log.Info("error." + err.Error()) |
|
|
} |
|
|
} |
|
|