| @@ -209,6 +209,27 @@ func Profile(ctx *context.Context) { | |||||
| } | } | ||||
| total = int(count) | 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: | default: | ||||
| repos, count, err = models.SearchRepository(&models.SearchRepoOptions{ | repos, count, err = models.SearchRepository(&models.SearchRepoOptions{ | ||||
| ListOptions: models.ListOptions{ | ListOptions: models.ListOptions{ | ||||
| @@ -1,4 +1,4 @@ | |||||
| <div class="ui repository list"> | |||||
| <div class="ui dataset list"> | |||||
| {{range .datasets}} | {{range .datasets}} | ||||
| <div class="item"> | <div class="item"> | ||||
| <div class="ui header"> | <div class="ui header"> | ||||
| @@ -131,7 +131,9 @@ | |||||
| {{else if eq .TabName "followers"}} | {{else if eq .TabName "followers"}} | ||||
| {{template "repo/user_cards" .}} | {{template "repo/user_cards" .}} | ||||
| {{else if eq .TabName "datasets"}} | {{else if eq .TabName "datasets"}} | ||||
| {{template "datasets/dataset_search" .}} | |||||
| {{template "datasets/dataset_list" .}} | {{template "datasets/dataset_list" .}} | ||||
| {{template "base/paginate" .}} | |||||
| {{else}} | {{else}} | ||||
| {{template "explore/repo_search" .}} | {{template "explore/repo_search" .}} | ||||
| {{template "explore/repo_list" .}} | {{template "explore/repo_list" .}} | ||||
| @@ -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; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -17,3 +17,4 @@ | |||||
| @import "_admin"; | @import "_admin"; | ||||
| @import "_explore"; | @import "_explore"; | ||||
| @import "_review"; | @import "_review"; | ||||
| @import "_dataset"; | |||||