diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-01 11:50:28 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-01 11:50:28 +0200 |
commit | 3992d16e9dbfc5f0a4196c0958b14c1fe8576ecb (patch) | |
tree | 0bbdd988d71b98b3b7e29d0626e8c2abdbd22b7c /module/web | |
parent | some changes (diff) | |
download | pyload-3992d16e9dbfc5f0a4196c0958b14c1fe8576ecb.tar.xz |
webif config fix
Diffstat (limited to 'module/web')
-rw-r--r-- | module/web/pyload/views.py | 13 | ||||
-rw-r--r-- | module/web/templates/default/settings.html | 17 |
2 files changed, 15 insertions, 15 deletions
diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 67ac6c07a..a97cfbfd7 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -173,7 +173,7 @@ def collector(request): @permission('pyload.can_change_status') @check_server def config(request): - conf = settings.PYLOAD.get_config_data() + conf = settings.PYLOAD.get_config() if request.META.get('REQUEST_METHOD', "GET") == "POST": @@ -183,9 +183,9 @@ def config(request): if not "|" in key: continue skey, okey = key.split("|")[:] if conf.has_key(skey): - if conf[skey]['options'].has_key(okey): + if conf[skey].has_key(okey): try: - if str(conf[skey]['options'][okey]['value']) != value: + if str(conf[skey][okey]['value']) != value: settings.PYLOAD.set_conf_val(skey, okey, value) except: errors.append("%s | %s" % (skey, okey)) @@ -205,10 +205,5 @@ def config(request): return render_to_response(join(settings.TEMPLATE, 'settings.html'), RequestContext(request, {'conf': {}, 'errors': messages}, [status_proc])) - - for section in conf.iterkeys(): - for option in conf[section]['options'].iterkeys(): - if conf[section]['options'][option]['input']: - conf[section]['options'][option]['input'] = conf[section]['options'][option]['input'].split(";") - + return render_to_response(join(settings.TEMPLATE, 'settings.html'), RequestContext(request, {'conf': conf, 'messages': []}, [status_proc])) diff --git a/module/web/templates/default/settings.html b/module/web/templates/default/settings.html index b0260cec5..36563b086 100644 --- a/module/web/templates/default/settings.html +++ b/module/web/templates/default/settings.html @@ -33,15 +33,17 @@ <form id="horizontalForm" action="" method="POST"> - {% for skey, section in conf.items %} + {% for skey, section in conf.iteritems %} - <h2>{{section.name}}</h2> - - {% for okey, option in section.options.items %} + <h2>{{section.desc}}</h2> + + {% for okey, option in section.items %} + {% ifnotequal okey "desc" %} + <label for="{{skey}}|{{okey}}" style="color:#424242;"> - {{option.name}} - {% ifequal option.type "bool" %} + {{option.desc}} + {% ifequal option.typ "bool" %} <select id="{{skey}}|{{okey}}" name="{{skey}}|{{okey}}"> <option {% if option.value %} selected="selected" {% endif %}value="True">{% trans "on" %}</option> <option {% if not option.value %} selected="selected" {% endif %}value="False">{% trans "off" %}</option> @@ -58,6 +60,9 @@ {% endif %} {% endifequal %} </label> + + {% endifnotequal %} + {% endfor %} <br /><br /><br /><br /> {% endfor %} |