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:
Muhammad Shoaib
2014-11-19 14:39:32 +05:00
committed by Muhammad Shoaib
parent 30b572b1b1
commit 10f8d8c097
18 changed files with 476 additions and 27 deletions

View 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, $, _);