summaryrefslogtreecommitdiffstats
path: root/module/web/templates
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-12-15 17:48:30 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-12-15 17:48:30 +0100
commit95d09b338ac7aed2b387bf143a5cfd1c4b29f612 (patch)
tree2f6c078f95bbc80f423609bacab8066fe86d7067 /module/web/templates
parentgui queue view - unstable (non thread safe) (diff)
downloadpyload-95d09b338ac7aed2b387bf143a5cfd1c4b29f612.tar.xz
new Django webinterface(in development), small fixes
Diffstat (limited to 'module/web/templates')
-rw-r--r--module/web/templates/default.tpl230
-rw-r--r--module/web/templates/default/base.html99
-rw-r--r--module/web/templates/default/downloads.html16
-rw-r--r--module/web/templates/default/home.html1
-rw-r--r--module/web/templates/default/login.html35
-rw-r--r--module/web/templates/default/logout.html9
-rw-r--r--module/web/templates/default/logs.html16
-rw-r--r--module/web/templates/default/queue.html16
-rw-r--r--module/web/templates/default/window.html (renamed from module/web/templates/window.tpl)0
-rw-r--r--module/web/templates/footer.tpl6
-rw-r--r--module/web/templates/header.tpl24
11 files changed, 192 insertions, 260 deletions
diff --git a/module/web/templates/default.tpl b/module/web/templates/default.tpl
deleted file mode 100644
index 3f5e8d8e8..000000000
--- a/module/web/templates/default.tpl
+++ /dev/null
@@ -1,230 +0,0 @@
-%header = 'pyLoad Webinterface'
-%js = ['mootools-1.2.3-core.js','mootools-1.2.3.1-more.js']
-
-%if page== "home": js.append('default/home.js')
-%end
-%if page== "loggedin": red=True
-%else: red=False
-%end
-%if page != "loggedin" and page != "login": js.append('default/status.js')
-%end
-
-%include header title=header, use_js=js, use_css=['default.css','window.css'], redirect=red
-
-%include window id="addlinks", width=400, caption="Add links", body="<input id='pname' type='text' style='width: 345px;' value='Package'/><textarea rows=10 style='width: 345px;' id='linkarea'></textarea>", button="Add"
-
-<a class="anchor" name="top" id="top"></a>
-
-<div id="head-panel">
-
-
- <div id="head-search-and-login">
-
-%if page != "login":
- <img src="static/default/head-login.png" alt="User:" style="vertical-align:middle; margin:2px" /><span style="padding-right: 2px;">{{user}}</span>
- <ul id="user-actions">
- <li><a href="/logout" class="action logout" rel="nofollow">Logout</a></li>
- <li></li>
- <li></li>
- </ul>
-%else:
- <span style="padding-right: 2px;">Please Login!</span>
-
-
-%end
- </div>
-
- <a href="/"><img id="head-logo" src="/static/default/pyload-logo-edited3.5-new-font-small.png" alt="pyLoad" /></a>
-
- <div id="head-menu">
- <ul>
- <li class="
- %if page == "home" or page == "login":
- selected
- %endif
- "><a href="/" title=""><img src="static/default/head-menu-home.png" alt="" /> Home</a></li>
- <li class="
- %if page == "queue":
- selected
- %endif
- "><a href="/queue" title=""><img src="static/default/head-menu-download.png" alt="" /> Queue</a></li>
- <li class="
- %if page == "downloads":
- selected
- %endif
- "><a href="/downloads" title=""><img src="static/default/head-menu-development.png" alt="" /> Downloads</a></li>
- <li class="right"><a href="/logs" class="action index" accesskey="x" rel="nofollow"><img src="static/default/head-menu-index.png" alt="" />Logs</a></li> </ul>
- </div>
-
- <div style="clear:both;"></div>
-</div>
-
-<ul id="page-actions">
- <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li>
-
-</ul>
-
-<div id="body-wrapper" class="dokuwiki">
-
- <div id="content" lang="en" dir="ltr">
-
-
-<h1><a name="pyload_download_manager_for_1_click_hoster" id="pyload_download_manager_for_1_click_hoster">pyLoad — Webinterface</a>
-</h1>
-
-
-%if page != "loggedin" and page != "login":
-
-<div id="statusbar">
- <div id="status" style="float: left;padding: 8px;">
-Status:
-</div>
- <div id="speed" style="float: left;padding: 8px">
-Speed: 
-</div>
-
- <div id="queue" style="float: left;padding: 8px">
-Files in queue: 
-</div>
-
-<div style="padding-top:2px">
-
-<div style="background-image:url(static/default/Button-Play.png);width:32px;height:32px;float:left"></div>
-<div class= "statusbutton" style="background-image:url(static/default/Button-Play-grey.png); visibility: visible; opacity: 0.01"></div>
-<div style="background-image:url(static/default/Button-Pause.png);width:32px;height:32px;float:left"></div>
-<div class= "statusbutton" style="background-image:url(static/default/Button-Pause-grey.png); visibility: visible; opacity: 0.01"></div>
-<div style="background-image:url(static/default/Button-Add.png);width:32px;height:32px;float:left"></div>
-<div class= "statusbutton" style="background-image:url(static/default/Button-Add-grey.png); visibility: visible; opacity: 0.01"></div>
-
-
-</div>
-
-</div>
-
-%end
-
-
-<br>
-
-<div class="level1" style="clear:both">
-
-%if page == "login":
-
-</div>
-<div class="centeralign">
-<form action="" method="post" accept-charset="utf-8" id="login"><div class="no">
-<input type="hidden" name="do" value="login" /><fieldset ><legend>Login</legend>
-<label class="block" for="focus__this"><span>Username</span> <input type="text" id="focus__this" name="u" class="edit" /></label><br />
-<label class="block"><span>Password</span> <input type="password" name="p" class="edit" /></label><br />
-<input type="submit" value="Login" class="button" />
-</fieldset>
-</div></form>
-</div>
-<br>
-
-%elif page== "home":
-<h2>Downloads:</h2>
-
-<div id="dlcontainer">
-
-% for link in links:
-
-
-<div class="download" id="dl{{link['id']}}" style="color: #000">
-<p></p>
-
-<b>{{link['name']}}</b>
-<br>
-<script type="text/javascript">
-pbs[{{link['id']}}] = new dwProgressBar({
- container: document.id('dl{{link['id']}}'),
- startPercentage: {{link['percent']}},
- speed: 1000,
- id: {{link['id']}},
- boxID: 'box',
- percentageID: 'perc',
- displayText: true,
- displayID: 'boxtext'
-});
-
-dls.push({{link['id']}})
-
-</script>
-
-
-<div class="dlsize">
-{{int((link['size'] - link['kbleft']) / 1024)}}/{{int(link['size']) / 1024}} MB
-</div>
-
-
-<div class="dlspeed">
-{{int(link['speed'])}} kb/s
-</div>
-
-
-<div class="dltime">
-{{link['eta']}}
-</div>
-
-
-</div>
-
-
-<script type="text/javascript">
-$$("#dl{{link['id']}}")[0].hover(function(e){
-
-this.morph({'color': '#f00'});
-
-}, function(e){
-
-this.morph({'color': '#000'});
-
-});
-
-
-</script>
-
-
-%end
-
-</div>
-
-
-%elif page=="loggedin":
-
-
-<b>You were successfully logged in</b>
-
-%elif page=="queue":
-
-<ul>
-
-%for package in links:
-
-<li>{{package.name}}</li>
-
-%end
-
-</ul>
-
-Currently in Development
-
-%elif page=="downloads":
-
-Currently in Development
-
-
-%end
- <hr style="clear: both;" />
-
-<div id="foot">© 2008-2009 the pyLoad Team
-
- <a href="#top" class="action top" accesskey="x"><span>Back to top</span></a><br />
- <!--<div class="breadcrumbs"></div>-->
-
-
-</div>
-
-</div>
-
-%include footer use_js=[] \ No newline at end of file
diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html
new file mode 100644
index 000000000..096692a3c
--- /dev/null
+++ b/module/web/templates/default/base.html
@@ -0,0 +1,99 @@
+<?xml version="1.0" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/default.css">
+{% block head %}
+{% endblock %}
+<title>{% block title %}pyLoad Webinterface{% endblock %}</title>
+</head>
+
+<a class="anchor" name="top" id="top"></a>
+
+<div id="head-panel">
+
+<div id="head-search-and-login">
+
+{% if user.is_authenticated %}
+<img src="{{ MEDIA_URL }}img/head-login.png" alt="User:" style="vertical-align:middle; margin:2px" /><span style="padding-right: 2px;">{{user.username}}</span>
+ <ul id="user-actions">
+ <li><a href="/logout" class="action logout" rel="nofollow">Logout</a></li>
+ {% if user.is_staff %}
+ <li><a href="/admin" class="action profile" rel="nofollow">Administrate</a></li>
+ {% endif %}
+ <li></li>
+ <li></li>
+ </ul>
+{% else %}
+ <span style="padding-right: 2px;">Please Login!</span>
+{% endif %}
+
+ </div>
+
+ <a href="/"><img id="head-logo" src="{{ MEDIA_URL }}img/pyload-logo-edited3.5-new-font-small.png" alt="pyLoad" /></a>
+
+ <div id="head-menu">
+ <ul>
+
+ {% block menu %}
+ <li class="selected">
+ <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a>
+ </li>
+ <li>
+ <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li>
+ <li>
+ <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li>
+ <li class="right">
+ <a href="/logs/" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a>
+ </li>
+ {% endblock %}
+
+ </ul>
+ </div>
+
+ <div style="clear:both;"></div>
+</div>
+
+<ul id="page-actions">
+ <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li>
+
+</ul>
+
+<div id="body-wrapper" class="dokuwiki">
+
+<div id="content" lang="en" dir="ltr">
+
+<h1><a name="pyload_download_manager_for_1_click_hoster" id="pyload_download_manager_for_1_click_hoster">pyLoad — Webinterface</a>
+</h1>
+
+{% block statusbar %}
+{% endblock %}
+
+
+<br>
+
+<div class="level1" style="clear:both">
+</div>
+
+{% for message in messages %}
+ <b><p>{{message}}</p></b>
+{% endfor %}
+
+{% block content %}
+{% endblock content %}
+
+ <hr style="clear: both;" />
+
+<div id="foot">© 2008-2010 the pyLoad Team
+
+ <a href="#top" class="action top" accesskey="x"><span>Back to top</span></a><br />
+ <!--<div class="breadcrumbs"></div>-->
+
+
+</div>
+</div>
+</head>
+<body>
diff --git a/module/web/templates/default/downloads.html b/module/web/templates/default/downloads.html
new file mode 100644
index 000000000..3c9bb5df4
--- /dev/null
+++ b/module/web/templates/default/downloads.html
@@ -0,0 +1,16 @@
+{% extends 'default/base.html' %}
+
+{% block title %}Downloads - {{block.super}} {% endblock %}
+
+{% block menu %}
+<li>
+ <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a>
+</li>
+<li>
+ <a href="/queue" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li>
+<li class="selected">
+ <a href="/downloads" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li>
+<li class="right">
+ <a href="/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
diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html
new file mode 100644
index 000000000..895302e61
--- /dev/null
+++ b/module/web/templates/default/home.html
@@ -0,0 +1 @@
+{% extends 'default/base.html' %} \ No newline at end of file
diff --git a/module/web/templates/default/login.html b/module/web/templates/default/login.html
new file mode 100644
index 000000000..851802c4f
--- /dev/null
+++ b/module/web/templates/default/login.html
@@ -0,0 +1,35 @@
+{% extends 'default/base.html' %}
+
+{% block title %}Login - {{block.super}} {% endblock %}
+
+{% block content %}
+
+<div class="centeralign">
+<form action="" method="post" accept-charset="utf-8" id="login">
+ <div class="no">
+ <input type="hidden" name="do" value="login" />
+ <fieldset>
+ <legend>Login</legend>
+ <label class="block" for="focus__this">
+ <span>Username</span>
+ {{ form.username }}
+ </label>
+ <br />
+ <label class="block">
+ <span>Password</span>
+ {{ form.password }}
+ </label>
+ <br />
+ <input type="submit" value="Login" class="button" />
+ </fieldset>
+ </div>
+</form>
+
+{% if form.errors %}
+<p>Your username and password didn't match. Please try again.</p>
+{% endif %}
+
+</div>
+<br>
+
+{% endblock %} \ No newline at end of file
diff --git a/module/web/templates/default/logout.html b/module/web/templates/default/logout.html
new file mode 100644
index 000000000..4d00bf6d5
--- /dev/null
+++ b/module/web/templates/default/logout.html
@@ -0,0 +1,9 @@
+{% extends 'default/base.html' %}
+
+{% block head %}
+<meta http-equiv="refresh" content="3; url=/">
+{% endblock %}
+
+{% block content %}
+<p><b>You were successfully logged out.</b></p>
+{% endblock %} \ No newline at end of file
diff --git a/module/web/templates/default/logs.html b/module/web/templates/default/logs.html
new file mode 100644
index 000000000..d6f392f58
--- /dev/null
+++ b/module/web/templates/default/logs.html
@@ -0,0 +1,16 @@
+{% extends 'default/base.html' %}
+
+{% block title %}Logs - {{block.super}} {% endblock %}
+
+{% block menu %}
+<li>
+ <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a>
+</li>
+<li>
+ <a href="/queue" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li>
+<li>
+ <a href="/downloads" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li>
+<li class="right" class="selected">
+ <a href="/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
diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html
new file mode 100644
index 000000000..b6a185b19
--- /dev/null
+++ b/module/web/templates/default/queue.html
@@ -0,0 +1,16 @@
+{% extends 'default/base.html' %}
+
+{% block title %}Queue - {{block.super}} {% endblock %}
+
+{% block menu %}
+<li>
+ <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a>
+</li>
+<li class="selected">
+ <a href="/queue" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li>
+<li>
+ <a href="/downloads" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li>
+<li class="right">
+ <a href="/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
diff --git a/module/web/templates/window.tpl b/module/web/templates/default/window.html
index f756c4352..f756c4352 100644
--- a/module/web/templates/window.tpl
+++ b/module/web/templates/default/window.html
diff --git a/module/web/templates/footer.tpl b/module/web/templates/footer.tpl
deleted file mode 100644
index a59b414bf..000000000
--- a/module/web/templates/footer.tpl
+++ /dev/null
@@ -1,6 +0,0 @@
-%for item in use_js:
-<script type="text/javascript" src="static/{{item}}"></script>
-%end
-
-</body>
-</html>
diff --git a/module/web/templates/header.tpl b/module/web/templates/header.tpl
deleted file mode 100644
index 22c252e3c..000000000
--- a/module/web/templates/header.tpl
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-
-%for item in use_js:
-<script type="text/javascript" src="static/{{item}}"></script>
-%end
-
-%for item in use_css:
-<link rel="stylesheet" type="text/css" href="static/{{item}}">
-%end
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-
-%if redirect:
-<meta http-equiv="refresh" content="3; url=/">
-%end
-
-<title>{{title}}</title>
-
-</head>
-<body>