added templating mechanism for storages
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
|
||||
<!-- Add storage modal form -->
|
||||
{% with add_storage_form as form %}
|
||||
{% include 'parts/modals/new-substorage-modal.html' %}
|
||||
{% include 'parts/modals/substorage-modal.html' %}
|
||||
{% endwith %}
|
||||
|
||||
</div>
|
||||
@@ -80,6 +80,19 @@
|
||||
}, function(){});
|
||||
});
|
||||
|
||||
new AutocompleteText('{{add_storage_form.template.id_for_label}}', '{{add_storage_form.template.id_for_label}}-ac-dropdown',
|
||||
function(search, autocomplete_obj) {
|
||||
api_search_storage_template(search, function(results) {
|
||||
var templates = new Array();
|
||||
console.log(results);
|
||||
for (var i = 0; i < results.results.length; i++) {
|
||||
templates.push(results.results[i].id);
|
||||
}
|
||||
console.log(templates);
|
||||
autocomplete_obj.show_results(templates);
|
||||
}, function(){});
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock custom_scripts %}
|
||||
|
||||
|
Reference in New Issue
Block a user