2015-01-21 22:22:34 +08:00
|
|
|
define([
|
|
|
|
'underscore',
|
|
|
|
'backbone',
|
2015-04-11 15:14:56 +08:00
|
|
|
'common',
|
2015-01-21 22:22:34 +08:00
|
|
|
'app/models/group-repo'
|
2015-04-11 15:14:56 +08:00
|
|
|
], function(_, Backbone, Common, GroupRepo) {
|
2015-01-21 22:22:34 +08:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var GroupRepoCollection = Backbone.Collection.extend({
|
|
|
|
model: GroupRepo,
|
2015-01-27 17:32:31 +08:00
|
|
|
comparator: -'mtime',
|
|
|
|
|
2015-04-11 15:14:56 +08:00
|
|
|
url: function() {
|
2015-04-24 13:35:45 +08:00
|
|
|
return Common.getUrl({name: 'group_repos', group_id: this.group_id})+'?from=web';
|
2015-04-11 15:14:56 +08:00
|
|
|
},
|
2015-01-27 17:32:31 +08:00
|
|
|
|
2015-04-20 14:31:22 +08:00
|
|
|
parse: function(data) {
|
|
|
|
this.is_staff = data.is_staff;
|
|
|
|
return data.repos;
|
|
|
|
},
|
|
|
|
|
2015-04-11 15:14:56 +08:00
|
|
|
setGroupID: function(group_id) {
|
|
|
|
this.group_id = group_id;
|
|
|
|
}
|
2015-01-21 22:22:34 +08:00
|
|
|
});
|
|
|
|
|
2015-03-01 20:28:25 +08:00
|
|
|
return GroupRepoCollection;
|
2015-01-21 22:22:34 +08:00
|
|
|
});
|