1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- [1mdiff --git a/flask_app/app/main/routes.py b/flask_app/app/main/routes.py[m
- [1mindex c36c90c..9e38594 100644[m
- [1m--- a/flask_app/app/main/routes.py[m
- [1m+++ b/flask_app/app/main/routes.py[m
- [36m@@ -311,7 +311,10 @@[m [mdef download_upload(i_upload:int = 0, bl_download:bool = True):[m
- o_out = io.BytesIO(o_upload.b_file)[m
- s_mimetype = o_upload.v_mime_type[m
- s_filename = o_upload.v_filename[m
- [31m- resp = send_file(o_out, mimetype=s_mimetype, as_attachment=bl_download, download_name=s_filename)[m
- [32m+[m[32m # resp = send_file(o_out, mimetype=s_mimetype, as_attachment=bl_download, download_name=s_filename)[m
- [32m+[m[32m resp = make_response(o_out)[m
- [32m+[m[32m resp.headers.set("Content-Disposition", f"attachment; filename=\"{s_filename}\"" if bl_download else "inline")[m
- [32m+[m[32m resp.headers.set("Content-Type", s_mimetype)[m
- return resp[m
- else:[m
- return make_response("No upload retrieved", 500)[m
- [36m@@ -776,6 +779,14 @@[m [mdef user_details(i_user_id:int = 0):[m
- # end of user_details view function for route /user_details/<int:i_user_id>/[m
- [m
- [m
- [32m+[m[32m@bp.route("/css_sample", methods=["GET"])[m
- [32m+[m[32mdef css_sample():[m
- [32m+[m[32m """CSS sample page - purely testing"""[m
- [32m+[m[32m s_base = "base_bs.html" if Config.BOOTSTRAP else "base.html"[m
- [32m+[m[32m s_url = url_for("main.index")#, _external=True)[m
- [32m+[m[32m return render_template("css_sample.html", js=True, base=s_base, url=s_url)[m
- [32m+[m[32m# end of css_sample view function for route /css_sample[m
- [32m+[m
- [m
- s_todo = """[m
- double-check both try-except across the board, along with then logging exceptions[m
- [1mdiff --git a/flask_app/app/templates/index.html b/flask_app/app/templates/index.html[m
- [1mindex 211713f..68aa33e 100644[m
- [1m--- a/flask_app/app/templates/index.html[m
- [1m+++ b/flask_app/app/templates/index.html[m
- [36m@@ -296,8 +296,9 @@[m [mtry {[m
- $.each(o_data.uploads, function(ix, u) {[m
- s_html = s_html + "<li><ul>";[m
- s_html = s_html + "<li><span class=\"label\">Document Type:</span> " + String(u.si_upload_type) + "</li>\n";[m
- [31m- s_url = "{{ url_for("main.download_upload", i_upload=99999, bl_download=True) }}".replace("99999", String(u["id"]));[m
- [31m- s_html = s_html + "<li><span class=\"label\">File Name:</span> <a href=\"" + s_url + "\" target=\"_blank\">" + String(u["v_filename"]) + "</a></li>\n";[m
- [32m+[m[32m s_url_download = "{{ url_for("main.download_upload", i_upload=99999, bl_download=True) }}".replace("99999", String(u["id"]));[m
- [32m+[m[32m s_url_view = "{{ url_for("main.download_upload", i_upload=99999, bl_download=False) }}".replace("99999", String(u["id"]));[m
- [32m+[m[32m s_html = s_html + "<li><span class=\"label\">File Name:</span> <a href=\"" + s_url_download + "\" target=\"_blank\"> download - " + String(u["v_filename"]) + "</a> <a href=\"" + s_url_view + "\" target=\"_blank\"> view - " + String(u["v_filename"]) + "</a></li>\n";[m
- s_html = s_html + "<li><span class=\"label\">Description:</span> " + String(u["v_description"]) + "</li>\n";[m
- if (String(u["v_qualification_name"])!="null") { s_html = s_html + "<li><span class=\"label\">Matching Qualification:</span> " + String(u["v_qualification_name"]) + "</li>\n"; }[m
- s_html = s_html + "</ul></li>\n";[m
|