From 4612984d4bd929f814a56118620faa02cbf74577 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 14 Jul 2011 19:42:27 +0200 Subject: fixed config on webif + show description --- module/web/json_app.py | 14 ++-- module/web/templates/default/settings_item.html | 87 +++++++++++++------------ 2 files changed, 53 insertions(+), 48 deletions(-) (limited to 'module/web') diff --git a/module/web/json_app.py b/module/web/json_app.py index bc95b5ffd..91c33c622 100644 --- a/module/web/json_app.py +++ b/module/web/json_app.py @@ -356,15 +356,17 @@ def restart_failed(): def load_config(category, section): conf = None if category == "general": - conf = PYLOAD.getConfig() + conf = PYLOAD.getConfigDict() elif category == "plugin": - conf = PYLOAD.getPluginConfig() + conf = PYLOAD.getPluginConfigDict() - for option in conf[section].items: - if ";" in option.type: - option.type = option.type.split(";") + for key, option in conf[section].iteritems(): + if key in ("desc","outline"): continue - option.value = decode(option.value) + if ";" in option["type"]: + option["list"] = option["type"].split(";") + + option["value"] = decode(option["value"]) return render_to_response("settings_item.html", {"skey": section, "section": conf[section]}) diff --git a/module/web/templates/default/settings_item.html b/module/web/templates/default/settings_item.html index 92223557d..813383343 100644 --- a/module/web/templates/default/settings_item.html +++ b/module/web/templates/default/settings_item.html @@ -1,45 +1,48 @@ - {% set skey = section.name %} - {% for option in section.items %} - {% set okey = option.name %} - - - - + {% if section.outline %} + + {% endif %} + {% for okey, option in section.iteritems() %} + {% if okey not in ("desc","outline") %} + + + + + {% endif %} {% endfor %}
- {% if option.type == "bool" %} - - {% elif option.type|type == "" %} - - {% elif option.type == "folder" %} - - - {% elif option.type == "file" %} - - - {% elif option.type == "password" %} - - {% else %} - - {% endif %} -
{{ section.outline }}
+ {% if option.type == "bool" %} + + {% elif ";" in option.type %} + + {% elif option.type == "folder" %} + + + {% elif option.type == "file" %} + + + {% elif option.type == "password" %} + + {% else %} + + {% endif %} +
\ No newline at end of file -- cgit v1.2.3