added templating mechanism for storages

This commit is contained in:
2024-11-10 20:46:45 +01:00
parent 6dd781021c
commit 0b27e9f064
15 changed files with 180 additions and 121 deletions

View File

@@ -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 %}