neuer fix

This commit is contained in:
oberon 2026-02-16 16:33:38 +01:00
parent 02150e0e62
commit 54ec3d6e2d
2 changed files with 8 additions and 13 deletions

View File

@ -21,15 +21,6 @@ def create_app():
template_folder='../templates', # ← Root/templates statt app/templates
static_folder='../static') # ← Root/static
from datetime import timedelta
def timedelta_filter(value):
if isinstance(value, timedelta):
return value.total_seconds() # oder str(value)
return value
app.jinja_env.filters['timedelta'] = timedelta_filter
# Config laden
app.config.from_object('config.Config')

View File

@ -87,18 +87,22 @@
crossorigin="anonymous"></script>
{% block scripts %}
{% if config %}
{% if config is defined and config is not none %}
<script>
// Config + globale Sounds nur setzen, wenn vorhanden
window.mkConfig = {{ config | tojson | safe }};
// Config + globale Sounds nur setzen, wenn config wirklich existiert
window.mkConfig = {{ config | tojson | safe }};
window.mkGlobalSounds = {{ global_sounds | tojson | safe }};
console.log("base.html → mkConfig gesetzt:", window.mkConfig);
console.log("base.html → mkGlobalSounds:", window.mkGlobalSounds);
</script>
{% else %}
<script>
console.log("base.html → Keine config auf dieser Seite mkConfig nicht gesetzt");
</script>
{% endif %}
<!-- Alle Module laden (immer) -->
<!-- Alle JS-Module laden (immer) -->
<script src="{{ url_for('static', filename='js/config.js') }}"></script>
<script src="{{ url_for('static', filename='js/ui-status.js') }}"></script>
<script src="{{ url_for('static', filename='js/ui-connect.js') }}"></script>