diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl
index 27a0a76bc443b..4d4c4ce9566ac 100644
--- a/templates/user/dashboard/dashboard.tmpl
+++ b/templates/user/dashboard/dashboard.tmpl
@@ -22,7 +22,6 @@
:search-limit="searchLimit"
:suburl="suburl"
:uid="uid"
- :more-repos-link="'{{.ContextUser.HomeLink}}'"
{{if not .ContextUser.IsOrganization}}
:organizations="[
{{range .ContextUser.Orgs}}
@@ -94,7 +93,7 @@
- {{.i18n.Tr "home.show_more_repos"}}
+ {{.i18n.Tr "home.show_more_repos"}}
diff --git a/web_src/js/index.js b/web_src/js/index.js
index b8145fa439912..d4f4a22a079df 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -2736,10 +2736,6 @@ function initVueComponents() {
organizationsTotalCount: {
type: Number,
default: 0
- },
- moreReposLink: {
- type: String,
- default: ''
}
},
@@ -2751,6 +2747,7 @@ function initVueComponents() {
reposFilter: 'all',
searchQuery: '',
isLoading: false,
+ page: 1,
repoTypes: {
all: {
count: 0,
@@ -2783,7 +2780,7 @@ function initVueComponents() {
searchURL() {
return `${this.suburl}/api/v1/repos/search?sort=updated&order=desc&uid=${this.uid}&q=${this.searchQuery
}&limit=${this.searchLimit}&mode=${this.repoTypes[this.reposFilter].searchMode
- }${this.reposFilter !== 'all' ? '&exclusive=1' : ''}`;
+ }${this.reposFilter !== 'all' ? '&exclusive=1' : ''}&page=${this.page}`;
},
repoTypeCount() {
return this.repoTypes[this.reposFilter].count;
@@ -2808,6 +2805,7 @@ function initVueComponents() {
this.reposFilter = filter;
this.repos = [];
this.repoTypes[filter].count = 0;
+ this.page = 1;
this.searchRepos(filter);
},
@@ -2837,7 +2835,11 @@ function initVueComponents() {
$.getJSON(searchedURL, (result, _textStatus, request) => {
if (searchedURL === self.searchURL) {
- self.repos = result.data;
+ if (self.page > 1) {
+ result.data.forEach(repo => self.repos.push(repo));
+ } else {
+ self.repos = result.data;
+ }
const count = request.getResponseHeader('X-Total-Count');
if (searchedQuery === '' && searchedMode === '') {
self.reposTotalCount = count;
@@ -2851,6 +2853,11 @@ function initVueComponents() {
});
},
+ searchMoreRepos() {
+ this.page += 1;
+ this.searchRepos(this.reposFilter);
+ },
+
repoClass(repo) {
if (repo.fork) {
return 'octicon octicon-repo-forked';