From f69887cd8cf165295b2ee21f514b9c8482625c34 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 25 Jul 2020 21:41:28 +1200 Subject: [PATCH] Re-add custom stage view support Almost a static server. Lets say your stage files are in `stages/mystage/`, Provided your main html file is named `stage.html`, you can get to it with: `:/stage/mystage` (this is the same as openlp 2.4.6) Although you can use the full url, the `stage.html` will be able to directly link to it's neighbour files with a relative url. (that means you can use `javascript.js` rather than `/stage/mystage/javascript.js`) Again, this should be the same as openlp 2.4.6 I think OpenLP 2.4.6 used some sort of template system to fill in the page title and perhaps a few other things. This does not use a template system and you only need a standard html file. --- openlp/core/api/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openlp/core/api/main.py b/openlp/core/api/main.py index 9d9a71a70..ba8f133e6 100644 --- a/openlp/core/api/main.py +++ b/openlp/core/api/main.py @@ -39,3 +39,13 @@ def index(path): @main_views.route('/assets/') def assets(path): return send_from_directory(str(AppLocation.get_section_data_path('remotes') / 'assets'), path) + + +@main_views.route('/stage//') +def stages(path): + return send_from_directory(str(AppLocation.get_section_data_path('stages') / path), 'stage.html') + + +@main_views.route('/stage//') +def stage_assets(path, file): + return send_from_directory(str(AppLocation.get_section_data_path('stages') / path), file)