Files
edx-platform/cms/static/js/models/course_update.js
Feanil Patel 1f7b12a38d Remove references to push notifications.
Push notifications was only ever setup to connect to Parse.com a service
that has been discontinued.  Since we haven't replaced the functionality
for a few years now, remove this dead code.

In cms/templates/js/course_info_update.underscore we're allowing content
to not be escaped because this is by design according to the tests.
Long term there should be a better fix for this but for now this is
intended behavior.
2019-07-24 11:45:46 -04:00

18 lines
783 B
JavaScript

define(['backbone', 'jquery', 'jquery.ui'], function(Backbone, $) {
// course update -- biggest kludge here is the lack of a real id to map updates to originals
var CourseUpdate = Backbone.Model.extend({
defaults: {
date: $.datepicker.formatDate('MM d, yy', new Date()),
content: ''
},
validate: function(attrs) {
var date_exists = (attrs.date !== null && attrs.date !== '');
var date_is_valid_string = ($.datepicker.formatDate('MM d, yy', new Date(attrs.date)) === attrs.date);
if (!(date_exists && date_is_valid_string)) {
return {date_required: gettext('Action required: Enter a valid date.')};
}
}
});
return CourseUpdate;
}); // end define()