From 7455604f0c8b47023850cd580dc09331b0bf9c88 Mon Sep 17 00:00:00 2001 From: Morlinest Date: Tue, 22 Aug 2017 15:00:34 +0200 Subject: [PATCH] Remove (almost) server side data rendering from repo-search component (#2317) * Rename some shorthands * Remove (almost) server side data rendering from repo-search component template --- public/js/index.js | 24 ++++++- templates/user/dashboard/dashboard.tmpl | 92 ++++++++++++++----------- 2 files changed, 72 insertions(+), 44 deletions(-) diff --git a/public/js/index.js b/public/js/index.js index 1bad33e08..1372afa42 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -1687,13 +1687,33 @@ function initVueComponents(){ type: Number, required: true }, + organizations: { + type: Array, + default: [] + }, + isOrganization: { + type: Boolean, + default: true + }, + canCreateOrganization: { + type: Boolean, + default: false + }, + organizationsTotalCount: { + type: Number, + default: 0 + }, + moreReposLink: { + type: String, + default: '' + } }, data: function() { return { tab: 'repos', repos: [], - reposTotal: 0, + reposTotalCount: 0, reposFilter: 'all', searchQuery: '', isLoading: false @@ -1741,7 +1761,7 @@ function initVueComponents(){ if (searchedQuery == self.searchQuery) { self.repos = result.data; if (searchedQuery == "") { - self.reposTotal = request.getResponseHeader('X-Total-Count'); + self.reposTotalCount = request.getResponseHeader('X-Total-Count'); } } }).always(function() { diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl index e76b1378d..f88ad6705 100644 --- a/templates/user/dashboard/dashboard.tmpl +++ b/templates/user/dashboard/dashboard.tmpl @@ -8,19 +8,34 @@ {{template "user/dashboard/feeds" .}}
- +
- {{if not .ContextUser.IsOrganization}} -