| @@ -59,9 +59,9 @@ type AttachmentUsername struct { | |||||
| } | } | ||||
| type AttachmentInfo struct { | type AttachmentInfo struct { | ||||
| Attachment `xorm:"extends"` | |||||
| Repo *Repository `xorm:"extends"` | |||||
| User *User `xorm:"extends"` | |||||
| Attachment `xorm:"extends"` | |||||
| Repo *Repository `xorm:"extends"` | |||||
| RelAvatarLink string `xorm:"extends"` | |||||
| } | } | ||||
| type AttachmentsOptions struct { | type AttachmentsOptions struct { | ||||
| @@ -595,7 +595,7 @@ func Attachments(opts *AttachmentsOptions) ([]*AttachmentInfo, int64, error) { | |||||
| } | } | ||||
| sess.OrderBy("attachment.created_unix DESC") | sess.OrderBy("attachment.created_unix DESC") | ||||
| attachments := make([]*AttachmentInfo, 0, setting.UI.IssuePagingNum) | |||||
| attachments := make([]*AttachmentInfo, 0, setting.UI.DatasetPagingNum) | |||||
| if err := sess.Table(&Attachment{}).Where(cond). | if err := sess.Table(&Attachment{}).Where(cond). | ||||
| Find(&attachments); err != nil { | Find(&attachments); err != nil { | ||||
| return nil, 0, fmt.Errorf("Find: %v", err) | return nil, 0, fmt.Errorf("Find: %v", err) | ||||
| @@ -615,7 +615,7 @@ func Attachments(opts *AttachmentsOptions) ([]*AttachmentInfo, int64, error) { | |||||
| } | } | ||||
| user, err := GetUserByID(attachment.UploaderID) | user, err := GetUserByID(attachment.UploaderID) | ||||
| if err == nil { | if err == nil { | ||||
| attachment.User = user | |||||
| attachment.RelAvatarLink = user.RelAvatarLink() | |||||
| } else { | } else { | ||||
| return nil, 0, fmt.Errorf("GetUserByID failed error: %v", err) | return nil, 0, fmt.Errorf("GetUserByID failed error: %v", err) | ||||
| } | } | ||||
| @@ -165,6 +165,7 @@ var ( | |||||
| ExplorePagingNum int | ExplorePagingNum int | ||||
| ContributorPagingNum int | ContributorPagingNum int | ||||
| IssuePagingNum int | IssuePagingNum int | ||||
| DatasetPagingNum int | |||||
| RepoSearchPagingNum int | RepoSearchPagingNum int | ||||
| MembersPagingNum int | MembersPagingNum int | ||||
| FeedMaxCommitNum int | FeedMaxCommitNum int | ||||
| @@ -207,6 +208,7 @@ var ( | |||||
| ExplorePagingNum: 20, | ExplorePagingNum: 20, | ||||
| ContributorPagingNum: 50, | ContributorPagingNum: 50, | ||||
| IssuePagingNum: 10, | IssuePagingNum: 10, | ||||
| DatasetPagingNum: 5, | |||||
| RepoSearchPagingNum: 10, | RepoSearchPagingNum: 10, | ||||
| MembersPagingNum: 20, | MembersPagingNum: 20, | ||||
| FeedMaxCommitNum: 5, | FeedMaxCommitNum: 5, | ||||
| @@ -512,9 +514,9 @@ var ( | |||||
| ProfileID string | ProfileID string | ||||
| PoolInfos string | PoolInfos string | ||||
| Flavor string | Flavor string | ||||
| DebugHost string | |||||
| ImageInfos string | |||||
| Capacity int | |||||
| DebugHost string | |||||
| ImageInfos string | |||||
| Capacity int | |||||
| //train-job | //train-job | ||||
| ResourcePools string | ResourcePools string | ||||
| Engines string | Engines string | ||||
| @@ -317,7 +317,7 @@ func CurrentRepoDataset(ctx *context.Context) { | |||||
| datasets, count, err := models.Attachments(&models.AttachmentsOptions{ | datasets, count, err := models.Attachments(&models.AttachmentsOptions{ | ||||
| ListOptions: models.ListOptions{ | ListOptions: models.ListOptions{ | ||||
| Page: page, | Page: page, | ||||
| PageSize: setting.UI.IssuePagingNum, | |||||
| PageSize: setting.UI.DatasetPagingNum, | |||||
| }, | }, | ||||
| Keyword: keyword, | Keyword: keyword, | ||||
| NeedDatasetIDs: true, | NeedDatasetIDs: true, | ||||
| @@ -358,7 +358,7 @@ func MyDatasets(ctx *context.Context) { | |||||
| datasets, count, err := models.Attachments(&models.AttachmentsOptions{ | datasets, count, err := models.Attachments(&models.AttachmentsOptions{ | ||||
| ListOptions: models.ListOptions{ | ListOptions: models.ListOptions{ | ||||
| Page: page, | Page: page, | ||||
| PageSize: setting.UI.IssuePagingNum, | |||||
| PageSize: setting.UI.DatasetPagingNum, | |||||
| }, | }, | ||||
| Keyword: keyword, | Keyword: keyword, | ||||
| NeedDatasetIDs: false, | NeedDatasetIDs: false, | ||||
| @@ -397,7 +397,7 @@ func PublicDataset(ctx *context.Context) { | |||||
| datasets, count, err := models.Attachments(&models.AttachmentsOptions{ | datasets, count, err := models.Attachments(&models.AttachmentsOptions{ | ||||
| ListOptions: models.ListOptions{ | ListOptions: models.ListOptions{ | ||||
| Page: page, | Page: page, | ||||
| PageSize: setting.UI.IssuePagingNum, | |||||
| PageSize: setting.UI.DatasetPagingNum, | |||||
| }, | }, | ||||
| Keyword: keyword, | Keyword: keyword, | ||||
| NeedDatasetIDs: false, | NeedDatasetIDs: false, | ||||
| @@ -451,7 +451,7 @@ func MyFavoriteDataset(ctx *context.Context) { | |||||
| datasets, count, err := models.Attachments(&models.AttachmentsOptions{ | datasets, count, err := models.Attachments(&models.AttachmentsOptions{ | ||||
| ListOptions: models.ListOptions{ | ListOptions: models.ListOptions{ | ||||
| Page: page, | Page: page, | ||||
| PageSize: setting.UI.IssuePagingNum, | |||||
| PageSize: setting.UI.DatasetPagingNum, | |||||
| }, | }, | ||||
| Keyword: keyword, | Keyword: keyword, | ||||
| NeedDatasetIDs: true, | NeedDatasetIDs: true, | ||||