2018-07-06 17:48:14 -07:00
|
|
|
/* global Whisper, i18n */
|
|
|
|
|
|
|
|
// eslint-disable-next-line func-names
|
2018-04-27 17:25:04 -04:00
|
|
|
(function() {
|
|
|
|
'use strict';
|
2018-07-06 17:48:14 -07:00
|
|
|
|
2018-04-27 17:25:04 -04:00
|
|
|
window.Whisper = window.Whisper || {};
|
2015-08-04 12:15:37 -07:00
|
|
|
|
2018-04-27 17:25:04 -04:00
|
|
|
// TODO: take a title string which could replace the 'members' header
|
|
|
|
Whisper.GroupMemberList = Whisper.View.extend({
|
|
|
|
className: 'group-member-list panel',
|
|
|
|
templateName: 'group-member-list',
|
2018-07-06 17:48:14 -07:00
|
|
|
initialize(options) {
|
2018-04-27 17:25:04 -04:00
|
|
|
this.needVerify = options.needVerify;
|
2017-06-16 16:48:06 -07:00
|
|
|
|
2018-04-27 17:25:04 -04:00
|
|
|
this.render();
|
2017-06-10 12:18:24 -07:00
|
|
|
|
2018-04-27 17:25:04 -04:00
|
|
|
this.member_list_view = new Whisper.ContactListView({
|
|
|
|
collection: this.model,
|
|
|
|
className: 'members',
|
|
|
|
toInclude: {
|
|
|
|
listenBack: options.listenBack,
|
2015-08-04 12:15:37 -07:00
|
|
|
},
|
2018-04-27 17:25:04 -04:00
|
|
|
});
|
|
|
|
this.member_list_view.render();
|
|
|
|
|
|
|
|
this.$('.container').append(this.member_list_view.el);
|
|
|
|
},
|
2018-07-06 17:48:14 -07:00
|
|
|
render_attributes() {
|
|
|
|
let summary;
|
2018-04-27 17:25:04 -04:00
|
|
|
if (this.needVerify) {
|
|
|
|
summary = i18n('membersNeedingVerification');
|
|
|
|
}
|
2017-06-16 16:48:06 -07:00
|
|
|
|
2018-04-27 17:25:04 -04:00
|
|
|
return {
|
|
|
|
members: i18n('groupMembers'),
|
2018-07-06 17:48:14 -07:00
|
|
|
summary,
|
2018-04-27 17:25:04 -04:00
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|
2015-08-04 12:15:37 -07:00
|
|
|
})();
|