From faa4c25ccc97742d0b43994e445a2315b0cc4a7e Mon Sep 17 00:00:00 2001 From: decentral1se Date: Sun, 2 Oct 2022 19:46:47 +0200 Subject: [PATCH] fix: use PAD_URL in template files --- octomode.py | 12 ++++++------ templates/base.html | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/octomode.py b/octomode.py index 73ec3a2..33171de 100755 --- a/octomode.py +++ b/octomode.py @@ -16,7 +16,7 @@ import markdown class Config(object): PORTNUMBER = int(os.environ.get('OCTOMODE_PORTNUMBER', 5001)) - PAD_URL = os.environ.get('OCTOMODE_PAD_URL', 'https://pad.vvvvvvaria.org' ) + PAD_URL = os.environ.get('OCTOMODE_PAD_URL', 'https://pad.vvvvvvaria.org') PAD_API_URL = os.environ.get('OCTOMODE_PAD_API_URL', 'https://pad.vvvvvvaria.org/api/1.2.15') PAD_API_KEY = os.environ.get('OCTOMODE_PAD_API_KEY', '') @@ -121,7 +121,7 @@ def index(): create_pad_on_first_run(name, ext) return redirect(f"/{ name }/pad") else: - return render_template('start.html') + return render_template('start.html', pad_url=APP.config['PAD_URL']) @APP.route('/') def main(name): @@ -130,22 +130,22 @@ def main(name): @APP.route('//pad') def pad(name): url = f"{ APP.config['PAD_URL'] }/{ name }.md" - return render_template('iframe.html', url=url, name=name.strip()) + return render_template('iframe.html', url=url, name=name.strip(), pad_url=APP.config['PAD_URL']) @APP.route('//stylesheet') def stylesheet(name): url = f"{ APP.config['PAD_URL'] }/{ name }.css" - return render_template('iframe.html', url=url, name=name.strip()) + return render_template('iframe.html', url=url, name=name.strip(), pad_url=APP.config['PAD_URL']) @APP.route('//html') def html(name): url = f"/{ name }/preview.html" - return render_template('iframe.html', url=url, name=name.strip()) + return render_template('iframe.html', url=url, name=name.strip(), pad_url=APP.config['PAD_URL']) @APP.route('//pdf') def pdf(name): url = f"/{name}/pagedjs.html" - return render_template('pdf.html', url=url, name=name.strip()) + return render_template('pdf.html', url=url, name=name.strip(), pad_url=APP.config['PAD_URL']) # ////////////////// # RENDERED RESOURCES diff --git a/templates/base.html b/templates/base.html index d1a287b..f888a23 100644 --- a/templates/base.html +++ b/templates/base.html @@ -25,10 +25,10 @@ window.addEventListener('load', function () {
: - + : - +