summaryrefslogtreecommitdiffstats
path: root/templates/upload.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/upload.html')
-rw-r--r--templates/upload.html32
1 files changed, 15 insertions, 17 deletions
diff --git a/templates/upload.html b/templates/upload.html
index a248040..8683be0 100644
--- a/templates/upload.html
+++ b/templates/upload.html
@@ -38,13 +38,7 @@
</p>
</form>
- <div id="module-index">
- {% if module and module_list %}
- <h4>{{module}}</h4>
- {% from 'module_show.html' import render_module_list %}
- {{ render_module_list(module_list)}}
- {% endif %}
- </div>
+ <div id="module-index"></div>
</div>
<script type="text/javascript">
@@ -52,6 +46,15 @@
var elem = $('#module_new');
var module = $('#module');
+ var update_modules = function() {
+ var text = module.find("option:selected").text();
+ $.get('/{{study}}/modules/' + text, function(data) {
+ $('#module-index').replaceWith($(data).find('#module-index'));
+ });
+ };
+
+ update_modules();
+
if(module.val() != 'new')
elem.hide();
@@ -61,18 +64,13 @@
var text = current.find("option:selected").text();
if(value == 'new') {
- $('#module-index').fadeOut('fast', function() {
- elem.fadeIn();
- });
+ $('#module-index').fadeOut('fast', function() { elem.fadeIn(); });
} else {
elem.fadeOut('fast', function() {
- if(value != '') {
- $.get('/{{study}}/modules/' + text, function(data) {
- $('#upload div').replaceWith($(data).find('#module-index'));
- });
- } else {
- $('#module-index').fadeOut('fast');
- }
+ if(value != '')
+ update_modules();
+ else
+ $('#module-index').fadeOut('fast');
});
}