summaryrefslogtreecommitdiffstats
path: root/module/web
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-01-13 21:12:24 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2010-01-13 21:12:24 +0100
commit36ed6c373b8dfde42f81e28d62c540aba5a3c04d (patch)
treeb4f29e3539cf9dad9a9f9a3d98afda7e130d7fae /module/web
parentFixed MyVideo.de (yuck) (diff)
downloadpyload-36ed6c373b8dfde42f81e28d62c540aba5a3c04d.tar.xz
queue template + view
Diffstat (limited to 'module/web')
-rw-r--r--module/web/pyload/views.py10
-rw-r--r--module/web/templates/default/queue.html17
2 files changed, 24 insertions, 3 deletions
diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py
index a28b71e69..55887d711 100644
--- a/module/web/pyload/views.py
+++ b/module/web/pyload/views.py
@@ -73,7 +73,13 @@ def home(request):
@permission('pyload.can_see_dl')
@check_server
def queue(request):
- return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {}, [status_proc]))
+ queue = settings.PYLOAD.get_queue()
+ for pack in queue:
+ children = []
+ for child in settings.PYLOAD.get_package_files(pack["id"]):
+ children.append(settings.PYLOAD.get_file_info())
+ pack["children"] = children
+ return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {'content': queue}, [status_proc]))
@login_required
@@ -147,4 +153,4 @@ def logs(request, page=0):
for i in range(page, page + 20):
data.append({'line': i + 1, 'content':log[i]})
- return render_to_response(join(settings.TEMPLATE, 'logs.html'), RequestContext(request, {'log': data, 'next': str(page + 20), 'prev': 0 if page-20 < 0 else page-20}, [status_proc])) \ No newline at end of file
+ return render_to_response(join(settings.TEMPLATE, 'logs.html'), RequestContext(request, {'log': data, 'next': str(page + 20), 'prev': 0 if page-20 < 0 else page-20}, [status_proc]))
diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html
index b4f1cb278..e9c1baa92 100644
--- a/module/web/templates/default/queue.html
+++ b/module/web/templates/default/queue.html
@@ -13,4 +13,19 @@
<li class="right">
<a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a>
</li>
-{% endblock %} \ No newline at end of file
+{% endblock %}
+
+{% block content %}
+<ul id="queue">
+ {% for package in content %}
+ <li class="package">
+ <span class="packagename">{{ package.package_name }}</span>
+ <ul class="children">
+ {% for child in package.children %}
+ <li class="child">{{ child.filename }}</li>
+ {% endfor %}
+ </ul>
+ </li>
+ {% endfor %}
+<ul>
+{% endblock %}