diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-02-17 01:18:06 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-02-17 01:18:06 +0100 |
commit | ed2373b3c3568db328e8000984f8dfc98028db73 (patch) | |
tree | bd08ffb6259a5a938465e6066cc6a034ae8321b8 /module/web/templates/default/home.html | |
parent | webui temp (diff) | |
parent | delete tmp folder (diff) | |
download | pyload-ed2373b3c3568db328e8000984f8dfc98028db73.tar.xz |
Merge branch 'pr/n1006_mariusbaumann' into 0.4.10
Diffstat (limited to 'module/web/templates/default/home.html')
-rw-r--r-- | module/web/templates/default/home.html | 125 |
1 files changed, 68 insertions, 57 deletions
diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 7359e326c..0cbbca280 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -77,6 +77,7 @@ var EntryManager = new Class({ } }, this) + }catch(e){ //alert(e) } @@ -105,20 +106,29 @@ var LinkEntry = new Class({ }, insert: function(item){ try{ + + this.elements = { tr: new Element('tr', { 'html': '', 'styles':{ - 'opacity': 0 + 'opacity': 0, } }), + status: new Element('td', { + 'html': ' ', + }), + statusspan: new Element('span', { + 'html': item.statusmsg, + 'class': 'label label-default', + 'styles':{ + + } + }), name: new Element('td', { 'html': item.name }), - status: new Element('td', { - 'html': item.statusmsg - }), info: new Element('td', { 'html': item.info }), @@ -128,31 +138,43 @@ var LinkEntry = new Class({ percent: new Element('span', { 'html': item.percent+ '% / '+ humanFileSize(item.size-item.bleft) }), - remove: new Element('img',{ - 'src': 'media/default/img/control_cancel.png', - 'styles':{ - 'vertical-align': 'middle', - 'margin-right': '-20px', - 'margin-left': '5px', - 'margin-top': '-2px', - 'cursor': 'pointer' - } + remove: new Element('span',{ + 'html': '', + 'class': 'glyphicon glyphicon-remove', + 'styles':{ + 'margin-left': '3px', + } }), pgbTr: new Element('tr', { - 'html':'' + 'html':'', + 'styles':{ + 'border-top-color': '#fff', + } + }), + progress: new Element('div', { + 'html':'', + 'class':'progress', + 'styles':{ + 'margin-bottom': '0px', + } }), pgb: new Element('div', { - 'html': ' ', + 'html':'', + 'class':'progress-bar progress-bar-striped active', + 'role':'progress', 'styles':{ - 'height': '4px', 'width': item.percent+'%', 'background-color': '#ddd' } }) + }; - this.elements.tr.adopt(this.elements.name,this.elements.status,this.elements.info,this.elements.bleft,new Element('td').adopt(this.elements.percent,this.elements.remove)); - this.elements.pgbTr.adopt(new Element('td',{'colspan':5}).adopt(this.elements.pgb)); + + this.elements.status.adopt(this.elements.statusspan); + this.elements.progress.adopt(this.elements.pgb); + this.elements.tr.adopt(this.elements.status,this.elements.name,this.elements.info,this.elements.bleft,new Element('td').adopt(this.elements.percent,this.elements.remove)); + this.elements.pgbTr.adopt(new Element('td',{'colspan':5}).adopt(this.elements.progress)); this.initEffects(); }catch(e){ alert(e) @@ -171,15 +193,27 @@ var LinkEntry = new Class({ }, update: function(item){ this.elements.name.set('text', item.name); - this.elements.status.set('text', item.statusmsg); + this.elements.statusspan.set('text', item.statusmsg); this.elements.info.set('text', item.info); this.elements.bleft.set('text', item.format_size); this.elements.percent.set('text', item.percent+ '% / '+ humanFileSize(item.size-item.bleft)); + if (item.statusmsg == "waiting") { + this.elements.statusspan.set('class', 'label label-warning') + } else if (item.statusmsg == "starting") { + this.elements.statusspan.set('class', 'label label-info') + } else if (item.statusmsg == "downloading") { + this.elements.statusspan.set('class', 'label label-success') + } else if (item.stausmsg == "extracting") { + this.elements.statusspan.set('class', 'label label-primary') + } else { + this.elements.statusspan.set('class', 'label label-default') + } if(!operafix) { + this.bar.start({ 'width': item.percent, - 'background-color': [Math.round(120/100*item.percent),100,100].hsbToRgb().rgbToHex() + 'background-color': [Math.round(120/100*item.percent),80,70].hsbToRgb().rgbToHex() }); } else @@ -188,9 +222,10 @@ var LinkEntry = new Class({ 'styles', { 'height': '4px', 'width': item.percent+'%', - 'background-color': [Math.round(120/100*item.percent),100,100].hsbToRgb().rgbToHex(), + 'background-color': [Math.round(50/200*item.percent),0,200].hsbToRgb().rgbToHex(), }); } + }, remove: function(){ this.fade.start('opacity',0).chain(function(){this.elements.tr.dispose();}.bind(this)); @@ -198,57 +233,32 @@ var LinkEntry = new Class({ } }); + + </script> - -{% endblock %} - -{% block subtitle %} -{{_("Active Downloads")}} -{% endblock %} - -{% block menu %} -<li class="selected"> - <a href="/" title=""><img src="/media/default/img/head-menu-home.png" alt="" /> {{_("Home")}}</a> -</li> -<li> - <a href="/queue/" title=""><img src="/media/default/img/head-menu-queue.png" alt="" /> {{_("Queue")}}</a> -</li> -<li> - <a href="/collector/" title=""><img src="/media/default/img/head-menu-collector.png" alt="" /> {{_("Collector")}}</a> -</li> -<li> - <a href="/downloads/" title=""><img src="/media/default/img/head-menu-development.png" alt="" /> {{_("Downloads")}}</a> -</li> -{#<li>#} -{# <a href="/filemanager/" title=""><img src="/media/default/img/head-menu-download.png" alt="" /> {{_("FileManager")}}</a>#} -{#</li>#} -<li class="right"> - <a href="/logs/" class="action index" accesskey="x" rel="nofollow"><img src="/media/default/img/head-menu-index.png" alt="" />{{_("Logs")}}</a> -</li> -<li class="right"> - <a href="/settings/" class="action index" accesskey="x" rel="nofollow"><img src="/media/default/img/head-menu-config.png" alt="" />{{_("Config")}}</a> -</li> {% endblock %} +{% block subtitle %}{{_("Active Downloads")}}{% endblock %} {% block content %} -<table width="100%" class="queue"> +<table class="table" style="width:100%;"> <thead> <tr class="header"> - <th>{{_("Name")}}</th> <th>{{_("Status")}}</th> + <th>{{_("Name")}}</th> <th>{{_("Information")}}</th> <th>{{_("Size")}}</th> <th>{{_("Progress")}}</th> </tr> </thead> +</br> <tbody id="LinksAktiv"> {% for link in content %} <tr id="link_{{ link.id }}"> - <td id="link_{{ link.id }}_name">{{ link.name }}</td> - <td id="link_{{ link.id }}_status">{{ link.status }}</td> - <td id="link_{{ link.id }}_info">{{ link.info }}</td> - <td id="link_{{ link.id }}_bleft">{{ link.format_size }}</td> + <td id="link_{{ link.id }}_status"><span class="label label-{% if link.status == 'downloading' %}success{% endif %}{% if link.status == 'extracting' %}primary{% endif %}{% if link.status == 'starting' %}warning{% else %}default{% endif %}">{{ link.status }}</span></td> + <td id="link_{{ link.id }}_name">{{ link.name }}</td> + <td id="link_{{ link.id }}_info">{{ link.info }}</td> + <td id="link_{{ link.id }}_bleft">{{ link.format_size }}</td> <td> <span id="link_{{ link.id }}_percent">{{ link.percent }}% /{{ link.bleft }}</span> <img id="link_{{ link.id }}_remove" style="vertical-align: middle; margin-right: -20px; margin-left: 5px; margin-top: -2px; cursor:pointer;" src="media/default/img/control_cancel.png"/> @@ -263,4 +273,5 @@ var LinkEntry = new Class({ </tbody> </table> -{% endblock %}
\ No newline at end of file +</div> +{% endblock %} |