Files
edx-platform/lms/static/js/instructor_dashboard/certificates.js
Will Daly 940f892290 ECOM-1140: Instructor dashboard example certificates
Allow global staff to generate example certificates
on the instructor dashboard.

Allow global staff to enable/disable self-generated
certificates for a course.
2015-03-06 13:20:48 -05:00

38 lines
1.2 KiB
JavaScript

var edx = edx || {};
(function( $, gettext ) {
'use strict';
edx.instructor_dashboard = edx.instructor_dashboard || {};
edx.instructor_dashboard.certificates = {};
$(function() {
/**
* Show a confirmation message before letting staff members
* enable/disable self-generated certificates for a course.
*/
$('#enable-certificates-form').on('submit', function( event ) {
var isEnabled = $('#certificates-enabled').val() === 'true',
confirmMessage = '';
if ( isEnabled ) {
confirmMessage = gettext('Allow students to generate certificates for this course?');
} else {
confirmMessage = gettext('Prevent students from generating certificates in this course?');
}
if ( !confirm( confirmMessage ) ) {
event.preventDefault();
}
});
/**
* Refresh the status for example certificate generation
* by reloading the instructor dashboard.
*/
$('#refresh-example-certificate-status').on('click', function() {
window.location.reload();
});
});
})( $, gettext );