diff options
author | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-08-16 17:28:57 +0200 |
---|---|---|
committer | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-08-16 17:28:57 +0200 |
commit | 077b39a8bef9af1f09532f778fa445537f228bb0 (patch) | |
tree | 0420b096b03061e2238d5234b05e6b8c25638791 | |
parent | 170264047e2f313e8c1395bdc8b5a08bbe21b1bf (diff) | |
download | klausuren-077b39a8bef9af1f09532f778fa445537f228bb0.tar.gz klausuren-077b39a8bef9af1f09532f778fa445537f228bb0.tar.bz2 klausuren-077b39a8bef9af1f09532f778fa445537f228bb0.zip |
use real filename instead of sha hashes as name for file download
-rw-r--r-- | app.py | 4 | ||||
-rw-r--r-- | templates/module_show.html | 5 |
2 files changed, 5 insertions, 4 deletions
@@ -108,8 +108,8 @@ def upload(study, module = None): -@app.route('/<study>/files/<oid>') -def study_show(study, oid): +@app.route('/<study>/files/<oid>/<filename>') +def study_show(study, oid, filename): data = fit[study].get_file(oid) mime = magic.Magic(mime=True) header = { 'Content-Type' : mime.from_buffer(data[:1024]) } diff --git a/templates/module_show.html b/templates/module_show.html index 989d946..cbaec74 100644 --- a/templates/module_show.html +++ b/templates/module_show.html @@ -6,8 +6,9 @@ <ul> {% for name,oid in files %} <li> - <a href="{{url_for('study_show', study = study, - oid=oid)}}">{{name|truncate(40,True)}}</a> + <a href="{{url_for('study_show', study = study, oid=oid, filename=name)}}"> + {{name|truncate(40,True)}} + </a> </li> {% endfor %} </ul> |