make app_version available in templates

This commit is contained in:
Yusur 2025-06-14 16:20:00 +02:00
parent 690ad71328
commit da64073ada
2 changed files with 2 additions and 3 deletions

View file

@ -63,6 +63,7 @@ PRIVATE_ASSETS = os.getenv('PRIVATE_ASSETS', '').split()
def _inject_variables(): def _inject_variables():
return { return {
'app_name': os.getenv('APP_NAME'), 'app_name': os.getenv('APP_NAME'),
'app_version': __version__,
'domain_name': os.getenv('DOMAIN_NAME'), 'domain_name': os.getenv('DOMAIN_NAME'),
'url_for_css': (lambda name, **kwargs: url_for('static', filename=f'css/{name}.css', **kwargs)), 'url_for_css': (lambda name, **kwargs: url_for('static', filename=f'css/{name}.css', **kwargs)),
'private_scripts': [x for x in PRIVATE_ASSETS if x.endswith('.js')], 'private_scripts': [x for x in PRIVATE_ASSETS if x.endswith('.js')],

View file

@ -2,7 +2,6 @@
import sys import sys
from flask import Blueprint, render_template, __version__ as flask_version from flask import Blueprint, render_template, __version__ as flask_version
from sqlalchemy import __version__ as sa_version from sqlalchemy import __version__ as sa_version
from .. import __version__ as app_version
bp = Blueprint('about', __name__) bp = Blueprint('about', __name__)
@ -11,8 +10,7 @@ def about():
return render_template('about.html', return render_template('about.html',
flask_version=flask_version, flask_version=flask_version,
sa_version=sa_version, sa_version=sa_version,
python_version=sys.version.split()[0], python_version=sys.version.split()[0]
app_version=app_version
) )
@bp.route('/terms/') @bp.route('/terms/')