diff options
author | adityacp | 2020-01-17 10:56:47 +0530 |
---|---|---|
committer | adityacp | 2020-01-17 10:56:47 +0530 |
commit | f988c72e19b689227d671b6774242bb3e784a5e2 (patch) | |
tree | 571d9d324450ed676c8b2671c497dc02e28d5678 /yaksh/static | |
parent | 23bf012f3428d76685cfd952cc6760eb595ff013 (diff) | |
download | online_test-f988c72e19b689227d671b6774242bb3e784a5e2.tar.gz online_test-f988c72e19b689227d671b6774242bb3e784a5e2.tar.bz2 online_test-f988c72e19b689227d671b6774242bb3e784a5e2.zip |
Change views and urls
- Change enroll, reject and course detail views
- Add new urls for courses
Diffstat (limited to 'yaksh/static')
-rw-r--r-- | yaksh/static/yaksh/css/custom.css | 9 | ||||
-rw-r--r-- | yaksh/static/yaksh/css/design_course.css | 17 | ||||
-rw-r--r-- | yaksh/static/yaksh/js/course.js | 146 |
3 files changed, 99 insertions, 73 deletions
diff --git a/yaksh/static/yaksh/css/custom.css b/yaksh/static/yaksh/css/custom.css index 55d5d6d..594e1f3 100644 --- a/yaksh/static/yaksh/css/custom.css +++ b/yaksh/static/yaksh/css/custom.css @@ -36,3 +36,12 @@ body, .dropdown-menu { .dropdown { display: flex; } + +.course-detail { + table-layout: fixed; + width: 100%; +} + +.course-detail > th, td { + word-wrap: break-word; +}
\ No newline at end of file diff --git a/yaksh/static/yaksh/css/design_course.css b/yaksh/static/yaksh/css/design_course.css index d1bf4bd..a0dcd10 100644 --- a/yaksh/static/yaksh/css/design_course.css +++ b/yaksh/static/yaksh/css/design_course.css @@ -1,17 +1,6 @@ -body { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 13px; - font-weight: normal; - line-height: 18px; - color: #404040; -} - -#available-lesson-quiz .col-md-8 > div{ +#available-lesson-quiz .col-md-12 > div{ background: #f5f5f5; border: 1px solid #333333; overflow-y: scroll; - height: 300px; -} -#available-lesson-quiz .available-list > div{ - height: 300px; -} + height: 400px; +}
\ No newline at end of file diff --git a/yaksh/static/yaksh/js/course.js b/yaksh/static/yaksh/js/course.js index bd197a8..29d2d9a 100644 --- a/yaksh/static/yaksh/js/course.js +++ b/yaksh/static/yaksh/js/course.js @@ -1,5 +1,5 @@ $(document).ready(function(){
-$(".checkall").change( function(){
+ $(".checkall").change( function(){
if($(this).prop("checked")) {
$("#enroll-all input:checkbox").each(function(index, element) {
$(this).prop('checked', true);
@@ -11,7 +11,7 @@ $(".checkall").change( function(){ });
}
});
-$(".enroll").change( function(){
+ $(".enroll").change( function(){
if($(this).prop("checked")) {
$("#enroll input:checkbox").each(function(index, element) {
$(this).prop('checked', true);
@@ -23,7 +23,7 @@ $(".enroll").change( function(){ });
}
});
-$(".reject").change( function(){
+ $(".reject").change( function(){
if($(this).prop("checked")) {
$("#reject input:checkbox").each(function(index, element) {
$(this).prop('checked', true);
@@ -36,68 +36,96 @@ $(".reject").change( function(){ }
});
-$(function() {
- tinymce.init({
- selector: 'textarea#email_body',
- max_height: 200,
- height: 200
+ $(".send_check").change( function(){
+ if($(this).prop("checked")) {
+ $("#sender_list input:checkbox").each(function(index, element) {
+ $(this).prop('checked', true);
+ });
+ }
+ else {
+ $("#sender_list input:checkbox").each(function(index, element) {
+ $(this).prop('checked', false);
+ });
+ }
});
-});
-$("#send_mail").click(function(){
- var subject = $("#subject").val();
- var body = tinymce.get("email_body").getContent();
- var status = false;
- var selected = [];
- $('#reject input:checked').each(function() {
- selected.push($(this).attr('value'));
+ $(function() {
+ tinymce.init({
+ selector: 'textarea#email_body',
+ max_height: 200,
+ height: 200
+ });
});
- if (subject == '' || body == ''){
- $("#error_msg").html("Please enter mail details");
- $("#dialog").dialog();
- }
- else if (selected.length == 0){
- $("#error_msg").html("Please select atleast one user");
- $("#dialog").dialog();
- }
- else {
- status = true;
- }
- return status;
-});
+ $("#send_mail").click(function(){
+ var subject = $("#subject").val();
+ var body = tinymce.get("email_body").getContent();
+ var status = false;
+ var selected = [];
+ $('#sender_list input:checked').each(function() {
+ selected.push($(this).attr('value'));
+ });
+ if (subject == '' || body == ''){
+ $("#error_msg").html("Please enter mail details");
+ $("#dialog").dialog();
+ }
+ else if (selected.length == 0){
+ $("#error_msg").html("Please select atleast one user");
+ $("#dialog").dialog();
+ }
+ else {
+ status = true;
+ }
+ return status;
+ });
-// Table sorter for course details
-$("table").tablesorter({});
-// Get user course completion status
-$('.user_data').click(function() {
- var data = $(this).data('item-id');
- course_id = data.split("+")[0];
- student_id = data.split("+")[1];
- var status_div = $("#show_status_"+course_id+"_"+student_id);
- if(!status_div.is(":visible")){
- var get_url = window.location.protocol + "//" + window.location.host +
- "/exam/manage/get_user_status/" + course_id + "/" + student_id;
- $.ajax({
- url: get_url,
- timeout: 8000,
- type: "GET",
- dataType: "json",
- contentType: 'application/json; charset=utf-8',
- success: function(data) {
- status_div.toggle();
- status_div.html(data.user_data);
- },
- error: function(jqXHR, textStatus) {
- alert("Unable to get user data. Please Try again later.");
- }
- });
- } else {
- status_div.toggle();
- }
-});
+ // Table sorter for course details
+ $("table").tablesorter({});
-$('[data-toggle="tooltip"]').tooltip();
+ // Get user course completion status
+ $('.user_data').click(function() {
+ var data = $(this).data('item-id');
+ course_id = data.split("+")[0];
+ student_id = data.split("+")[1];
+ var status_div = $("#show_status_"+course_id+"_"+student_id);
+ if(!status_div.is(":visible")){
+ var get_url = window.location.protocol + "//" + window.location.host +
+ "/exam/manage/get_user_status/" + course_id + "/" + student_id;
+ $.ajax({
+ url: get_url,
+ timeout: 8000,
+ type: "GET",
+ dataType: "json",
+ contentType: 'application/json; charset=utf-8',
+ success: function(data) {
+ status_div.toggle();
+ status_div.html(data.user_data);
+ },
+ error: function(jqXHR, textStatus) {
+ alert("Unable to get user data. Please Try again later.");
+ }
+ });
+ } else {
+ status_div.toggle();
+ }
+ });
+ $('[data-toggle="tooltip"]').tooltip();
+
+ $('#upload').on('change',function(){
+ //get the file name
+ var files = [];
+ for (var i = 0; i < $(this)[0].files.length; i++) {
+ files.push($(this)[0].files[i].name);
+ }
+ $(this).next('.custom-file-label').html(files.join(', '));
+ });
+
+ $('[data-toggle="tab"]').tooltip({
+ trigger: 'hover',
+ placement: 'top',
+ animate: true,
+ container: 'body'
+ });
}); // end document ready
|