From fd4bad4afe3ac3b7bcb321c7dc16ee38401527c5 Mon Sep 17 00:00:00 2001 From: mihasinkec Date: Sun, 21 Feb 2021 15:16:40 +0100 Subject: [PATCH] Fixed utf bugs in pdf generation, deleted unnecessary files, some other minor tweaks. --- Dockerfile | 4 ++-- app.py | 16 +++++++++++---- contract/out.pdf | Bin 28387 -> 0 bytes contract/pdf.py | 43 ----------------------------------------- contract/template.html | 2 ++ static/style.css | 2 +- templates/index.html | 4 ++-- 7 files changed, 19 insertions(+), 52 deletions(-) delete mode 100644 contract/out.pdf delete mode 100644 contract/pdf.py diff --git a/Dockerfile b/Dockerfile index af80288..005a134 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,9 +7,9 @@ COPY static /usr/src/portal-webapp/static COPY contract/ /usr/src/portal-webapp/contract WORKDIR /usr/src/portal-webapp -RUN apt-get update && apt-get -y install wkhtmltopdf python3-pdfkit && \ +RUN apt-get update && apt-get -y install wkhtmltopdf && \ rm -rf /var/lib/apt/lists/* -RUN pip3 install --no-cache-dir flask flask-dropzone gunicorn pdfkit +RUN pip3 install --no-cache-dir pdfkit flask flask-dropzone gunicorn pdfkit CMD ["gunicorn", "--bind", "0.0.0.0:80", "-w", "1", "--access-logfile", "-", "app:app"] diff --git a/app.py b/app.py index e60ff93..1b806b7 100644 --- a/app.py +++ b/app.py @@ -71,6 +71,10 @@ if 'BASE_DIR' in config: BASE_DIR = Path(config['BASE_DIR']) else: BASE_DIR = Path(__file__).resolve().parent +if 'URL_ROOT' in config: + URL_ROOT = config['URL_ROOT'] +else: + URL_ROOT = '/' # Override configs with environment variables, if set if 'PORTALDS4DS1_MAIL_HOST' in os.environ: @@ -87,6 +91,8 @@ if 'PORTALDS4DS1_MAX_UPLOAD_SIZE' in os.environ: MAX_UPLOAD_SIZE = int(os.environ['PORTALDS4DS1_MAX_UPLOAD_SIZE']) if 'PORTALDS4DS1_CONTRACT_CLIENT_CONTACT' in os.environ: CONTRACT_CLIENT_CONTACT = os.environ['PORTALDS4DS1_CONTRACT_CLIENT_CONTACT'] +if 'PORTALDS4DS1_URL_ROOT' in os.environ: + URL_ROOT = os.environ['PORTALDS4DS1_URL_ROOT'] UPLOAD_DIR = BASE_DIR / 'uploads' if not UPLOAD_DIR.exists: @@ -107,12 +113,12 @@ dropzone = Dropzone(app) contract_creator = ContractCreator() -@app.route('/') +@app.route(URL_ROOT) def index(): return render_template('index.html') -@app.route('/upload', methods=['POST']) +@app.route(URL_ROOT + '/upload', methods=['POST']) def handle_upload(): files = request.files if len(files) > 20: @@ -259,8 +265,10 @@ def store_metadata(upload_metadata): f.write('\nnaslov=' + form_data['naslov']) f.write('\nposta=' + form_data['posta']) f.write('\nemail=' + form_data['email']) - f.write('\ndatoteke=' + str(sorted_f_hashes)) - f.write('\npogodba=' + contract) + f.write('\ntelefon=' + form_data['telefon']) + f.write('\nupload_time=' + str(upload_metadata['timestamp'])) + f.write('\nupload_files=' + str(sorted_f_hashes)) + f.write('\ncontract_file=' + contract) def store_datafiles(files, upload_metadata): diff --git a/contract/out.pdf b/contract/out.pdf deleted file mode 100644 index 34c3b9ab5d03f1de9ab477caf8ee825b69dd7192..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28387 zcmc$`bzEFavo4IgC%6p|EcoE=?(XjH?(XhR(4fHr1a}F+U4kdLhG0RyA?)mTpYtBM z_xtD0FKhMm>ZZUTQ>ggs|5D}weqGv%M?Y)k=E z)Cdg1PNs$~_D%q*$0sm%Fl#UiFc&aeFdNX_9?SvE1k4N!0LBPL55@!r1l`#{912eM zCa%V&FD!~6LI4=+Z-VDL@Q+AKdpi+B7f>G}TtG%36X+is6OfgYm6?W-iIS0#k{W@J z55d&VWiM@^1{H9xmd_E}#w(7?cG8 zE>5n`Ut|G{^o&3R24h126Fnnntb#A4prkUu%+SX9H;tjQHGo0R-p=%2`mp{bUK`ZC zi;Jm~9e_c^)Xmb^R7qS&_m9$S|E9yUuFo1fncBJhr80xCy`2lF>I~rgJp=|NQ)hc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nn-0#;N5TJxj_I$l@c%o?bTfO(e@mHu z5u=~v2R`)vlN7=CSG4JB`}O>)+|~1+H0g#4T|NKBhJKNut8%}X(^c#$|7!cmp{`gH zJokznU2VT|e^IEPjOlOjzt?|N?^Qj2@6%QJUv>OeFPtv@%Drm$7lZoM=2cx+xxeC9 zkFR1^+wbHF_^(xG{vuDjT>np={xkA)C3~*O6X2TY+#shL$n*<9U7Ma8Jai+NK-XXg zbi<*pcYtfR1G?Vbc%~bk#B&Xccy7?qwJ*9sPB#|l#t_}us%z`S0lFqZ*B0nTK5_6| zw|*^=;42crDG`8!^M)YZV5J*db>psX2-0;P;07IC_xgr=0dMTlbw2?&9lSmi;7u(z z2JE__YjDNMa}Akph!yvB3&0z9b=~ZZ$+}Trzl_v%L%j!>zAhb1+K2e6!&$V-0;KvKZR4j80r5GPW^R>{SWQb&kOtScIxL3|KIEs{Oa(p z8LVz*Vd49yow_{!H}{giW&U)B*K1Z`vdfwq+f!j`VP4Pr`*ZqW_=x89)GlzyC1&dg z$Ev`e>uLS;lf;|V;8pkkjKOaKzsERvctG%* z=x^l!JOI8w%fUS&?>}N(d{@(V{gw+?e!Tze9|-hsa=GAF^WSs1;Yaspj28f(*5}W1 z9PnG+pD_UUzsco;1H0eb;00aLx!+@az<;*E%XM{v{a%h2#PM%(`To&AJ`nu2`Fk!W zh>Q2nzQEsI;Ggwz^6+u|*)BX6^k*CJa{qYWIN=)o&(|5ge%n9l1Au^hf4+Y3R~~*g z{@!N*H!ttsj>Eyu06tri-Ot77RLosX;O8@(;r&$KSHFhArM9xIEqwN*Ux?4%!NAVp U=cx~W3pwC(CDGAIC`e-d7wX}N`Tzg` diff --git a/contract/pdf.py b/contract/pdf.py deleted file mode 100644 index c8b55e8..0000000 --- a/contract/pdf.py +++ /dev/null @@ -1,43 +0,0 @@ -import pdfkit -from jinja2 import Environment, FileSystemLoader - - -class ContractCreator: - - def __init__(self): - template_loader = FileSystemLoader(searchpath="./") - template_env = Environment(loader=template_loader) - self.template = template_env.get_template('template.html') - - self.pdfkit_options = { - 'page-size': 'A4', - 'margin-top': '0.75in', - 'margin-right': '0.75in', - 'margin-bottom': '0.75in', - 'margin-left': '0.75in', - 'encoding': "UTF-8", - 'custom-header' : [ - ('Accept-Encoding', 'gzip') - ] - } - - def fill_template(self, **kwargs): - return self.template.render(**kwargs) - - def create_pdf(self, out_f, fields_dict): - html_str = self.fill_template(**fields_dict) - pdfkit.from_string(html_str, out_f, options=self.pdfkit_options) - - -if __name__ == '__main__': - test_data = { - 'ime_priimek': 'Testko Tester', - 'naslov': 'Testovci 10', - 'posta': '1123', - 'kontakt_narocnik': 'Testica Testkovič', - 'kontakt_imetnikpravic': 'Testko Tester', - 'date': '16.2.2021' - } - - contract_creator = ContractCreator() - contract_creator.create_pdf('out.pdf', test_data) diff --git a/contract/template.html b/contract/template.html index 1bf585e..fdd95b9 100644 --- a/contract/template.html +++ b/contract/template.html @@ -1,6 +1,8 @@ + +