diff --git a/app/routes.py b/app/routes.py index 42fe1cc69..59cb0414c 100644 --- a/app/routes.py +++ b/app/routes.py @@ -42,6 +42,7 @@ def avatar(email, size): "metadata": { "icon": "https://cdn4.iconfinder.com/data/icons/mosaicon-04/512/websettings-512.png" }, + "enable_config_form": False, "inputs": {}, "tabs": {} } @@ -65,7 +66,6 @@ def avatar(email, size): toscaInfo[tosca]['inputs'] = template['topology_template']['inputs'] ## add parameters code here - enable_config_form = False tabs = {} if tosca_pars_dir: tosca_pars_path = tosca_pars_dir + "/" # this has to be reassigned here because is local. @@ -77,7 +77,7 @@ def avatar(email, size): if fname[0] != '.': tosca_pars_file = os.path.join(fpath, fname) with io.open(tosca_pars_file) as pars_file: - enable_config_form = True + toscaInfo[tosca]['enable_config_form'] = True pars_data = yaml.load(pars_file) toscaInfo[tosca]['inputs'] = pars_data["inputs"] if "tabs" in pars_data: @@ -261,8 +261,7 @@ def configure(): return render_template('createdep.html', template=toscaInfo[selected_tosca], selectedTemplate=selected_tosca, - slas=slas, - enable_config_form=enable_config_form) + slas=slas) def add_sla_to_template(template, sla_id): diff --git a/app/templates/createdep.html b/app/templates/createdep.html index ec245e3b0..7f5928d09 100644 --- a/app/templates/createdep.html +++ b/app/templates/createdep.html @@ -29,7 +29,7 @@

- {% if enable_config_form %} + {% if template['enable_config_form'] is defined and template['enable_config_form'] is sameas true %} {% include 'config_form.html' %} {% else %} {% include 'default_form.html' %}