summaryrefslogtreecommitdiffstats
path: root/module/web/templates
diff options
context:
space:
mode:
authorGravatar therazer <devnull@localhost> 2010-11-09 21:30:54 +0100
committerGravatar therazer <devnull@localhost> 2010-11-09 21:30:54 +0100
commitfa078c84b81f891aa800ca602fbc7d7ec3d02753 (patch)
tree8431575a6a27dab13700b538ccc4e94cba2e9c87 /module/web/templates
parentaccount reloadData fix (diff)
downloadpyload-fa078c84b81f891aa800ca602fbc7d7ec3d02753.tar.xz
added browser for files, too + little patches
Diffstat (limited to 'module/web/templates')
-rw-r--r--module/web/templates/default/pathchooser.html29
-rw-r--r--module/web/templates/default/settings.html9
2 files changed, 30 insertions, 8 deletions
diff --git a/module/web/templates/default/pathchooser.html b/module/web/templates/default/pathchooser.html
index 3c5329f09..100754cad 100644
--- a/module/web/templates/default/pathchooser.html
+++ b/module/web/templates/default/pathchooser.html
@@ -11,16 +11,29 @@
{
close();
}
+ function setInvalid() {
+ document.forms[0].send.disabled = 'disabled';
+ document.forms[0].p.style.color = '#FF0000';
+ }
+ function setValid() {
+ document.forms[0].send.disabled = '';
+ document.forms[0].p.style.color = '#000000';
+ }
+ function setFile(file)
+ {
+ document.forms[0].p.value = file;
+ setValid();
+
+ }
</script>
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/pathchooser.css"/>
</head>
-<body>
+<body{% ifequal type 'file' %}{% if not oldfile %} onload="setInvalid();"{% endif %}{% endifequal %}>
<center>
<form method="get" action="?" onSubmit="chosen();" onReset="exit();">
- <input type="text" name="p" value="{{ cwd }}" size="60">
- <input type="submit" value="Ok">
+ <input type="text" name="p" value="{{ oldfile|default:cwd }}" size="60" onfocus="setValid();">
+ <input type="submit" value="Ok" name="send">
</form>
-
<table border="0" cellspacing="0" cellpadding="3" width="90%">
<tr>
<th>Name</th>
@@ -30,12 +43,16 @@
</tr>
<tr>
<td colspan="4">
- <a href="{% url path parentdir %}"><span class="parentdir">parent directory</span></a>
+ <a href="{% ifequal type 'folder' %}{% url path parentdir %}{% else %}{% url file parentdir %}{% endifequal %}"><span class="parentdir">parent directory</span></a>
</td>
</tr>
{% for file in files %}
<tr>
- <td class="name">{% ifequal file.type 'dir' %}<a href="{% url path file.fullpath %}"><span class="directory">{{ file.name|truncate:25 }}</a></span>{% else %}<span class="file">{{ file.name|truncate:25 }}{% endifequal %}</span></td>
+ {% ifequal type 'folder' %}
+ <td class="name">{% ifequal file.type 'dir' %}<a href="{% url path file.fullpath %}" title="{{ file.fullpath }}"><span class="path_directory">{{ file.name|truncate:25 }}</span></a>{% else %}<span class="path_file">{{ file.name|truncate:25 }}{% endifequal %}</span></td>
+ {% else %}
+ <td class="name">{% ifequal file.type 'dir' %}<a href="{% url file file.fullpath %}" title="{{ file.fullpath }}"><span class="file_directory">{{ file.name|truncate:25 }}</span></a>{% else %}<a href="#" onclick="setFile('{{ file.fullpath }}');" title="{{ file.fullpath }}"><span class="file_file">{{ file.name|truncate:25 }}{% endifequal %}</span></a></td>
+ {% endifequal %}
<td class="size">{{ file.size|floatformat:-2 }} {{ file.unit }}</td>
<td class="type">{% ifequal file.type 'dir' %}directory{% else %}{{ file.ext }}{% endifequal %}</td>
<td class="mtime">{{ file.modified|date:"d.m.Y - H:i:s" }}</td>
diff --git a/module/web/templates/default/settings.html b/module/web/templates/default/settings.html
index ab1a445db..79ec62d19 100644
--- a/module/web/templates/default/settings.html
+++ b/module/web/templates/default/settings.html
@@ -116,9 +116,14 @@
{% else %}
{% ifequal option.type "folder" %}
<input name="{{configname}}|{{skey}}|{{okey}}" type="text" id="{{skey}}|{{okey}}" value="{{option.value}}"/>
- <input name="browsebutton" type="button" onClick="ifield = document.getElementById('{{skey}}|{{okey}}'); pathchooser = window.open('{% if option.value %}{% url path option.value %}{% else %}{% url root %}{% endif %}', 'pathchooser', 'scrollbars=yes,toolbar=no,menubar=no,statusbar=no,width=650,height=300'); pathchooser.ifield = ifield; window.ifield = ifield;" value="{% trans "Browse" %}"/>
+ <input name="browsebutton" type="button" onclick="ifield = document.getElementById('{{skey}}|{{okey}}'); pathchooser = window.open('{% if option.value %}{% url path option.value %}{% else %}{% url pathroot %}{% endif %}', 'pathchooser', 'scrollbars=yes,toolbar=no,menubar=no,statusbar=no,width=650,height=300'); pathchooser.ifield = ifield; window.ifield = ifield;" value="{% trans "Browse" %}"/>
{% else %}
- <input id="{{skey}}|{{okey}}" name="{{configname}}|{{skey}}|{{okey}}" type="text" value="{{option.value}}"/>
+ {% ifequal option.type "file" %}
+ <input name="{{configname}}|{{skey}}|{{okey}}" type="text" id="{{skey}}|{{okey}}" value="{{option.value}}"/>
+ <input name="browsebutton" type="button" onclick="ifield = document.getElementById('{{skey}}|{{okey}}'); filechooser = window.open('{% if option.value %}{% url file option.value %}{% else %}{% url fileroot %}{% endif %}', 'filechooser', 'scrollbars=yes,toolbar=no,menubar=no,statusbar=no,width=650,height=300'); filechooser.ifield = ifield; window.ifield = ifield;" value="{% trans "Browse" %}"/>
+ {% else %}
+ <input id="{{skey}}|{{okey}}" name="{{configname}}|{{skey}}|{{okey}}" type="text" value="{{option.value}}"/>
+ {% endifequal %}
{% endifequal %}
{% endif %}
{% endifequal %}