add form again

This commit is contained in:
Martijn Voncken 2008-02-11 20:30:44 +00:00
parent 8719ad3c50
commit 9be62d2056
3 changed files with 50 additions and 20 deletions

View File

@ -48,7 +48,7 @@ import lib.webpy022 as web
from lib.webpy022.http import seeother, url from lib.webpy022.http import seeother, url
from lib.static_handler import static_handler from lib.static_handler import static_handler
import base64
from operator import attrgetter from operator import attrgetter
import os import os

View File

@ -1,5 +0,0 @@
#!/usr/bin/env python
import deluge_webserver
deluge_webserver.ws.init_05()
deluge_webserver.run()

View File

@ -1,9 +1,15 @@
$def with (add_form) $def with (add_form, options_form)
$:render.header(_("Add Torrent")) $:render.header(_("Add Torrent"))
<div class="panel"> <div class="panel">
<form method="POST" action="/torrent/add" ENCTYPE="multipart/form-data"> <form method="POST" action="/torrent/add" ENCTYPE="multipart/form-data">
<input type="hidden" name="redir" value="$get('redir')"> <input type="hidden" name="redir" value="$get('redir')">
<div id="torrent_add">
<div id="torrent_add" >
<table>
$:add_form.as_table()
</table>
<!--OLD stuff :
<div class="form_row"> <div class="form_row">
<span class="form_label">$_('Url')</span> <span class="form_label">$_('Url')</span>
<input type="text" name="url" class="form_input" size=60 <input type="text" name="url" class="form_input" size=60
@ -13,6 +19,15 @@ $:render.header(_("Add Torrent"))
<span class="form_label">$_('Upload torrent')</span> <span class="form_label">$_('Upload torrent')</span>
<input type="file" name="torrent" class="form_input" size=50> <input type="file" name="torrent" class="form_input" size=50>
</div> </div>
<div class="form_row">
<span class="form_label">$_('Hash')</span>
<input type="text" name="hash" class="form_input" size=60
value="$get('hash')" >
</div>
-->
<!-- <!--
<div class="form_row"> <div class="form_row">
<input type="checkbox" name="add_another" class="form_input" <input type="checkbox" name="add_another" class="form_input"
@ -23,35 +38,55 @@ $if get_config('add_another'):
</div> </div>
--> -->
<div class="form_row"> <a onclick="javascript:toggle_options()">$_('Options')</a>
<span class="form_label"></span> <!--todo: cookie setting for last-used options display or not-->
<input type="submit" name="submit"
value="$_('Submit')" class="form_input">
<h2>Options</h2> <br>
<div class="error">Options are not used yet!</div>
<h3>$_("Allocation/Location")</h3> <div id="torrent_add_options" style="display:none">
<!--
it's possible to use blocks with options_form, but not now.
<table> <table>
$:add_form.as_table(["download_location", "compact_allocation"]) $:options_form.as_table(["download_location", "compact_allocation"])
</table> </table>
<h3>$_("BandWidth")</h3> <h3>$_("BandWidth")</h3>
<table> <table>
$:add_form.as_table(["max_download_speed_per_torrent", "max_upload_speed_per_torrent", "max_connections_per_torrent", "max_upload_slots_per_torrent"]) $:options_form.as_table(["max_download_speed_per_torrent", "max_upload_speed_per_torrent", "max_connections_per_torrent", "max_upload_slots_per_torrent"])
</table> </table>
</td> </td>
<h3>$_("General")</h3> <h3>$_("General")</h3>
<table> <table>
$:add_form.as_table(["prioritize_first_last_pieces", "add_paused", "default_private"]) $:options_form.as_table(["prioritize_first_last_pieces", "add_paused", "default_private"])
</table> </table>
-->
<table>
$:options_form.as_table()
</table>
</div>
</div> </div>
<div class="form_row">
<span class="form_label"></span>
<input type="submit" name="submit"
value="$_('Submit')" class="form_input">
</div>
</form> </form>
</div> </div>
<script language="javascript">
function toggle_options(){
el = document.getElementById("torrent_add_options");
if (el.style.display == "block"){
el.style.display = "none";
}
else{
el.style.display = "block";
}
}
</script>
$:render.footer() $:render.footer()