1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 22:54:11 +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

@@ -0,0 +1,24 @@
define([
'underscore',
'backbone',
'common',
'sysadmin-app/models/trash-repo'
], function(_, Backbone, Common, TrashRepoModel) {
'use strict';
var TrashRepoCollection = Backbone.Collection.extend({
model: TrashRepoModel,
url: function () {
return Common.getUrl({name: 'admin-trash-libraries'});
},
parse: function(data) {
this.search_owner = data.search_owner;
return data.repos;
}
});
return TrashRepoCollection;
});

View File

@@ -1,20 +1,25 @@
define([
'underscore',
'backbone',
'backbone.paginator',
'common',
'sysadmin-app/models/trash-repo'
], function(_, Backbone, Common, TrashRepoModel) {
], function(_, BackbonePaginator, Common, TrashRepoModel) {
'use strict';
var TrashRepoCollection = Backbone.Collection.extend({
var TrashRepoCollection = Backbone.PageableCollection.extend({
model: TrashRepoModel,
url: function () {
return Common.getUrl({name: 'admin-trash-libraries'});
},
parse: function(data) {
this.search_owner = data.search_owner;
state: {pageSize: 100},
parseState: function(data) {
return data.page_info; // {'has_next_page': has_next_page, 'current_page': current_pag
},
parseRecords: function(data) {
return data.repos;
}