diff --git a/static/form.html b/static/form.html index 5f87da3..4262383 100644 --- a/static/form.html +++ b/static/form.html @@ -30,6 +30,7 @@ +

diff --git a/static/form.js b/static/form.js index 2138949..b9dca54 100644 --- a/static/form.js +++ b/static/form.js @@ -12,6 +12,7 @@ document.onreadystatechange = function() { function fillForm() { const item = items[id]; + knownTypes(); const is_in = document.getElementById('is_in'); @@ -52,6 +53,17 @@ function fillForm() { } } +function knownTypes() { + let map = {}; + for (const i of Object.values(items)) { + if (i.type) { + map[i.type] = true; + } + } + let types = Object.keys(map).sort().join(', ') + document.getElementById('knowntypes').textContent = `Known types: ${types}.`; +} + function save() { item = { id: document.getElementById('id').value || null,