diff options
Diffstat (limited to 'module/web')
-rw-r--r-- | module/web/json_app.py | 3 | ||||
-rw-r--r-- | module/web/media/default/css/default.css | 2 | ||||
-rw-r--r-- | module/web/pyload_app.py | 4 | ||||
-rw-r--r-- | module/web/templates/default/collector.html | 58 | ||||
-rw-r--r-- | module/web/templates/default/edit_package.html | 13 | ||||
-rw-r--r-- | module/web/templates/default/package_ui.js | 12 | ||||
-rw-r--r-- | module/web/templates/default/queue.html | 30 | ||||
-rw-r--r-- | module/web/webinterface.py | 3 |
8 files changed, 29 insertions, 96 deletions
diff --git a/module/web/json_app.py b/module/web/json_app.py index 959b3d974..0573eff77 100644 --- a/module/web/json_app.py +++ b/module/web/json_app.py @@ -306,8 +306,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"), - "priority": request.forms.get("pack_prio"), - "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"} diff --git a/module/web/media/default/css/default.css b/module/web/media/default/css/default.css index 978aeadde..fc0d148c2 100644 --- a/module/web/media/default/css/default.css +++ b/module/web/media/default/css/default.css @@ -588,8 +588,8 @@ td p { }
.packagename {
font-weight: bold;
- text-transform: uppercase;
}
+
.child {
margin-left: 20px;
}
diff --git a/module/web/pyload_app.py b/module/web/pyload_app.py index 35203ad7b..8d76d39ec 100644 --- a/module/web/pyload_app.py +++ b/module/web/pyload_app.py @@ -163,7 +163,7 @@ def queue(): queue.sort(key=attrgetter("order")) - return render_to_response('queue.html', {'content': queue}, [pre_processor]) + return render_to_response('queue.html', {'content': queue, 'target': 1}, [pre_processor]) @route("/collector") @@ -173,7 +173,7 @@ def collector(): queue.sort(key=attrgetter("order")) - return render_to_response('collector.html', {'content': queue}, [pre_processor]) + return render_to_response('queue.html', {'content': queue, 'target': 0}, [pre_processor]) @route("/downloads") diff --git a/module/web/templates/default/collector.html b/module/web/templates/default/collector.html deleted file mode 100644 index 20221b899..000000000 --- a/module/web/templates/default/collector.html +++ /dev/null @@ -1,58 +0,0 @@ -{% extends 'default/base.html' %}
-{% block head %}
-
-<script type="text/javascript" src="/package_ui.js"></script>
-
-<script type="text/javascript">
-
-document.addEvent("domready", function(){
- var pUI = new PackageUI("url", 0);
-});
-</script>
-{% endblock %}
-
-{% block title %}{{_("Collector")}} - {{super()}} {% endblock %}
-{% block subtitle %}{{_("Collector")}}{% endblock %}
-
-{% block pageactions %}
-<ul id="page-actions-more">
- <li id="del_finished"><a style="padding: 0; font-weight: bold;" href="#">{{_("Delete Finished")}}</a></li>
- <li id="restart_failed"><a style="padding: 0; font-weight: bold;" href="#">{{_("Restart Failed")}}</a></li>
-</ul>
-{% endblock %}
-
-{% block content %}
-
-<ul id="package-list" style="list-style: none; padding-left: 0; margin-top: -10px;">
-{% for package in content %}
- <li>
-<div id="package_{{package.pid}}" class="package">
- <div class="order" style="display: none;">{{ package.order }}</div>
-
- <div class="packagename" style="cursor: pointer;">
- <img class="package_drag" src="/media/default/img/folder.png" style="cursor: move; margin-bottom: -2px">
- <span class="name">{{package.name}}</span>
-
- <span class="buttons" style="opacity:0">
- <img title="{{_("Delete Package")}}" style="cursor: pointer" width="12px" height="12px" src="/media/default/img/delete.png" />
-
- <img title="{{_("Restart Package")}}" style="margin-left: -10px; cursor: pointer" height="12px" src="/media/default/img/arrow_refresh.png" />
-
- <img title="{{_("Edit Package")}}" style="margin-left: -10px; cursor: pointer" height="12px" src="/media/default/img/pencil.png" />
-
- <img title="{{_("Move Package to Queue")}}" style="margin-left: -10px; cursor: pointer" height="12px" src="/media/default/img/package_go.png" />
- </span>
- </div>
- <div id="children_{{package.pid}}" style="display: none;" class="children">
- <span class="child_secrow">{{_("Folder:")}} <span class="folder">{{package.folder}}</span> | {{_("Password:")}} <span class="password">{{package.password}}</span> | {{_("Priority:")}} <span class="prio">{{package.priority}}</span></span>
- <ul id="sort_children_{{package.pid}}" style="list-style: none; padding-left: 0">
- </ul>
- </div>
-</div>
- </li>
-{% endfor %}
-</ul>
-
-{% include "default/edit_package.html" %}
-
-{% endblock %}
diff --git a/module/web/templates/default/edit_package.html b/module/web/templates/default/edit_package.html index 0c9dcff42..f02540aaa 100644 --- a/module/web/templates/default/edit_package.html +++ b/module/web/templates/default/edit_package.html @@ -13,19 +13,6 @@ </label>
<input id="pack_folder" name="pack_folder" type="text" size="20" />
-<label for="pack_prio">{{_("Priority")}}
-<span class="small">{{_("Priority of the package.")}}</span>
-</label>
- <select name="pack_prio" id="pack_prio">
- <option value="3">{{_("highest")}}</option>
- <option value="2">{{_("higher")}}</option>
- <option value="1">{{_("high")}}</option>
- <option value="0" selected="selected">{{_("normal")}}</option>
- <option value="-1">{{_("low")}}</option>
- <option value="-2">{{_("lower")}}</option>
- <option value="-3">{{_("lowest")}}</option>
- </select>
-
<label for="pack_pws">{{_("Password")}}
<span class="small">{{_("List of passwords used for unrar.")}}</span>
</label>
diff --git a/module/web/templates/default/package_ui.js b/module/web/templates/default/package_ui.js index 0b938910a..1d0e25dd6 100644 --- a/module/web/templates/default/package_ui.js +++ b/module/web/templates/default/package_ui.js @@ -176,7 +176,6 @@ var Package = new Class({ this.name = this.ele.getElements('.name')[0]; this.folder = this.ele.getElements('.folder')[0]; this.password = this.ele.getElements('.password')[0]; - this.prio = this.ele.getElements('.prio')[0]; imgs[1].addEvent('click', this.deletePackage.bind(this)); @@ -352,16 +351,6 @@ var Package = new Class({ $("pack_folder").set("value", this.folder.get("text")); $("pack_pws").set("value", this.password.get("text")); - var prio = 3; - $("pack_prio").getChildren("option").each(function(item, index) { - item.erase("selected"); - if (prio.toString() == this.prio.get("text")) { - item.set("selected", "selected"); - } - prio--; - }.bind(this)); - - show_pack(); event.stop(); }, @@ -371,7 +360,6 @@ var Package = new Class({ this.name.set("text", $("pack_name").get("value")); this.folder.set("text", $("pack_folder").get("value")); this.password.set("text", $("pack_pws").get("value")); - this.prio.set("text", $("pack_prio").get("value")); hide_pack(); event.stop(); }, diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html index b9ec525a1..e1535a12e 100644 --- a/module/web/templates/default/queue.html +++ b/module/web/templates/default/queue.html @@ -6,13 +6,19 @@ <script type="text/javascript">
document.addEvent("domready", function(){
- var pUI = new PackageUI("url",1);
+ var pUI = new PackageUI("url", {{ target }});
});
</script>
{% endblock %}
-{% block title %}{{_("Queue")}} - {{super()}} {% endblock %}
-{% block subtitle %}{{_("Queue")}}{% endblock %}
+{% if target %}
+ {% set name = _("Queue") %}
+{% else %}
+ {% set name = _("Collector") %}
+{% endif %}
+
+{% block title %}{{name}} - {{super()}} {% endblock %}
+{% block subtitle %}{{name}}{% endblock %}
{% block pageactions %}
<ul id="page-actions-more">
@@ -23,14 +29,13 @@ document.addEvent("domready", function(){ {% block content %}
-
<ul id="package-list" style="list-style: none; padding-left: 0; margin-top: -10px;">
{% for package in content %}
<li>
<div id="package_{{package.pid}}" class="package">
<div class="order" style="display: none;">{{ package.order }}</div>
- <div class="packagename" style="cursor: pointer;">
+ <div class="packagename" style="cursor: pointer">
<img class="package_drag" src="/media/default/img/folder.png" style="cursor: move; margin-bottom: -2px">
<span class="name">{{package.name}}</span>
@@ -41,11 +46,22 @@ document.addEvent("domready", function(){
<img title="{{_("Edit Package")}}" style="margin-left: -10px; cursor: pointer" height="12px" src="/media/default/img/pencil.png" />
- <img title="{{_("Move Package to Collector")}}" style="margin-left: -10px; cursor: pointer" height="12px" src="/media/default/img/package_go.png" />
+ <img title="{{_("Move Package")}}" style="margin-left: -10px; cursor: pointer" height="12px" src="/media/default/img/package_go.png" />
</span>
</div>
+ {% set progress = (package.linksdone * 100) / package.linkstotal %}
+
+ <div id="progress" style="border-radius: 4px; border: 1px solid #AAAAAA; width: 50%; height: 1em">
+ <div style="width: {{ progress }}%; height: 100%; background-color: #add8e6;"></div>
+ <label style="font-size: 0.8em; font-weight: bold; padding-left: 5px; position: relative; top: -17px">
+ {{ package.sizedone|formatsize }} / {{ package.sizetotal|formatsize }}</label>
+ <label style="font-size: 0.8em; font-weight: bold; padding-right: 5px ;float: right; position: relative; top: -17px">
+ {{ package.linksdone }} / {{ package.linkstotal }}</label>
+ </div>
+ <div style="clear: both; margin-bottom: -10px"></div>
+
<div id="children_{{package.pid}}" style="display: none;" class="children">
- <span class="child_secrow">{{_("Folder:")}} <span class="folder">{{package.folder}}</span> | {{_("Password:")}} <span class="password">{{package.password}}</span> | {{_("Priority:")}} <span class="prio">{{package.priority}}</span></span>
+ <span class="child_secrow">{{_("Folder:")}} <span class="folder">{{package.folder}}</span> | {{_("Password:")}} <span class="password">{{package.password}}</span></span>
<ul id="sort_children_{{package.pid}}" style="list-style: none; padding-left: 0">
</ul>
</div>
diff --git a/module/web/webinterface.py b/module/web/webinterface.py index e54c8b137..4d07c436e 100644 --- a/module/web/webinterface.py +++ b/module/web/webinterface.py @@ -29,7 +29,7 @@ PYLOAD_DIR = abspath(join(PROJECT_DIR, "..", "..")) sys.path.append(PYLOAD_DIR) from module import InitHomeDir -from module.utils import decode +from module.utils import decode, formatSize import bottle from bottle import run, app @@ -81,6 +81,7 @@ env.filters["path_make_relative"] = path_make_relative env.filters["path_make_absolute"] = path_make_absolute env.filters["decode"] = decode env.filters["type"] = lambda x: str(type(x)) +env.filters["formatsize"] = formatSize translation = gettext.translation("django", join(PYLOAD_DIR, "locale"), |