direct sharing of files

This commit is contained in:
2018-01-25 14:00:30 +02:00
parent 94860d5195
commit f6696d8e28
5 changed files with 21 additions and 5 deletions

View File

@@ -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')
)

View File

@@ -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 %}

View File

@@ -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 %}
&nbsp;<a href="{{ url_for('download_file', name = name, password = password, filename = entry.name ) }}" title="Direct share link">&#x2756;</a>
{% endif %}
<td class=td_right>{{ entry.size|safe }}
<td>{{ entry.mtime|safe }}
</tr>

View File

@@ -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 %}