forked from openlp/openlp
Merge branch 'web_remote_fixes' into 'master'
Change server send correct files for new web-remote Closes #516 See merge request openlp/openlp!184
This commit is contained in:
commit
1f9884e64a
@ -19,17 +19,23 @@
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
|
||||
##########################################################################
|
||||
|
||||
import os
|
||||
|
||||
from flask import Blueprint, send_from_directory
|
||||
from openlp.core.common.applocation import AppLocation
|
||||
|
||||
main_views = Blueprint('main', __name__)
|
||||
|
||||
|
||||
@main_views.route('/')
|
||||
def index():
|
||||
return send_from_directory(str(AppLocation.get_section_data_path('remotes')), 'index.html')
|
||||
|
||||
|
||||
@main_views.route('/', defaults={'path': ''})
|
||||
@main_views.route('/<path>')
|
||||
def index(path):
|
||||
if os.path.isfile(AppLocation.get_section_data_path('remotes') / path):
|
||||
return send_from_directory(str(AppLocation.get_section_data_path('remotes')), path)
|
||||
else:
|
||||
return send_from_directory(str(AppLocation.get_section_data_path('remotes')), 'index.html')
|
||||
|
||||
|
||||
@main_views.route('/assets/<path>')
|
||||
def assets(path):
|
||||
return send_from_directory(str(AppLocation.get_section_data_path('remotes')), path)
|
||||
return send_from_directory(str(AppLocation.get_section_data_path('remotes') / 'assets'), path)
|
||||
|
Loading…
Reference in New Issue
Block a user