Re-add custom stage view support

Almost a static server. Lets say your stage files are in `stages/mystage/<files>`,
Provided your main html file is named `stage.html`, you can get to it with:
`<openlp_ip>:<openlp_port>/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.
This commit is contained in:
Daniel 2020-07-25 21:41:28 +12:00
parent a036362237
commit f69887cd8c

View File

@ -39,3 +39,13 @@ def index(path):
@main_views.route('/assets/<path>')
def assets(path):
return send_from_directory(str(AppLocation.get_section_data_path('remotes') / 'assets'), path)
@main_views.route('/stage/<path>/')
def stages(path):
return send_from_directory(str(AppLocation.get_section_data_path('stages') / path), 'stage.html')
@main_views.route('/stage/<path>/<file>')
def stage_assets(path, file):
return send_from_directory(str(AppLocation.get_section_data_path('stages') / path), file)