Admin ("Instructor") - Can edit and assign permissions to other users
Normal ("Staff") - Can edit
User - Can view the library and use content from it but cannot edit it or its blocks.
24 lines
910 B
JavaScript
24 lines
910 B
JavaScript
define([
|
|
'jquery', 'underscore', 'js/models/xblock_info', 'js/views/pages/paged_container',
|
|
'js/views/library_container', 'js/collections/component_template', 'xmodule', 'coffee/src/main',
|
|
'xblock/cms.runtime.v1'
|
|
],
|
|
function($, _, XBlockInfo, PagedContainerPage, LibraryContainerView, ComponentTemplates, xmoduleLoader) {
|
|
'use strict';
|
|
return function (componentTemplates, XBlockInfoJson, options) {
|
|
var main_options = {
|
|
el: $('#content'),
|
|
model: new XBlockInfo(XBlockInfoJson, {parse: true}),
|
|
templates: new ComponentTemplates(componentTemplates, {parse: true}),
|
|
action: 'view',
|
|
viewClass: LibraryContainerView,
|
|
canEdit: true
|
|
};
|
|
|
|
xmoduleLoader.done(function () {
|
|
var view = new PagedContainerPage(_.extend(main_options, options));
|
|
view.render();
|
|
});
|
|
};
|
|
});
|