Commit e1c452bc by chrisndodge

Merge pull request #1113 from MITx/feature/dhm/course-info

move the underscore tempaltes to /static/client-templates and update the...
parents a4ed3a7b 79e48dde
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
if (typeof window.templateLoader == 'function') return; if (typeof window.templateLoader == 'function') return;
var templateLoader = { var templateLoader = {
templateVersion: "0.0.6", templateVersion: "0.0.8",
templates: {}, templates: {},
loadRemoteTemplate: function(templateName, filename, callback) { loadRemoteTemplate: function(templateName, filename, callback) {
if (!this.templates[templateName]) { if (!this.templates[templateName]) {
......
...@@ -38,7 +38,7 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({ ...@@ -38,7 +38,7 @@ CMS.Views.ClassInfoUpdateView = Backbone.View.extend({
// instantiates an editor template for each update in the collection // instantiates an editor template for each update in the collection
window.templateLoader.loadRemoteTemplate("course_info_update", window.templateLoader.loadRemoteTemplate("course_info_update",
// TODO Where should the template reside? how to use the static.url to create the path? // TODO Where should the template reside? how to use the static.url to create the path?
"/static/coffee/src/client_templates/course_info_update.html", "/static/client_templates/course_info_update.html",
function (raw_template) { function (raw_template) {
self.template = _.template(raw_template); self.template = _.template(raw_template);
self.render(); self.render();
...@@ -209,7 +209,7 @@ CMS.Views.ClassInfoHandoutsView = Backbone.View.extend({ ...@@ -209,7 +209,7 @@ CMS.Views.ClassInfoHandoutsView = Backbone.View.extend({
{ {
complete: function() { complete: function() {
window.templateLoader.loadRemoteTemplate("course_info_handouts", window.templateLoader.loadRemoteTemplate("course_info_handouts",
"/static/coffee/src/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();
......
...@@ -8,7 +8,7 @@ def expect_json(view_function): ...@@ -8,7 +8,7 @@ def expect_json(view_function):
def expect_json_with_cloned_request(request, *args, **kwargs): def expect_json_with_cloned_request(request, *args, **kwargs):
# cdodge: fix postback errors in CMS. The POST 'content-type' header can include additional information # cdodge: fix postback errors in CMS. The POST 'content-type' header can include additional information
# e.g. 'charset', so we can't do a direct string compare # e.g. 'charset', so we can't do a direct string compare
if request.META['CONTENT_TYPE'].lower().startswith("application/json"): if request.META.get('CONTENT_TYPE','').lower().startswith("application/json"):
cloned_request = copy.copy(request) cloned_request = copy.copy(request)
cloned_request.POST = cloned_request.POST.copy() cloned_request.POST = cloned_request.POST.copy()
cloned_request.POST.update(json.loads(request.body)) cloned_request.POST.update(json.loads(request.body))
......
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