* Remove m2m relation between credit course and credit providers. * Separate eligibility and provider APIs into different modules. * Add API call for retrieving a user's eligibilities. * Cache credit course list. * Style the dashboard purchase button. * Display a link for the credit provider on the dashboard. * Add analytics events for clicks on the purchase button. * Expose more credit models to Django admin and add search functionality.
18 lines
550 B
JavaScript
18 lines
550 B
JavaScript
(function($, analytics) {
|
|
'use strict';
|
|
|
|
$(document).ready(function() {
|
|
// Fire analytics events when the "purchase credit" button is clicked
|
|
$(".purchase-credit-btn").on("click", function(event) {
|
|
var courseKey = $(event.target).data("course-key");
|
|
analytics.track(
|
|
"edx.bi.credit.clicked_purchase_credit",
|
|
{
|
|
category: "credit",
|
|
label: courseKey
|
|
}
|
|
);
|
|
});
|
|
});
|
|
})(jQuery, window.analytics);
|