diff options
Diffstat (limited to 'app/templates/upload.html')
-rw-r--r-- | app/templates/upload.html | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/app/templates/upload.html b/app/templates/upload.html index 0e00354..e19a113 100644 --- a/app/templates/upload.html +++ b/app/templates/upload.html @@ -20,17 +20,17 @@ {{ render_fields(field, None) }} {% endmacro %} -{% extends "layout.html" %} +{% extends "_layout.html" %} {% block body %} <h3>neue Klausur hochladen</h3> <div id="upload"> <form method="POST" enctype="multipart/form-data" - action="{{url_for('.upload', study=study, module=module)}}"> + action="{{url_for('.upload', study=study, course=course)}}"> {{ form.csrf_token }} {{ render_field(form.exam) }} - {{ render_fields(form.module, form.module_new, placeholder='Modulname') }} + {{ render_fields(form.course, form.course_new, placeholder='Modulname') }} {{ render_field(form.year) }} <p> @@ -38,39 +38,39 @@ </p> </form> - <div id="module-index"></div> + <div id="exams"></div> </div> <script type="text/javascript"> $(document).ready(function() { - var elem = $('#module_new'); - var module = $('#module'); + var elem = $('#course_new'); + var course = $('#course'); - var update_modules = function() { - var text = module.find("option:selected").text(); - $.get('/{{study}}/modules/' + text, function(data) { - $('#module-index').replaceWith($(data).find('#module-index')); + var update_courses = function() { + var text = course.find("option:selected").text(); + $.get('/{{study}}/courses/' + text, function(data) { + $('#exams').replaceWith($(data).find('#exams')); }); }; - update_modules(); + update_courses(); - if(module.val() != 'new') + if(course.val() != 'new') elem.hide(); - module.change(function(){ + course.change(function(){ var current = $(this); var value = current.val(); var text = current.find("option:selected").text(); if(value == 'new') { - $('#module-index').fadeOut('fast', function() { elem.fadeIn(); }); + $('#exams').fadeOut('fast', function() { elem.fadeIn(); }); } else { elem.fadeOut('fast', function() { if(value != '') - update_modules(); + update_courses(); else - $('#module-index').fadeOut('fast'); + $('#exams').fadeOut('fast'); }); } |