updating course_detail template's javascript
authorSeth Woodworth <seth@sethish.com>
Thu, 24 Jan 2013 00:07:00 +0000 (19:07 -0500)
committerSeth Woodworth <seth@sethish.com>
Thu, 24 Jan 2013 00:07:00 +0000 (19:07 -0500)
karmaworld/templates/courses/course_detail.html

index 2f78c92bca28387e89755ac7b13848ad1adebfe6..a7609c97ab6985a8c7c73e65ec51fb534eacb2f2 100644 (file)
                 multiple: true,
                 onComplete: function( id, fileName, responseJSON ) {
                   if( responseJSON.success )
-                    alert( "success!" ) ;
-                  else
-                    alert( "upload failed!" ) ;
+                    console.log( "success!" ) ;
+                    $('form#upload_form').attr('action', responseJSON.note_url);
+                    $('input.submit_upload').show();
                 },
                 onAllComplete: function( uploads ) {
                   // uploads is an array of maps
                   // the maps look like this: { file: FileObject, response: JSONServerResponse }
-                  alert( "All complete!" ) ;
+                  console.log( "All complete!" ) ;
                 },
                 params: {
                   'csrf_token': '{{ csrf_token }}',
                   'csrf_name': 'csrfmiddlewaretoken',
                   'csrf_xname': 'X-CSRFToken',
-                  'course_id': course_pk,
+                  'course_id': {{ course.id }},
                 },
               }) ;
         });