1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
define([
'components/common/modals',
'components/common/select-list',
'./templates'
], function (Modal) {
return Modal.extend({
template: Templates['groups-users'],
onRender: function () {
this._super();
new window.SelectList({
el: this.$('#groups-users'),
width: '100%',
readOnly: false,
focusSearch: false,
format: function (item) {
return item.name + '<br><span class="note">' + item.login + '</span>';
},
queryParam: 'q',
searchUrl: baseUrl + '/api/usergroups/users?ps=100&id=' + this.model.id,
selectUrl: baseUrl + '/api/usergroups/add_user',
deselectUrl: baseUrl + '/api/usergroups/remove_user',
extra: {
id: this.model.id
},
selectParameter: 'login',
selectParameterValue: 'login',
parse: function (r) {
this.more = false;
return r.users;
}
});
},
onClose: function () {
this.model.collection.refresh();
this._super();
}
});
});
|