Updates Mako and Underscore templates as well as Backbone models and views so they work with catalog programs. Removes all remaining response munging from the back end. ECOM-4422
36 lines
1.3 KiB
JavaScript
36 lines
1.3 KiB
JavaScript
/**
|
|
* Model for Course Programs.
|
|
*/
|
|
(function(define) {
|
|
'use strict';
|
|
define([
|
|
'backbone'
|
|
],
|
|
function(Backbone) {
|
|
return Backbone.Model.extend({
|
|
initialize: function(data) {
|
|
if (data) {
|
|
this.set({
|
|
title: data.title,
|
|
type: data.type,
|
|
subtitle: data.subtitle,
|
|
authoring_organizations: data.authoring_organizations,
|
|
detailUrl: data.detail_url,
|
|
xsmallBannerUrl: data.banner_image['x-small'].url,
|
|
smallBannerUrl: data.banner_image.small.url,
|
|
mediumBannerUrl: data.banner_image.medium.url,
|
|
breakpoints: {
|
|
max: {
|
|
xsmall: '320px',
|
|
small: '540px',
|
|
medium: '768px',
|
|
large: '979px'
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}).call(this, define || RequireJS.define);
|