forked from ScoDoc/ScoDoc
Make symbol scu (sco_utils) available to all templates.
This commit is contained in:
parent
c29187561a
commit
fac3337237
@ -63,7 +63,9 @@ from app.scodoc import sco_xml
|
||||
import sco_version
|
||||
|
||||
# le répertoire static, lié à chaque release pour éviter les problèmes de caches
|
||||
STATIC_DIR = "/ScoDoc/static/links/" + sco_version.SCOVERSION
|
||||
STATIC_DIR = (
|
||||
os.environ.get("SCRIPT_NAME", "") + "/ScoDoc/static/links/" + sco_version.SCOVERSION
|
||||
)
|
||||
|
||||
# ----- CALCUL ET PRESENTATION DES NOTES
|
||||
NOTES_PRECISION = 1e-4 # evite eventuelles erreurs d'arrondis
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
{% block styles %}
|
||||
{{super()}}
|
||||
<link rel="stylesheet" href="{{ url_for('scodoc.index') }}/ScoDoc/static/css/scodoc.css">
|
||||
<link rel="stylesheet" href="{{ url_for('scodoc.index') }}/ScoDoc/static/css/entreprises.css">
|
||||
<link rel="stylesheet" href="{{ scu.STATIC_DIR }}/ScoDoc/static/css/scodoc.css">
|
||||
<link rel="stylesheet" href="{{ scu.STATIC_DIR }}/ScoDoc/static/css/entreprises.css">
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}
|
||||
|
@ -46,6 +46,7 @@ from app.scodoc import sco_dump_db
|
||||
from app.scodoc.sco_logos import make_logo_local
|
||||
from app.scodoc.sco_permissions import Permission
|
||||
from app.views import notes, scolar
|
||||
import app.scodoc.sco_utils as scu
|
||||
import tools
|
||||
from tools.fakedatabase import create_test_api_database
|
||||
|
||||
@ -55,6 +56,12 @@ app = create_app(RunningConfig)
|
||||
cli.register(app)
|
||||
|
||||
|
||||
@app.context_processor
|
||||
def inject_sco_utils():
|
||||
"Make scu available in all Jinja templates"
|
||||
return dict(scu=scu)
|
||||
|
||||
|
||||
@app.shell_context_processor
|
||||
def make_shell_context():
|
||||
import numpy as np
|
||||
|
Loading…
Reference in New Issue
Block a user