Commit 1afe5561 by David Baumgold

Merge pull request #2039 from edx/fix-course-updates

Fix "Course Updates" page
parents 26b149e7 e9a8f408
...@@ -22,6 +22,7 @@ CMS.Views.Checklists = Backbone.View.extend({ ...@@ -22,6 +22,7 @@ CMS.Views.Checklists = Backbone.View.extend({
} }
); );
}, },
reset: true,
error: CMS.ServerError error: CMS.ServerError
} }
); );
......
...@@ -160,11 +160,17 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({ ...@@ -160,11 +160,17 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
var targetModel = this.eventModel(event); var targetModel = this.eventModel(event);
this.modelDom(event).remove(); this.modelDom(event).remove();
var cacheThis = this; var cacheThis = this;
targetModel.destroy({success : function (model, response) { targetModel.destroy({
cacheThis.collection.fetch({success : function() {cacheThis.render();}, success: function (model, response) {
error : CMS.ServerError}); cacheThis.collection.fetch({
}, success: function() {
error : CMS.ServerError cacheThis.render();
},
reset: true,
error: CMS.ServerError
});
},
error : CMS.ServerError
}); });
}, },
...@@ -238,20 +244,19 @@ CMS.Views.ClassInfoHandoutsView = Backbone.View.extend({ ...@@ -238,20 +244,19 @@ CMS.Views.ClassInfoHandoutsView = Backbone.View.extend({
initialize: function() { initialize: function() {
var self = this; var self = this;
this.model.fetch( this.model.fetch({
{ complete: function() {
complete: function() { window.templateLoader.loadRemoteTemplate("course_info_handouts",
window.templateLoader.loadRemoteTemplate("course_info_handouts", "/static/client_templates/course_info_handouts.html",
"/static/client_templates/course_info_handouts.html", function (raw_template) {
function (raw_template) { self.template = _.template(raw_template);
self.template = _.template(raw_template); self.render();
self.render(); }
} );
); },
}, reset: true,
error : CMS.ServerError error: CMS.ServerError
} });
);
}, },
render: function () { render: function () {
......
...@@ -155,6 +155,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({ ...@@ -155,6 +155,7 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
self.model.clear({silent : true}); self.model.clear({silent : true});
self.model.fetch({ self.model.fetch({
success : function() { self.render(); }, success : function() { self.render(); },
reset: true,
error : CMS.ServerError error : CMS.ServerError
}); });
}, },
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
$(document).ready(function(){ $(document).ready(function(){
var course_updates = new CMS.Models.CourseUpdateCollection(); var course_updates = new CMS.Models.CourseUpdateCollection();
course_updates.urlbase = '${url_base}'; course_updates.urlbase = '${url_base}';
course_updates.fetch(); course_updates.fetch({reset: true});
var course_handouts = new CMS.Models.ModuleInfo({ var course_handouts = new CMS.Models.ModuleInfo({
id: '${handouts_location}' id: '${handouts_location}'
......
...@@ -32,15 +32,15 @@ from contentstore import utils ...@@ -32,15 +32,15 @@ from contentstore import utils
}); });
var model = new CMS.Models.Settings.CourseDetails(); var model = new CMS.Models.Settings.CourseDetails();
model.urlRoot = '${details_url}'; model.urlRoot = '${details_url}';
model.fetch({success : model.fetch({
function(model) { success: function(model) {
var editor = new CMS.Views.Settings.Details({ var editor = new CMS.Views.Settings.Details({
el: $('.settings-details'), el: $('.settings-details'),
model: model model: model
}); });
editor.render();
editor.render(); },
} reset: true
}); });
}); });
......
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