Files
edx-platform/cms/static/js/views/group_configuration_item.js
Eric Fischer 5bc6b31e29 eslint --fix
2017-12-08 14:38:41 -05:00

46 lines
1.3 KiB
JavaScript

/**
* This class defines an controller view for content experiment group configurations.
* It renders an editor view or a details view depending on the state
* of the underlying model.
* It is expected to be backed by a Group model.
*/
define([
'js/views/list_item', 'js/views/group_configuration_details', 'js/views/group_configuration_editor', 'gettext'
], function(
ListItemView, GroupConfigurationDetailsView, GroupConfigurationEditorView, gettext
) {
'use strict';
var GroupConfigurationItemView = ListItemView.extend({
events: {
'click .delete': 'deleteItem'
},
tagName: 'section',
baseClassName: 'group-configuration',
canDelete: true,
// Translators: this refers to a collection of groups.
itemDisplayName: gettext('group configuration'),
attributes: function() {
return {
id: this.model.get('id'),
tabindex: -1
};
},
createEditView: function() {
return new GroupConfigurationEditorView({model: this.model});
},
createDetailsView: function() {
return new GroupConfigurationDetailsView({model: this.model});
}
});
return GroupConfigurationItemView;
});