summaryrefslogtreecommitdiff
path: root/yaksh/static
diff options
context:
space:
mode:
authoradityacp2017-05-15 15:03:21 +0530
committeradityacp2017-05-15 15:03:21 +0530
commit2d62359adf671d5a75201a2314825039adc7291a (patch)
treee56cf952cd0641723423afcb23ef14f67b95a6ec /yaksh/static
parentbd255f751dbff97d92e9c34652af37c67b62b2ff (diff)
downloadonline_test-2d62359adf671d5a75201a2314825039adc7291a.tar.gz
online_test-2d62359adf671d5a75201a2314825039adc7291a.tar.bz2
online_test-2d62359adf671d5a75201a2314825039adc7291a.zip
Change course.js and course_detail.html
- Allow moderator to send emails to students enrollded in a course - Add validations to check email data in course.js
Diffstat (limited to 'yaksh/static')
-rw-r--r--yaksh/static/yaksh/js/course.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/yaksh/static/yaksh/js/course.js b/yaksh/static/yaksh/js/course.js
index 5b79e68..3e214be 100644
--- a/yaksh/static/yaksh/js/course.js
+++ b/yaksh/static/yaksh/js/course.js
@@ -35,4 +35,49 @@ $(".reject").change( function(){
});
}
});
+
+$(function() {
+ $('textarea#email_body').froalaEditor({
+ heightMin: 100,
+ heightMax: 200
+ })
+ });
+
+var status;
+var btn_name;
+
+$("#send_mail").click(function(){
+ btn_name = "send_mail";
+ var subject = $("#subject").val();
+ var body = $('#email_body').val();
+ if (subject == '' || body == ''){
+ status = false;
+ $("#error_msg").html("Please enter email details");
+ $("#dialog").dialog();
+ }
+ else{
+ status = true;
+ }
+});
+
+$('#reject-form').submit(function(eventObj) {
+ if (btn_name == 'send_mail'){
+ if(status == false){
+ return false;
+ }
+ }
+ var selected = [];
+ $('#reject input:checked').each(function() {
+ selected.push($(this).attr('value'));
+ });
+ if(selected.length > 0){
+ return true;
+ }
+ else{
+ $("#error_msg").html("Please select atleast one user");
+ $( "#dialog" ).dialog();
+ return false;
+ }
+});
+
});