diff options
author | Jayaram R Pai | 2014-08-21 19:46:18 +0530 |
---|---|---|
committer | Jayaram R Pai | 2014-08-21 19:46:18 +0530 |
commit | 6349505c1b9cb638d562bd06a75a26109b106f0d (patch) | |
tree | aeed4f0c7a3b985ea735ec3c424f8504cea70eac /website/views.py | |
parent | 1ced43baf6c586f6af51b13eeb72f24dc5906be2 (diff) | |
download | scilab-on-cloud-6349505c1b9cb638d562bd06a75a26109b106f0d.tar.gz scilab-on-cloud-6349505c1b9cb638d562bd06a75a26109b106f0d.tar.bz2 scilab-on-cloud-6349505c1b9cb638d562bd06a75a26109b106f0d.zip |
added lightbox to display plot
Diffstat (limited to 'website/views.py')
-rw-r--r-- | website/views.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/website/views.py b/website/views.py index aba54a2..785337f 100644 --- a/website/views.py +++ b/website/views.py @@ -66,19 +66,25 @@ def ajax_code(request): if request.method == "POST": example_id = request.POST['example_id'] example = TextbookCompanionExampleFiles.objects.using('scilab')\ - .get(id=example_id) + .get(example_id=example_id, filetype='S') example_path = '/var/www/scilab_in/uploads/' + example.filepath + f = open(example_path) code = f.readlines() f.close() - - print code return HttpResponse(code) def ajax_execute(request): if request.method == "POST": code = request.POST['code'] + example_id = request.POST.get('example_id', None) token = request.POST['csrfmiddlewaretoken'] - result = scilab_run(code, token) - return HttpResponse(result) + data = scilab_run(code, token, example_id) + return render(request, 'website/templates/ajax-execute.html', data) + + + + + + |