direct sharing of files
This commit is contained in:
@@ -97,8 +97,11 @@ def list_view(name, password = None):
|
||||
"list.html",
|
||||
name = share['name'],
|
||||
entries = files,
|
||||
password = get_or_none(share,'pass_hash'),
|
||||
public = get_or_none(share,'public'),
|
||||
upload = get_or_none(share,'upload'),
|
||||
overwrite = get_or_none(share,'overwrite'),
|
||||
direct = get_or_none(share,'direct_links'),
|
||||
expire = get_or_none(share,'expire')
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% block body %}
|
||||
authenticate to {{ name|safe }}
|
||||
<form action={{ url_for('authenticate',name=name) }} method=post enctype=multipart/form-data>
|
||||
<p><input type=password name=password>
|
||||
<p><input type=password name=password autofocus>
|
||||
<input type=submit value=Login>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
@@ -6,9 +6,12 @@
|
||||
<div id=list_upload>
|
||||
<form action={{ url_for('upload') }} method=post enctype=multipart/form-data>
|
||||
<input type=hidden name=name value="{{ name|safe }}" />
|
||||
<input type=file name=file>
|
||||
<input type=submit value=Upload>
|
||||
<input type=file name=file onchange="document.getElementById('list_upload_button').disabled = false;">
|
||||
<input id="list_upload_button" type=submit value=Upload disabled>
|
||||
</form>
|
||||
{% if overwrite == false %}
|
||||
Overwriting disabled
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div id=list_upload>
|
||||
@@ -47,6 +50,9 @@
|
||||
{% for entry in entries %}
|
||||
<tr>
|
||||
<td><a href="{{ url_for('download_file', name = name, filename = entry.name) }}">{{ entry.name }}</a>
|
||||
{% if direct %}
|
||||
<a href="{{ url_for('download_file', name = name, password = password, filename = entry.name ) }}" title="Direct share link">❖</a>
|
||||
{% endif %}
|
||||
<td class=td_right>{{ entry.size|safe }}
|
||||
<td>{{ entry.mtime|safe }}
|
||||
</tr>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
upload to {{ name|safe }}
|
||||
<form action={{ url_for('upload') }} method=post enctype=multipart/form-data>
|
||||
<input type=hidden name=name value="{{ name|safe }}" />
|
||||
<p><input type=file name=file>
|
||||
<input type=submit value=Upload>
|
||||
<p><input type=file name=file onchange="function() { document.getElementById('upload_button').disabled = false; }">
|
||||
<input id="upload_button" type=submit value=Upload disabled>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user