From e779a764b452556f6657cfeab6ac911523b53c24 Mon Sep 17 00:00:00 2001 From: crunk Date: Wed, 29 Nov 2023 23:40:12 +0100 Subject: [PATCH] added option to download pdf --- library/application/csvparser.py | 2 ++ library/data/files/files_here | 0 library/page.py | 5 +++-- library/templates/publication.html | 4 ++++ 4 files changed, 9 insertions(+), 2 deletions(-) delete mode 100644 library/data/files/files_here diff --git a/library/application/csvparser.py b/library/application/csvparser.py index dc3bdd0..17db434 100644 --- a/library/application/csvparser.py +++ b/library/application/csvparser.py @@ -17,6 +17,7 @@ FIELDNAMES = [ "LicenseShort", "Highlights", "Comments", + "Files", ] @@ -53,6 +54,7 @@ class CsvParser: "License": license, "Highlights": row["Highlights"], "Comments": row["Comments"], + "Files": row["Files"], "Image": self._hasimage(row["Id"]), } return pubinfo diff --git a/library/data/files/files_here b/library/data/files/files_here deleted file mode 100644 index e69de29..0000000 diff --git a/library/page.py b/library/page.py index 32b0b43..2d388eb 100644 --- a/library/page.py +++ b/library/page.py @@ -6,8 +6,7 @@ import json import os import bcrypt -import flask -from flask import redirect, render_template, request +from flask import redirect, render_template, request, Blueprint from flask_wtf.csrf import CSRFProtect from icalendar import Calendar from PIL import Image @@ -23,6 +22,8 @@ from search import search APP = create_app() csrf = CSRFProtect() csrf.init_app(APP) +files = Blueprint("files", __name__, static_folder="files") +APP.register_blueprint(files) csvparser = CsvParser( APP.config["LIBRARY_FILENAME"], APP.config["IMAGE_FOLDER"] ) diff --git a/library/templates/publication.html b/library/templates/publication.html index e5ae9c1..4135c0e 100644 --- a/library/templates/publication.html +++ b/library/templates/publication.html @@ -53,6 +53,10 @@ Comments

{{ fullpublication["Comments"] }}

+ + File +

{{ fullpublication["Files"] }}

+