Commit ed123792 authored by Maël Kervella's avatar Maël Kervella

Utilisation du BFT tag sur les machines dans l'édition d'interface

+Corretion d'une typo sur la génération de la variable choices
parent d52e4d58
......@@ -49,9 +49,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if interfaceform %}
<h3>Interface</h3>
{% if i_bft_param %}
{% if 'machine' in interfaceform.fields %}
{% bootstrap_form_typeahead interfaceform 'ipv4,machine' bft_param=i_bft_param %}
{% else %}
{% bootstrap_form_typeahead interfaceform 'ipv4' bft_param=i_bft_param %}
{% endif %}
{% else %}
{% if 'machine' in interfaceform.fields %}
{% bootstrap_form_typeahead interfaceform 'ipv4,machine' %}
{% else %}
{% bootstrap_form_typeahead interfaceform 'ipv4' %}
{% endif %}
{% endif %}
{% endif %}
{% if domainform %}
......
......@@ -298,9 +298,9 @@ def reset_input( f_name ) :
def default_choices( f_value ) :
""" The JS script creating the variable choices_<fieldname> """
return '[ {objects} ]'.format(
objects = ', '.join(
[ '{{ key: {k}, value: "{k}" }}'.format(
return '[{objects}]'.format(
objects = ','.join(
[ '{{key:{k},value:"{v}"}}'.format(
k = choice[0] if choice[0] != '' else '""',
v = choice[1]
) for choice in f_value.choices ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment