8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-28 09:53:47 +00:00

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
This commit is contained in:
Maël Kervella 2017-10-08 02:01:45 +00:00
parent d52e4d58e2
commit ed12379205
2 changed files with 11 additions and 3 deletions

View file

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

View file

@ -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 ]