$def with (errorCode) $var title: $_('Options') $var page: options $code: languages = i18n.languages langKeys = list(i18n.languages.keys()) langKeys.sort()
$_('Edit Options')
$code: output = "" oldcategory = "" categoryCloser = "" for option in options.OPTIONS: if 'category' in option: name = option['key'] label = option['name'] category = option['category'] tooltip = option['help'] value = options[option['key']] enum = option.get('options') if hasattr(enum, '__call__'): enum = enum() multi_enum = option.get('multi_options') if hasattr(multi_enum, '__call__'): multi_enum = multi_enum() multi_enum_names = option.get('multi_options_names') if hasattr(multi_enum_names, '__call__'): multi_enum_names = multi_enum_names() if multi_enum and not multi_enum_names: multi_enum_names = {} for opt in multi_enum: multi_enum_names[opt] = opt minv = " min='" + str(option['min']) + "'" if 'min' in option else "" maxv = " max='" + str(option['max']) + "'" if 'max' in option else "" if category != oldcategory: output += categoryCloser + "" oldcategory = category if name == 'master_relay': output += "
" + _('Master station') + ":\n" output += "\n" output += "" + _('Specify which output should be used as master station.') + "\n" output += "
\n" output += "
" + _('Master two station') + ":\n" output += "\n" output += "" + _('Specify which output should be used as master two station.') + "\n" output += "
\n" if name == 'lang': output += "
" + _('System language') + ":\n" output += "\n" output += "" + _('Language localizations for this OpenSprinkler system. (effective after reboot.)') + "\n" output += "
\n" if name != 'lang': output += "
" + label + ":\n" else: output += "
" + label + "\n" if enum != None: output += "\n" elif multi_enum is not None: output += "
\n" if not multi_enum: output += _('None available') for e in multi_enum: sel = " checked" if e in value else "" output += "" + multi_enum_names[e] + "
\n" output += "
\n" elif isinstance(value, bool): output += "0 else "") + ">\n" elif isinstance(value, int) or isinstance(value, float): output += "\n" else: if name != 'lang': output += "\n" output += "" + tooltip + "\n" output += "
\n\n" if name == 'admin_user': output += "
" + _('Current password') + ":\n" output += "\n" output += "" + _('Re-enter the current password.') + "\n" output += "
\n" output += "
" + _('New password') + ":\n" output += "\n" output += "" + _('Enter a new password.') + "\n" output += "
\n" output += "
" + _('Confirm password') + ":\n" output += "\n" output += "" + _('Confirm the new password.') + "\n" output += "
\n" output += "
" + _('Aditional users') + "\n" output += " " + _('Edit Users') + "\n" output += "" + _('Edit aditional users for login to the OSPy.') + "\n" output += "
\n" output += categoryCloser + "