diff --git a/ref-test/app/editor/__init__.py b/ref-test/app/editor/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ref-test/app/editor/static/editor.js b/ref-test/app/editor/static/editor.js new file mode 100644 index 0000000..e69de29 diff --git a/ref-test/app/editor/static/js/editor.js b/ref-test/app/editor/static/js/editor.js new file mode 100644 index 0000000..e69de29 diff --git a/ref-test/app/editor/templates/editor/index.html b/ref-test/app/editor/templates/editor/index.html new file mode 100644 index 0000000..e69de29 diff --git a/ref-test/app/editor/views.py b/ref-test/app/editor/views.py new file mode 100644 index 0000000..fd729c4 --- /dev/null +++ b/ref-test/app/editor/views.py @@ -0,0 +1,12 @@ +from flask import Blueprint, render_template + +editor = Blueprint( + name='editor', + import_name=__name__, + template_folder='templates', + static_folder='static' +) + +@editor.route('/') +def _editor(): + return render_template('/editor/index.html') \ No newline at end of file diff --git a/ref-test/config.py b/ref-test/config.py index beea69e..38a499a 100644 --- a/ref-test/config.py +++ b/ref-test/config.py @@ -1 +1 @@ -from app.config import ProductionConfig as Config \ No newline at end of file +from app.config import DevelopmentConfig as Config \ No newline at end of file diff --git a/ref-test/main.py b/ref-test/main.py index aa270a9..e97c9e1 100644 --- a/ref-test/main.py +++ b/ref-test/main.py @@ -36,7 +36,7 @@ def create_app(): def _check_cookie_consent(): if request.cookies.get('cookie_consent'): return - if any([ request.path.startswith(x) for x in [ '/admin/static/', '/static/', '/cookies/' ] ]): + if any([ request.path.startswith(x) for x in [ '/admin/static/', '/root/', '/quiz/static', '/admin/editor/static/', '/cookies/' ] ]): return flash(f'Cookie Consent: This web site only stores minimal, functional cookies. It does not store any tracking information. By using this site, you consent to this use of cookies. For more information, see our privacy policy.', 'cookie_alert') @@ -51,11 +51,13 @@ def create_app(): from app.api.views import api from app.quiz.views import quiz from app.views import views + from app.editor.views import editor app.register_blueprint(admin, url_prefix='/admin') app.register_blueprint(api, url_prefix='/api') app.register_blueprint(views) app.register_blueprint(quiz) + app.register_blueprint(editor, url_prefix='/admin/editor') if not path.isdir(f'./{data}'): mkdir(f'./{data}') if not path.isdir(f'./{data}/questions'): mkdir(f'./{data}/questions')