WL-135 added the migration for the expiration_date field in the coupons model
added the functionality of adding the expiration date, and also handled in the shopping cart when the user try to add the expired coupon code in the shopping cart added expiration date in the coupons list in the ecommerce page added the unit tests and jasmine tests fix the quality issues and rebased with master regenerated the migration file with a different number i18n and verified te course mode changes suggested by stephan
This commit is contained in:
committed by
Muhammad Shoaib
parent
30b572b1b1
commit
10f8d8c097
35
lms/static/js/instructor_dashboard/ecommerce.js
Normal file
35
lms/static/js/instructor_dashboard/ecommerce.js
Normal file
@@ -0,0 +1,35 @@
|
||||
var edx = edx || {};
|
||||
|
||||
(function(Backbone, $, _) {
|
||||
'use strict';
|
||||
|
||||
edx.instructor_dashboard = edx.instructor_dashboard || {};
|
||||
edx.instructor_dashboard.ecommerce = {};
|
||||
|
||||
edx.instructor_dashboard.ecommerce.ExpiryCouponView = Backbone.View.extend({
|
||||
el: 'li#add-coupon-modal-field-expiry',
|
||||
events: {
|
||||
'click input[type="checkbox"]': 'clicked'
|
||||
},
|
||||
initialize: function() {
|
||||
$('li#add-coupon-modal-field-expiry input[name="expiration_date"]').hide();
|
||||
_.bindAll(this, 'clicked');
|
||||
},
|
||||
clicked: function (event) {
|
||||
if (event.currentTarget.checked) {
|
||||
this.$el.find('#coupon_expiration_date').show();
|
||||
this.$el.find('#coupon_expiration_date').focus();
|
||||
}
|
||||
else {
|
||||
this.$el.find('#coupon_expiration_date').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$( "#coupon_expiration_date" ).datepicker({
|
||||
minDate: 0
|
||||
});
|
||||
var view = new edx.instructor_dashboard.ecommerce.ExpiryCouponView();
|
||||
});
|
||||
}).call(this, Backbone, $, _);
|
||||
Reference in New Issue
Block a user