1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 07:01:12 +00:00

[system admin] trash repos: list by page

This commit is contained in:
llj
2016-06-20 15:47:26 +08:00
parent 9e2617e77b
commit 18a800cb5d
9 changed files with 315 additions and 40 deletions

View File

@@ -12,12 +12,13 @@ define([
'sysadmin-app/views/search-repos',
'sysadmin-app/views/system-repo',
'sysadmin-app/views/trash-repos',
'sysadmin-app/views/search-trash-repos',
'sysadmin-app/views/dir',
'app/views/account'
], function($, Backbone, Common, SideNavView, DashboardView,
DesktopDevicesView, MobileDevicesView, DeviceErrorsView,
ReposView, SearchReposView, SystemReposView, TrashReposView, DirView,
AccountView) {
ReposView, SearchReposView, SystemReposView, TrashReposView,
SearchTrashReposView, DirView, AccountView) {
"use strict";
@@ -32,6 +33,7 @@ define([
'search-libs/': 'showSearchLibraries',
'system-lib/': 'showSystemLibrary',
'trash-libs/': 'showTrashLibraries',
'search-trash-libs/': 'showSearchTrashLibraries',
'libs/:repo_id(/*path)': 'showLibraryDir',
// Default
'*actions': 'showDashboard'
@@ -57,6 +59,7 @@ define([
this.searchReposView = new SearchReposView();
this.systemReposView = new SystemReposView();
this.trashReposView = new TrashReposView();
this.searchTrashReposView = new SearchTrashReposView();
this.dirView = new DirView();
app.ui.accountView = this.accountView = new AccountView();
@@ -152,14 +155,26 @@ define([
this.systemReposView.show();
},
// show trash libs by page
showTrashLibraries: function() {
// url_match: null or an array
var url_match = location.href.match(/.*?page=(\d+)/);
var page = url_match ? url_match[1] : 1; // 1: default
this.switchCurrentView(this.trashReposView);
this.sideNavView.setCurTab('libraries', {'option': 'trash'});
this.trashReposView.show({'page': page});
},
// search trash libs by owner
showSearchTrashLibraries: function() {
// url_match: null or an array
var url_match = location.href.match(/.*?name=(.*)/); // search by owner
var owner = url_match ? url_match[1] : '';
this.switchCurrentView(this.trashReposView);
this.switchCurrentView(this.searchTrashReposView);
this.sideNavView.setCurTab('libraries', {'option': 'trash'});
this.trashReposView.show({'owner': decodeURIComponent(owner)});
this.searchTrashReposView.show({'owner': decodeURIComponent(owner)});
}
});