diff --git a/courses/static/js/course.js b/courses/static/js/course.js index e69de29..47d2110 100644 --- a/courses/static/js/course.js +++ b/courses/static/js/course.js @@ -0,0 +1,21 @@ +/* +* +* Function to subscribe (works for courses and subjects) +* +*/ +function subscribe(elem, url, confirm_message) { + alertify.confirm(confirm_message, function(){ + $.ajax({ + dataType: "json", + url: url, + success: function (data) { + if (data.status == "ok") { + elem.disabled(true); + alertify.success(data.message); + } else { + alertify.error(data.message); + } + } + }); + }); +} \ No newline at end of file -- libgit2 0.21.2