Merge branch 'master' of https://scodoc.org/git/viennet/ScoDoc into table

This commit is contained in:
Emmanuel Viennet 2023-04-14 16:36:02 +02:00
commit b0afd900d1
4 changed files with 13 additions and 4 deletions

View File

@ -64,7 +64,9 @@ from app.scodoc import sco_xml
import sco_version import sco_version
# le répertoire static, lié à chaque release pour éviter les problèmes de caches # 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 # ----- CALCUL ET PRESENTATION DES NOTES
NOTES_PRECISION = 1e-4 # evite eventuelles erreurs d'arrondis NOTES_PRECISION = 1e-4 # evite eventuelles erreurs d'arrondis

View File

@ -3,8 +3,8 @@
{% block styles %} {% block styles %}
{{super()}} {{super()}}
<link rel="stylesheet" href="/ScoDoc/static/css/scodoc.css"> <link rel="stylesheet" href="{{ scu.STATIC_DIR }}/css/scodoc.css">
<link rel="stylesheet" href="/ScoDoc/static/css/entreprises.css"> <link rel="stylesheet" href="{{ scu.STATIC_DIR }}/css/entreprises.css">
{% endblock %} {% endblock %}
{% block title %} {% block title %}

View File

@ -46,6 +46,7 @@ from app.scodoc import sco_dump_db
from app.scodoc.sco_logos import make_logo_local from app.scodoc.sco_logos import make_logo_local
from app.scodoc.sco_permissions import Permission from app.scodoc.sco_permissions import Permission
from app.views import notes, scolar from app.views import notes, scolar
import app.scodoc.sco_utils as scu
import tools import tools
from tools.fakedatabase import create_test_api_database from tools.fakedatabase import create_test_api_database
@ -55,6 +56,12 @@ app = create_app(RunningConfig)
cli.register(app) 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 @app.shell_context_processor
def make_shell_context(): def make_shell_context():
import numpy as np import numpy as np

View File

@ -42,7 +42,7 @@ then
DB_DEST="SCODOC" DB_DEST="SCODOC"
else else
echo "restauration des données dans la configuration actuelle" echo "restauration des données dans la configuration actuelle"
DB_CURRENT=$(su -c "(cd $SCODOC_DIR && source venv/bin/activate && flask scodoc-database -n)") DB_CURRENT=$(su -c "(cd $SCODOC_DIR && source venv/bin/activate && flask scodoc-database -n)" "$SCODOC_USER")
DB_DEST="$DB_CURRENT" DB_DEST="$DB_CURRENT"
KEEP_ENV="Y" KEEP_ENV="Y"
if [ "$1" = "--keep-env" ] if [ "$1" = "--keep-env" ]