diff --git a/routers/user/profile.go b/routers/user/profile.go index 215dff008..dc1d0a113 100644 --- a/routers/user/profile.go +++ b/routers/user/profile.go @@ -209,6 +209,27 @@ func Profile(ctx *context.Context) { } total = int(count) + case "datasets": + datasetSearchOptions := &models.SearchDatasetOptions{ + Keyword: keyword, + OwnerID: ctxUser.ID, + SearchOrderBy: orderBy, + ListOptions: models.ListOptions{ + Page: page, + PageSize: setting.UI.ExplorePagingNum, + }, + } + + if len(datasetSearchOptions.SearchOrderBy) == 0 { + datasetSearchOptions.SearchOrderBy = models.SearchOrderByAlphabetically + } + + datasets, count, err := models.SearchDataset(datasetSearchOptions) + if err != nil { + ctx.ServerError("SearchDatasets", err) + } + total = int(count) + ctx.Data["datasets"] = datasets default: repos, count, err = models.SearchRepository(&models.SearchRepoOptions{ ListOptions: models.ListOptions{ diff --git a/templates/datasets/dataset_list.tmpl b/templates/datasets/dataset_list.tmpl index aa1006a7b..2d334ef3c 100644 --- a/templates/datasets/dataset_list.tmpl +++ b/templates/datasets/dataset_list.tmpl @@ -1,4 +1,4 @@ -
+
{{range .datasets}}
diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 364bd63fe..e9b84e1b1 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -131,7 +131,9 @@ {{else if eq .TabName "followers"}} {{template "repo/user_cards" .}} {{else if eq .TabName "datasets"}} + {{template "datasets/dataset_search" .}} {{template "datasets/dataset_list" .}} + {{template "base/paginate" .}} {{else}} {{template "explore/repo_search" .}} {{template "explore/repo_list" .}} diff --git a/web_src/less/_dataset.less b/web_src/less/_dataset.less index 23bcb056b..8687b9b09 100644 --- a/web_src/less/_dataset.less +++ b/web_src/less/_dataset.less @@ -53,4 +53,47 @@ } } } +} +.ui.dataset.list { + .item { + padding-bottom: 25px; + + &:not(:first-child) { + border-top: 1px solid #eeeeee; + padding-top: 25px; + } + + .ui.header { + font-size: 1.5rem; + padding-bottom: 10px; + + .name { + word-break: break-all; + } + + .metas { + color: #888888; + font-size: 14px; + font-weight: normal; + + span:not(:last-child) { + margin-right: 5px; + } + } + } + + .time { + font-size: 12px; + color: #808080; + } + + .ui.tags { + margin-bottom: 1em; + } + + .ui.avatar.image { + width: 24px; + height: 24px; + } + } } \ No newline at end of file diff --git a/web_src/less/index.less b/web_src/less/index.less index 7ff44d090..10af0bff1 100644 --- a/web_src/less/index.less +++ b/web_src/less/index.less @@ -17,3 +17,4 @@ @import "_admin"; @import "_explore"; @import "_review"; +@import "_dataset";