Create editor files
This commit is contained in:
parent
69a0791a6d
commit
7fe1afb348
0
ref-test/app/editor/__init__.py
Normal file
0
ref-test/app/editor/__init__.py
Normal file
0
ref-test/app/editor/static/editor.js
Normal file
0
ref-test/app/editor/static/editor.js
Normal file
0
ref-test/app/editor/static/js/editor.js
Normal file
0
ref-test/app/editor/static/js/editor.js
Normal file
0
ref-test/app/editor/templates/editor/index.html
Normal file
0
ref-test/app/editor/templates/editor/index.html
Normal file
12
ref-test/app/editor/views.py
Normal file
12
ref-test/app/editor/views.py
Normal file
@ -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')
|
@ -1 +1 @@
|
|||||||
from app.config import ProductionConfig as Config
|
from app.config import DevelopmentConfig as Config
|
@ -36,7 +36,7 @@ def create_app():
|
|||||||
def _check_cookie_consent():
|
def _check_cookie_consent():
|
||||||
if request.cookies.get('cookie_consent'):
|
if request.cookies.get('cookie_consent'):
|
||||||
return
|
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
|
return
|
||||||
flash(f'<strong>Cookie Consent</strong>: 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 <a href="{url_for("views._privacy")}">privacy policy</a>.', 'cookie_alert')
|
flash(f'<strong>Cookie Consent</strong>: 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 <a href="{url_for("views._privacy")}">privacy policy</a>.', 'cookie_alert')
|
||||||
|
|
||||||
@ -51,11 +51,13 @@ def create_app():
|
|||||||
from app.api.views import api
|
from app.api.views import api
|
||||||
from app.quiz.views import quiz
|
from app.quiz.views import quiz
|
||||||
from app.views import views
|
from app.views import views
|
||||||
|
from app.editor.views import editor
|
||||||
|
|
||||||
app.register_blueprint(admin, url_prefix='/admin')
|
app.register_blueprint(admin, url_prefix='/admin')
|
||||||
app.register_blueprint(api, url_prefix='/api')
|
app.register_blueprint(api, url_prefix='/api')
|
||||||
app.register_blueprint(views)
|
app.register_blueprint(views)
|
||||||
app.register_blueprint(quiz)
|
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}'): mkdir(f'./{data}')
|
||||||
if not path.isdir(f'./{data}/questions'): mkdir(f'./{data}/questions')
|
if not path.isdir(f'./{data}/questions'): mkdir(f'./{data}/questions')
|
||||||
|
Loading…
Reference in New Issue
Block a user