Commit eff80bae by Diana Huang Committed by cahrens

Convert cohort JS to use RequireJS.

parent 1ceb8a0d
var edx = edx || {}; ;(function (define) {
(function(Backbone, CohortModel) {
'use strict'; 'use strict';
define(['backbone', 'js/groups/models/cohort'], function(Backbone, CohortModel) {
edx.groups = edx.groups || {}; var CohortCollection = Backbone.Collection.extend({
model : CohortModel,
edx.groups.CohortCollection = Backbone.Collection.extend({ comparator: "name",
model : CohortModel,
comparator: "name",
parse: function(response) { parse: function(response) {
return response.cohorts; return response.cohorts;
} }
});
return CohortCollection;
}); });
}).call(this, Backbone, edx.groups.CohortModel); }).call(this, define || RequireJS.define);
var edx = edx || {}; ;(function (define) {
(function(Backbone) {
'use strict'; 'use strict';
define(['backbone'], function(Backbone) {
edx.groups = edx.groups || {}; var CohortModel = Backbone.Model.extend({
idAttribute: 'id',
edx.groups.CohortModel = Backbone.Model.extend({ defaults: {
idAttribute: 'id', name: '',
defaults: { user_count: 0,
name: '', /**
user_count: 0, * Indicates how students are added to the cohort. Will be "none" (signifying manual assignment) or
/** * "random" (indicating students are randomly assigned).
* Indicates how students are added to the cohort. Will be "none" (signifying manual assignment) or */
* "random" (indicating students are randomly assigned). assignment_type: '',
*/ /**
assignment_type: '', * If this cohort is associated with a user partition group, the ID of the user partition.
/** */
* If this cohort is associated with a user partition group, the ID of the user partition. user_partition_id: null,
*/ /**
user_partition_id: null, * If this cohort is associated with a user partition group, the ID of the group within the
/** * partition associated with user_partition_id.
* If this cohort is associated with a user partition group, the ID of the group within the */
* partition associated with user_partition_id. group_id: null
*/ }
group_id: null });
} return CohortModel;
}); });
}).call(this, Backbone); }).call(this, define || RequireJS.define);
var edx = edx || {}; ;(function (define) {
(function(Backbone) {
'use strict'; 'use strict';
define(['backbone'], function(Backbone) {
edx.groups = edx.groups || {}; var DiscussionTopicsSettingsModel = Backbone.Model.extend({
defaults: {
edx.groups.DiscussionTopicsSettingsModel = Backbone.Model.extend({ course_wide_discussions: {},
defaults: { inline_discussions: {}
course_wide_discussions: {}, }
inline_discussions: {} });
} return DiscussionTopicsSettingsModel;
}); });
}).call(this, Backbone); }).call(this, define || RequireJS.define);
var edx = edx || {}; ;(function (define) {
(function(Backbone) {
'use strict'; 'use strict';
define(['backbone'], function(Backbone) {
edx.groups = edx.groups || {}; var ContentGroupModel = Backbone.Model.extend({
idAttribute: 'id',
edx.groups.ContentGroupModel = Backbone.Model.extend({ defaults: {
idAttribute: 'id', name: '',
defaults: { user_partition_id: null
name: '', }
user_partition_id: null });
} return ContentGroupModel;
}); });
}).call(this, Backbone); }).call(this, define || RequireJS.define);
var edx = edx || {}; ;(function (define) {
(function(Backbone) {
'use strict'; 'use strict';
define(['backbone'], function(Backbone) {
edx.groups = edx.groups || {}; var CourseCohortSettingsModel = Backbone.Model.extend({
idAttribute: 'id',
edx.groups.CourseCohortSettingsModel = Backbone.Model.extend({ defaults: {
idAttribute: 'id', is_cohorted: false,
defaults: { cohorted_inline_discussions: [],
is_cohorted: false, cohorted_course_wide_discussions:[],
cohorted_inline_discussions: [], always_cohort_inline_discussions: true
cohorted_course_wide_discussions:[], }
always_cohort_inline_discussions: true });
} return CourseCohortSettingsModel;
}); });
}).call(this, Backbone); }).call(this, define || RequireJS.define);
var edx = edx || {}; ;(function (define) {
(function ($, _, Backbone, gettext, interpolate_text, NotificationModel, NotificationView) {
'use strict'; 'use strict';
define(['jquery', 'underscore', 'backbone', 'gettext', 'js/models/notification', 'js/views/notification'],
function ($, _, Backbone) {
edx.groups = edx.groups || {}; var CohortDiscussionConfigurationView = Backbone.View.extend({
edx.groups.CohortDiscussionConfigurationView = Backbone.View.extend({ /**
* Add/Remove the disabled attribute on given element.
* @param {object} $element - The element to disable/enable.
* @param {bool} disable - The flag to add/remove 'disabled' attribute.
*/
setDisabled: function($element, disable) {
$element.prop('disabled', disable ? 'disabled' : false);
},
/** /**
* Add/Remove the disabled attribute on given element. * Returns the cohorted discussions list.
* @param {object} $element - The element to disable/enable. * @param {string} selector - To select the discussion elements whose ids to return.
* @param {bool} disable - The flag to add/remove 'disabled' attribute. * @returns {Array} - Cohorted discussions.
*/ */
setDisabled: function($element, disable) { getCohortedDiscussions: function(selector) {
$element.prop('disabled', disable ? 'disabled' : false); var self=this,
}, cohortedDiscussions = [];
/** _.each(self.$(selector), function (topic) {
* Returns the cohorted discussions list. cohortedDiscussions.push($(topic).data('id'))
* @param {string} selector - To select the discussion elements whose ids to return. });
* @returns {Array} - Cohorted discussions. return cohortedDiscussions;
*/ },
getCohortedDiscussions: function(selector) {
var self=this,
cohortedDiscussions = [];
_.each(self.$(selector), function (topic) { /**
cohortedDiscussions.push($(topic).data('id')) * Save the cohortSettings' changed attributes to the server via PATCH method.
}); * It shows the error message(s) if any.
return cohortedDiscussions; * @param {object} $element - Messages would be shown before this element.
}, * @param {object} fieldData - Data to update on the server.
*/
saveForm: function ($element, fieldData) {
var self = this,
cohortSettingsModel = this.cohortSettings,
saveOperation = $.Deferred(),
showErrorMessage;
/** showErrorMessage = function (message, $element) {
* Save the cohortSettings' changed attributes to the server via PATCH method. self.showMessage(message, $element, 'error');
* It shows the error message(s) if any. };
* @param {object} $element - Messages would be shown before this element. this.removeNotification();
* @param {object} fieldData - Data to update on the server.
*/
saveForm: function ($element, fieldData) {
var self = this,
cohortSettingsModel = this.cohortSettings,
saveOperation = $.Deferred(),
showErrorMessage;
showErrorMessage = function (message, $element) { cohortSettingsModel.save(
self.showMessage(message, $element, 'error'); fieldData, {patch: true, wait: true}
}; ).done(function () {
this.removeNotification(); saveOperation.resolve();
}).fail(function (result) {
var errorMessage = null;
try {
var jsonResponse = JSON.parse(result.responseText);
errorMessage = jsonResponse.error;
} catch (e) {
// Ignore the exception and show the default error message instead.
}
if (!errorMessage) {
errorMessage = gettext("We've encountered an error. Refresh your browser and then try again.");
}
showErrorMessage(errorMessage, $element);
saveOperation.reject();
});
return saveOperation.promise();
},
cohortSettingsModel.save( /**
fieldData, {patch: true, wait: true} * Shows the notification messages before given element using the NotificationModel.
).done(function () { * @param {string} message - Text message to show.
saveOperation.resolve(); * @param {object} $element - Message would be shown before this element.
}).fail(function (result) { * @param {string} type - Type of message to show e.g. confirmation or error.
var errorMessage = null; */
try { showMessage: function (message, $element, type) {
var jsonResponse = JSON.parse(result.responseText); var model = new NotificationModel({type: type || 'confirmation', title: message});
errorMessage = jsonResponse.error; this.removeNotification();
} catch (e) { this.notification = new NotificationView({
// Ignore the exception and show the default error message instead. model: model
} });
if (!errorMessage) { $element.before(this.notification.$el);
errorMessage = gettext("We've encountered an error. Refresh your browser and then try again."); this.notification.render();
},
/**
*Removes the notification messages.
*/
removeNotification: function () {
if (this.notification) {
this.notification.remove();
}
} }
showErrorMessage(errorMessage, $element);
saveOperation.reject();
});
return saveOperation.promise();
},
/**
* Shows the notification messages before given element using the NotificationModel.
* @param {string} message - Text message to show.
* @param {object} $element - Message would be shown before this element.
* @param {string} type - Type of message to show e.g. confirmation or error.
*/
showMessage: function (message, $element, type) {
var model = new NotificationModel({type: type || 'confirmation', title: message});
this.removeNotification();
this.notification = new NotificationView({
model: model
}); });
$element.before(this.notification.$el); return CohortDiscussionConfigurationView;
this.notification.render(); });
}, }).call(this, define || RequireJS.define);
/**
*Removes the notification messages.
*/
removeNotification: function () {
if (this.notification) {
this.notification.remove();
}
}
});
}).call(this, $, _, Backbone, gettext, interpolate_text, NotificationModel, NotificationView
);
var edx = edx || {}; ;(function (define) {
(function ($, _, Backbone, gettext, interpolate_text, CohortDiscussionConfigurationView) {
'use strict'; 'use strict';
define(['jquery', 'underscore', 'backbone', 'gettext', 'js/groups/views/cohort_discussions'],
function ($, _, Backbone, gettext, CohortDiscussionConfigurationView) {
var CourseWideDiscussionsView = CohortDiscussionConfigurationView.extend({
events: {
'change .check-discussion-subcategory-course-wide': 'discussionCategoryStateChanged',
'click .cohort-course-wide-discussions-form .action-save': 'saveCourseWideDiscussionsForm'
},
edx.groups = edx.groups || {}; initialize: function (options) {
this.template = _.template($('#cohort-discussions-course-wide-tpl').text());
edx.groups.CourseWideDiscussionsView = CohortDiscussionConfigurationView.extend({ this.cohortSettings = options.cohortSettings;
events: { },
'change .check-discussion-subcategory-course-wide': 'discussionCategoryStateChanged',
'click .cohort-course-wide-discussions-form .action-save': 'saveCourseWideDiscussionsForm'
},
initialize: function (options) { render: function () {
this.template = _.template($('#cohort-discussions-course-wide-tpl').text()); this.$('.cohort-course-wide-discussions-nav').html(this.template({
this.cohortSettings = options.cohortSettings; courseWideTopics: this.getCourseWideDiscussionsHtml(
}, this.model.get('course_wide_discussions')
)
}));
this.setDisabled(this.$('.cohort-course-wide-discussions-form .action-save'), true);
},
render: function () { /**
this.$('.cohort-course-wide-discussions-nav').html(this.template({ * Returns the html list for course-wide discussion topics.
courseWideTopics: this.getCourseWideDiscussionsHtml( * @param {object} courseWideDiscussions - course-wide discussions object from server.
this.model.get('course_wide_discussions') * @returns {Array} - HTML list for course-wide discussion topics.
) */
})); getCourseWideDiscussionsHtml: function (courseWideDiscussions) {
this.setDisabled(this.$('.cohort-course-wide-discussions-form .action-save'), true); var subCategoryTemplate = _.template($('#cohort-discussions-subcategory-tpl').html()),
}, entries = courseWideDiscussions.entries,
children = courseWideDiscussions.children;
/** return _.map(children, function (name) {
* Returns the html list for course-wide discussion topics. var entry = entries[name];
* @param {object} courseWideDiscussions - course-wide discussions object from server. return subCategoryTemplate({
* @returns {Array} - HTML list for course-wide discussion topics. name: name,
*/ id: entry.id,
getCourseWideDiscussionsHtml: function (courseWideDiscussions) { is_cohorted: entry.is_cohorted,
var subCategoryTemplate = _.template($('#cohort-discussions-subcategory-tpl').html()), type: 'course-wide'
entries = courseWideDiscussions.entries, });
children = courseWideDiscussions.children; }).join('');
},
return _.map(children, function (name) { /**
var entry = entries[name]; * Enables the save button for course-wide discussions.
return subCategoryTemplate({ */
name: name, discussionCategoryStateChanged: function(event) {
id: entry.id, event.preventDefault();
is_cohorted: entry.is_cohorted, this.setDisabled(this.$('.cohort-course-wide-discussions-form .action-save'), false);
type: 'course-wide' },
});
}).join('');
},
/** /**
* Enables the save button for course-wide discussions. * Sends the cohorted_course_wide_discussions to the server and renders the view.
*/ */
discussionCategoryStateChanged: function(event) { saveCourseWideDiscussionsForm: function (event) {
event.preventDefault(); event.preventDefault();
this.setDisabled(this.$('.cohort-course-wide-discussions-form .action-save'), false);
},
/** var self = this,
* Sends the cohorted_course_wide_discussions to the server and renders the view. courseWideCohortedDiscussions = self.getCohortedDiscussions(
*/ '.check-discussion-subcategory-course-wide:checked'
saveCourseWideDiscussionsForm: function (event) { ),
event.preventDefault(); fieldData = { cohorted_course_wide_discussions: courseWideCohortedDiscussions };
var self = this, self.saveForm(self.$('.course-wide-discussion-topics'),fieldData)
courseWideCohortedDiscussions = self.getCohortedDiscussions( .done(function () {
'.check-discussion-subcategory-course-wide:checked' self.model.fetch()
), .done(function () {
fieldData = { cohorted_course_wide_discussions: courseWideCohortedDiscussions }; self.render();
self.showMessage(gettext('Your changes have been saved.'), self.$('.course-wide-discussion-topics'));
}).fail(function() {
var errorMessage = gettext("We've encountered an error. Refresh your browser and then try again.");
self.showMessage(errorMessage, self.$('.course-wide-discussion-topics'), 'error')
});
});
}
self.saveForm(self.$('.course-wide-discussion-topics'),fieldData) });
.done(function () { return CourseWideDiscussionsView;
self.model.fetch() });
.done(function () { }).call(this, define || RequireJS.define);
self.render();
self.showMessage(gettext('Your changes have been saved.'), self.$('.course-wide-discussion-topics'));
}).fail(function() {
var errorMessage = gettext("We've encountered an error. Refresh your browser and then try again.");
self.showMessage(errorMessage, self.$('.course-wide-discussion-topics'), 'error')
});
});
}
});
}).call(this, $, _, Backbone, gettext, interpolate_text, edx.groups.CohortDiscussionConfigurationView);
;(function (define, undefined) { ;(function (define, undefined) {
'use strict'; 'use strict';
define(['jquery', 'js/groups/views/cohorts', 'js/groups/collections/cohort', 'js/groups/models/course_cohort_settings', define(['jquery', 'js/groups/views/cohorts', 'js/groups/collections/cohort', 'js/groups/models/course_cohort_settings',
'js/groups/models/cohort_discussions'], 'js/groups/models/cohort_discussions', 'js/groups/models/content_group'],
function($) { function($, CohortsView, CohortCollection, CourseCohortSettingsModel, DiscussionTopicsSettingsModel, ContentGroupModel) {
return function(contentGroups, studioGroupConfigurationsUrl) { return function(contentGroups, studioGroupConfigurationsUrl) {
var contentGroupModels = $.map(contentGroups, function(group) {
return new ContentGroupModel({
id: group.id,
name: group.name,
user_partition_id: group.user_partition_id
});
});
var cohorts = new edx.groups.CohortCollection(), var cohorts = new CohortCollection(),
courseCohortSettings = new edx.groups.CourseCohortSettingsModel(), courseCohortSettings = new CourseCohortSettingsModel(),
discussionTopicsSettings = new edx.groups.DiscussionTopicsSettingsModel(); discussionTopicsSettings = new DiscussionTopicsSettingsModel();
var cohortManagementElement = $('.cohort-management'); var cohortManagementElement = $('.cohort-management');
...@@ -16,10 +23,10 @@ ...@@ -16,10 +23,10 @@
courseCohortSettings.url = cohortManagementElement.data('course_cohort_settings_url'); courseCohortSettings.url = cohortManagementElement.data('course_cohort_settings_url');
discussionTopicsSettings.url = cohortManagementElement.data('discussion-topics-url'); discussionTopicsSettings.url = cohortManagementElement.data('discussion-topics-url');
var cohortsView = new edx.groups.CohortsView({ var cohortsView = new CohortsView({
el: cohortManagementElement, el: cohortManagementElement,
model: cohorts, model: cohorts,
contentGroups: contentGroups, contentGroups: contentGroupModels,
cohortSettings: courseCohortSettings, cohortSettings: courseCohortSettings,
context: { context: {
discussionTopicsSettingsModel: discussionTopicsSettings, discussionTopicsSettingsModel: discussionTopicsSettings,
......
var edx = edx || {}; ;(function (define) {
(function($, _, Backbone, gettext) {
'use strict'; 'use strict';
define(['jquery', 'underscore', 'backbone', 'gettext'], function($, _, Backbone, gettext) {
edx.groups = edx.groups || {}; var CourseCohortSettingsNotificationView = Backbone.View.extend({
initialize: function(options) {
edx.groups.CourseCohortSettingsNotificationView = Backbone.View.extend({ this.template = _.template($('#cohort-state-tpl').text());
initialize: function(options) { this.cohortEnabled = options.cohortEnabled;
this.template = _.template($('#cohort-state-tpl').text()); },
this.cohortEnabled = options.cohortEnabled;
},
render: function() { render: function() {
this.$el.html(this.template({})); this.$el.html(this.template({}));
this.showCohortStateMessage(); this.showCohortStateMessage();
return this; return this;
}, },
showCohortStateMessage: function () { showCohortStateMessage: function () {
var actionToggleMessage = this.$('.action-toggle-message'); var actionToggleMessage = this.$('.action-toggle-message');
AnimationUtil.triggerAnimation(actionToggleMessage); AnimationUtil.triggerAnimation(actionToggleMessage);
if (this.cohortEnabled) { if (this.cohortEnabled) {
actionToggleMessage.text(gettext('Cohorts Enabled')); actionToggleMessage.text(gettext('Cohorts Enabled'));
} else { } else {
actionToggleMessage.text(gettext('Cohorts Disabled')); actionToggleMessage.text(gettext('Cohorts Disabled'));
}
} }
} });
return CourseCohortSettingsNotificationView;
}); });
}).call(this, $, _, Backbone, gettext); }).call(this, define || RequireJS.define);
...@@ -67,18 +67,6 @@ ...@@ -67,18 +67,6 @@
'js/models/notification': 'js/models/notification', 'js/models/notification': 'js/models/notification',
'js/views/file_uploader': 'js/views/file_uploader', 'js/views/file_uploader': 'js/views/file_uploader',
'js/views/notification': 'js/views/notification', 'js/views/notification': 'js/views/notification',
'js/groups/models/cohort': 'js/groups/models/cohort',
'js/groups/models/content_group': 'js/groups/models/content_group',
'js/groups/models/course_cohort_settings': 'js/groups/models/course_cohort_settings',
'js/groups/models/cohort_discussions': 'js/groups/models/cohort_discussions',
'js/groups/views/cohort_discussions': 'js/groups/views/cohort_discussions',
'js/groups/views/cohort_discussions_course_wide': 'js/groups/views/cohort_discussions_course_wide',
'js/groups/views/cohort_discussions_inline': 'js/groups/views/cohort_discussions_inline',
'js/groups/views/course_cohort_settings_notification': 'js/groups/views/course_cohort_settings_notification',
'js/groups/collections/cohort': 'js/groups/collections/cohort',
'js/groups/views/cohort_editor': 'js/groups/views/cohort_editor',
'js/groups/views/cohort_form': 'js/groups/views/cohort_form',
'js/groups/views/cohorts': 'js/groups/views/cohorts',
'js/student_account/account': 'js/student_account/account', 'js/student_account/account': 'js/student_account/account',
'js/student_account/views/FormView': 'js/student_account/views/FormView', 'js/student_account/views/FormView': 'js/student_account/views/FormView',
'js/student_account/models/LoginModel': 'js/student_account/models/LoginModel', 'js/student_account/models/LoginModel': 'js/student_account/models/LoginModel',
...@@ -301,63 +289,6 @@ ...@@ -301,63 +289,6 @@
exports: 'edx.instructor_dashboard.ecommerce.ExpiryCouponView', exports: 'edx.instructor_dashboard.ecommerce.ExpiryCouponView',
deps: ['backbone', 'jquery', 'underscore'] deps: ['backbone', 'jquery', 'underscore']
}, },
'js/groups/models/cohort': {
exports: 'edx.groups.CohortModel',
deps: ['backbone']
},
'js/groups/models/content_group': {
exports: 'edx.groups.ContentGroupModel',
deps: ['backbone']
},
'js/groups/models/course_cohort_settings': {
exports: 'edx.groups.CourseCohortSettingsModel',
deps: ['backbone']
},
'js/groups/models/cohort_discussions': {
exports: 'edx.groups.DiscussionTopicsSettingsModel',
deps: ['backbone']
},
'js/groups/views/cohort_discussions': {
exports: 'edx.groups.CohortDiscussionConfigurationView',
deps: ['backbone']
},
'js/groups/views/cohort_discussions_course_wide': {
exports: 'edx.groups.CourseWideDiscussionsView',
deps: ['backbone', 'js/groups/views/cohort_discussions']
},
'js/groups/views/cohort_discussions_inline': {
exports: 'edx.groups.InlineDiscussionsView',
deps: ['backbone', 'js/groups/views/cohort_discussions', 'js/vendor/jquery.qubit']
},
'js/groups/views/course_cohort_settings_notification': {
exports: 'edx.groups.CourseCohortSettingsNotificationView',
deps: ['backbone']
},
'js/groups/collections/cohort': {
exports: 'edx.groups.CohortCollection',
deps: ['backbone', 'js/groups/models/cohort']
},
'js/groups/views/cohort_form': {
exports: 'edx.groups.CohortFormView',
deps: [
'backbone', 'jquery', 'underscore', 'js/views/notification', 'js/models/notification',
'string_utils'
]
},
'js/groups/views/cohort_editor': {
exports: 'edx.groups.CohortEditorView',
deps: [
'backbone', 'jquery', 'underscore', 'js/views/notification', 'js/models/notification',
'string_utils', 'js/groups/views/cohort_form'
]
},
'js/groups/views/cohorts': {
exports: 'edx.groups.CohortsView',
deps: [
'jquery', 'underscore', 'backbone', 'gettext', 'string_utils', 'js/groups/views/cohort_editor',
'js/views/notification', 'js/models/notification', 'js/views/file_uploader'
]
},
'js/models/notification': { 'js/models/notification': {
exports: 'NotificationModel', exports: 'NotificationModel',
deps: ['backbone'] deps: ['backbone']
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* done. * done.
*/ */
modules: getModulesList([ modules: getModulesList([
'js/groups/views/cohorts_dashboard_factory',
'js/student_account/views/account_settings_factory', 'js/student_account/views/account_settings_factory',
'js/student_account/views/finish_auth_factory', 'js/student_account/views/finish_auth_factory',
'js/student_profile/views/learner_profile_factory', 'js/student_profile/views/learner_profile_factory',
......
<%page args="section_data"/> <%page args="section_data"/>
<%namespace name='static' file='../../static_content.html'/>
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from courseware.courses import get_studio_url from courseware.courses import get_studio_url
...@@ -16,32 +17,23 @@ from openedx.core.djangoapps.course_groups.partition_scheme import get_cohorted_ ...@@ -16,32 +17,23 @@ from openedx.core.djangoapps.course_groups.partition_scheme import get_cohorted_
</div> </div>
<%block name="headextra"> <%block name="js_extra">
<%static:require_module module_name="js/groups/views/cohorts_dashboard_factory" class_name="CohortsFactory">
<% <%
cohorted_user_partition = get_cohorted_user_partition(course.id) cohorted_user_partition = get_cohorted_user_partition(course.id)
content_groups = cohorted_user_partition.groups if cohorted_user_partition else [] content_groups = cohorted_user_partition.groups if cohorted_user_partition else []
%> %>
<script type="text/javascript"> var cohortUserPartitionId = ${cohorted_user_partition.id if cohorted_user_partition else 'null'},
$(document).ready(function() { contentGroups = [
% for content_group in content_groups:
var cohortUserPartitionId = ${cohorted_user_partition.id if cohorted_user_partition else 'null'}, {
contentGroups = [ id: ${content_group.id},
% for content_group in content_groups: name: "${content_group.name | h}",
new edx.groups.ContentGroupModel({ user_partition_id: cohortUserPartitionId
id: ${content_group.id}, },
name: "${content_group.name | h}", % endfor
user_partition_id: cohortUserPartitionId ];
}), CohortsFactory(contentGroups, '${get_studio_url(course, 'group_configurations') | h}');
% endfor </%static:require_module>
];
(function (require) {
require(['js/groups/views/cohorts_dashboard_factory'], function (CohortsFactory) {
CohortsFactory(contentGroups, '${get_studio_url(course, 'group_configurations') | h}');
});
}).call(this, require || RequireJS.require);
});
</script>
</%block> </%block>
<div class="cohort-state-message"></div> <div class="cohort-state-message"></div>
...@@ -56,22 +56,9 @@ from django.core.urlresolvers import reverse ...@@ -56,22 +56,9 @@ from django.core.urlresolvers import reverse
<%static:js group='application'/> <%static:js group='application'/>
## Backbone classes declared explicitly until RequireJS is supported ## Backbone classes declared explicitly until RequireJS is supported
<script type="text/javascript" src="${static.url('js/instructor_dashboard/cohort_management.js')}"></script>
<script type="text/javascript" src="${static.url('js/models/notification.js')}"></script> <script type="text/javascript" src="${static.url('js/models/notification.js')}"></script>
<script type="text/javascript" src="${static.url('js/views/notification.js')}"></script> <script type="text/javascript" src="${static.url('js/views/notification.js')}"></script>
<script type="text/javascript" src="${static.url('js/views/file_uploader.js')}"></script> <script type="text/javascript" src="${static.url('js/views/file_uploader.js')}"></script>
<script type="text/javascript" src="${static.url('js/groups/models/cohort.js')}"></script>
<script type="text/javascript" src="${static.url('js/groups/models/content_group.js')}"></script>
<script type="text/javascript" src="${static.url('js/groups/models/course_cohort_settings.js')}"></script>
<script type="text/javascript" src="${static.url('js/groups/collections/cohort.js')}"></script>
<script type="text/javascript" src="${static.url('js/groups/views/course_cohort_settings_notification.js')}"></script>
<script type="text/javascript" src="${static.url('js/groups/models/cohort_discussions.js')}"></script>
<script type="text/javascript" src="${static.url('js/groups/views/cohort_discussions.js')}"></script>
<script type="text/javascript" src="${static.url('js/groups/views/cohort_discussions_course_wide.js')}"></script>
<script type="text/javascript" src="${static.url('js/groups/views/cohort_discussions_inline.js')}"></script>
<script type="text/javascript" src="${static.url('js/groups/views/cohort_form.js')}"></script>
<script type="text/javascript" src="${static.url('js/groups/views/cohort_editor.js')}"></script>
<script type="text/javascript" src="${static.url('js/groups/views/cohorts.js')}"></script>
<script type="text/javascript" src="${static.url('js/utils/animation.js')}"></script> <script type="text/javascript" src="${static.url('js/utils/animation.js')}"></script>
</%block> </%block>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment