diff options
-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> |