summaryrefslogtreecommitdiffstats
path: root/pyload/webui
diff options
context:
space:
mode:
authorGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-19 20:18:32 +0200
committerGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-19 20:18:32 +0200
commitcc2ab2fa795ac68a2842a3743d9e4edeb47b56bf (patch)
tree965c07203c30b70c533618b85c88c0ea0f6aab46 /pyload/webui
parentadded: colred logs for webui to (currently only for theme "Next") (diff)
downloadpyload-cc2ab2fa795ac68a2842a3743d9e4edeb47b56bf.tar.xz
sorted config in webui ("Activated" is always the top option)
NOTE: The options are sorted like in pyload.conf & plugin.conf For sorting like plugins "__config" - array plugin.conf must be recreated by simply delete the file
Diffstat (limited to 'pyload/webui')
-rw-r--r--pyload/webui/app/json.py7
-rw-r--r--pyload/webui/themes/Dark/tml/settings_item.html2
-rw-r--r--pyload/webui/themes/Default/tml/settings_item.html2
-rw-r--r--pyload/webui/themes/Flat/tml/settings_item.html2
-rw-r--r--pyload/webui/themes/Next/tml/settings_item.html2
5 files changed, 8 insertions, 7 deletions
diff --git a/pyload/webui/app/json.py b/pyload/webui/app/json.py
index 12dce2484..0805e9f5b 100644
--- a/pyload/webui/app/json.py
+++ b/pyload/webui/app/json.py
@@ -202,7 +202,7 @@ def edit_package():
id = int(request.forms.get("pack_id"))
data = {"name": request.forms.get("pack_name").decode("utf8", "ignore"),
"folder": request.forms.get("pack_folder").decode("utf8", "ignore"),
- "password": request.forms.get("pack_pws").decode("utf8", "ignore")}
+ "password": request.forms.get("pack_pws").decode("utf8", "ignore")}
PYLOAD.setPackageData(id, data)
return {"response": "success"}
@@ -249,7 +249,8 @@ def load_config(category, section):
option['value'] = decode(option['value'])
- return render_to_response("settings_item.html", {"skey": section, "section": conf[section]})
+ return render_to_response("settings_item.html", {"sorted_conf": lambda c: sorted(c.items(), key=lambda i: i[1]['idx'] if i[0] not in ("desc", "outline") else 0),
+ "skey": section, "section": conf[section]})
@route('/json/save_config/<category>', method='POST')
@@ -299,7 +300,7 @@ def update_accounts():
elif action == "limitdl" and value.isdigit():
PYLOAD.updateAccount(plugin, user, options={"limitDL": [value]})
elif action == "delete":
- deleted.append((plugin,user))
+ deleted.append((plugin, user))
PYLOAD.removeAccount(plugin, user)
diff --git a/pyload/webui/themes/Dark/tml/settings_item.html b/pyload/webui/themes/Dark/tml/settings_item.html
index af24d6eaf..c7e60865e 100644
--- a/pyload/webui/themes/Dark/tml/settings_item.html
+++ b/pyload/webui/themes/Dark/tml/settings_item.html
@@ -2,7 +2,7 @@
{% if section.outline %}
<tr><th colspan="2">{{ section.outline }}</th></tr>
{% endif %}
- {% for okey, option in section.iteritems() %}
+ {% for okey, option in sorted_conf(section) %}
{% if okey not in ("desc","outline") %}
<tr>
<td><label for="{{skey}}|{{okey}}"
diff --git a/pyload/webui/themes/Default/tml/settings_item.html b/pyload/webui/themes/Default/tml/settings_item.html
index 6642d34b4..83a008619 100644
--- a/pyload/webui/themes/Default/tml/settings_item.html
+++ b/pyload/webui/themes/Default/tml/settings_item.html
@@ -2,7 +2,7 @@
{% if section.outline %}
<tr><th colspan="2">{{ section.outline }}</th></tr>
{% endif %}
- {% for okey, option in section.iteritems() %}
+ {% for okey, option in sorted_conf(section) %}
{% if okey not in ("desc", "outline") %}
<tr>
<td><label for="{{skey}}|{{okey}}"
diff --git a/pyload/webui/themes/Flat/tml/settings_item.html b/pyload/webui/themes/Flat/tml/settings_item.html
index 28de1a1a9..71c212304 100644
--- a/pyload/webui/themes/Flat/tml/settings_item.html
+++ b/pyload/webui/themes/Flat/tml/settings_item.html
@@ -2,7 +2,7 @@
{% if section.outline %}
<tr><th colspan="2">{{ section.outline }}</th></tr>
{% endif %}
- {% for okey, option in section.iteritems() %}
+ {% for okey, option in sorted_conf(section) %}
{% if okey not in ("desc","outline") %}
<tr>
<td><label for="{{skey}}|{{okey}}"
diff --git a/pyload/webui/themes/Next/tml/settings_item.html b/pyload/webui/themes/Next/tml/settings_item.html
index 4d07eddb4..72566950f 100644
--- a/pyload/webui/themes/Next/tml/settings_item.html
+++ b/pyload/webui/themes/Next/tml/settings_item.html
@@ -3,7 +3,7 @@
{% if section.outline %}
<tr><th colspan="2">{{ section.outline }}</th></tr>
{% endif %}
- {% for okey, option in section.iteritems() %}
+ {% for okey, option in sorted_conf(section) %}
{% if okey not in ("desc","outline") %}
<tr>
<td><label for="{{skey}}|{{okey}}"