|
|
|
@@ -274,10 +274,11 @@ func ExploreDatasets(ctx *context.Context) { |
|
|
|
// ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled |
|
|
|
|
|
|
|
var ( |
|
|
|
datasets []*models.Dataset |
|
|
|
count int64 |
|
|
|
err error |
|
|
|
orderBy models.SearchOrderBy |
|
|
|
datasets []*models.Dataset |
|
|
|
datasetsWithStar []*models.DatasetWithStar |
|
|
|
count int64 |
|
|
|
err error |
|
|
|
orderBy models.SearchOrderBy |
|
|
|
) |
|
|
|
page := ctx.QueryInt("page") |
|
|
|
if page <= 0 { |
|
|
|
@@ -338,6 +339,14 @@ func ExploreDatasets(ctx *context.Context) { |
|
|
|
ctx.ServerError("SearchDatasets", err) |
|
|
|
return |
|
|
|
} |
|
|
|
for _, dataset := range datasets { |
|
|
|
if !ctx.IsSigned { |
|
|
|
datasetsWithStar = append(datasetsWithStar, &models.DatasetWithStar{Dataset: *dataset, IsStaring: false}) |
|
|
|
} else { |
|
|
|
datasetsWithStar = append(datasetsWithStar, &models.DatasetWithStar{Dataset: *dataset, IsStaring: models.IsDatasetStaring(ctx.User.ID, dataset.ID)}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pager := context.NewPagination(int(count), opts.PageSize, page, 5) |
|
|
|
ctx.Data["Keyword"] = opts.Keyword |
|
|
|
@@ -347,7 +356,7 @@ func ExploreDatasets(ctx *context.Context) { |
|
|
|
pager.SetDefaultParams(ctx) |
|
|
|
ctx.Data["Page"] = pager |
|
|
|
|
|
|
|
ctx.Data["Datasets"] = datasets |
|
|
|
ctx.Data["Datasets"] = datasetsWithStar |
|
|
|
ctx.Data["Total"] = count |
|
|
|
ctx.Data["PageIsDatasets"] = true |
|
|
|
ctx.HTML(200, tplExploreDataset) |
|
|
|
|