1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-29 16:37:56 +00:00
seahub/static/scripts/app/collections/group-repos.js

29 lines
638 B
JavaScript
Raw Normal View History

2015-01-21 14:22:34 +00:00
define([
'underscore',
'backbone',
2015-04-11 07:14:56 +00:00
'common',
2015-01-21 14:22:34 +00:00
'app/models/group-repo'
2015-04-11 07:14:56 +00:00
], function(_, Backbone, Common, GroupRepo) {
2015-01-21 14:22:34 +00:00
'use strict';
var GroupRepoCollection = Backbone.Collection.extend({
model: GroupRepo,
2015-01-27 09:32:31 +00:00
comparator: -'mtime',
2015-04-11 07:14:56 +00:00
url: function() {
return Common.getUrl({name: 'group_repos', group_id: this.group_id});
2015-04-11 07:14:56 +00:00
},
2015-01-27 09:32:31 +00:00
parse: function(data) {
this.is_staff = data.is_staff;
return data.repos;
},
2015-04-11 07:14:56 +00:00
setGroupID: function(group_id) {
this.group_id = group_id;
}
2015-01-21 14:22:34 +00:00
});
return GroupRepoCollection;
2015-01-21 14:22:34 +00:00
});