From b71977bb6a89a4e83e85553647e873f001841725 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 23 Jun 2021 22:59:27 +1000 Subject: [PATCH] Add field support - Support text field - Support checkbox field --- InvenTree/templates/js/forms.js | 79 +++++++++++++++++++++++++++++---- 1 file changed, 70 insertions(+), 9 deletions(-) diff --git a/InvenTree/templates/js/forms.js b/InvenTree/templates/js/forms.js index 7668fc05ed..fab9f881ab 100644 --- a/InvenTree/templates/js/forms.js +++ b/InvenTree/templates/js/forms.js @@ -178,8 +178,6 @@ function constructCreateForm(url, fields, options={}) { for (const key in fields) { var field = fields[key]; - - console.log(key, field.label, field.help_text); var f = constructField(key, field, options); @@ -193,6 +191,8 @@ function constructCreateForm(url, fields, options={}) { $(modal).find('.modal-form-content').html(html); $(modal).modal('show'); + + attachToggle(modal); } @@ -293,17 +293,78 @@ function constructInput(name, parameters, options={}) { var html = ''; - // TODO: Construct input differently depending on the input type! + var func = null; - html = ``; + + return html; +} + + +// Construct a "text" input +function constructTextInput(name, parameters, options={}) { + + var html = ``; return html; }