fixxed template error
This commit is contained in:
parent
463408f12b
commit
6adf6ab955
@ -21,6 +21,13 @@ def create_app():
|
|||||||
template_folder='../templates', # ← Root/templates statt app/templates
|
template_folder='../templates', # ← Root/templates statt app/templates
|
||||||
static_folder='../static') # ← Root/static
|
static_folder='../static') # ← Root/static
|
||||||
|
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
|
def timedelta_filter(td):
|
||||||
|
return str(td) # oder td.total_seconds() als Zahl
|
||||||
|
|
||||||
|
app.jinja_env.filters['timedelta'] = timedelta_filter
|
||||||
|
|
||||||
# Config laden
|
# Config laden
|
||||||
app.config.from_object('config.Config')
|
app.config.from_object('config.Config')
|
||||||
|
|
||||||
|
|||||||
@ -87,7 +87,18 @@
|
|||||||
crossorigin="anonymous"></script>
|
crossorigin="anonymous"></script>
|
||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<!-- Module laden – Reihenfolge wichtig! -->
|
{% if config %}
|
||||||
|
<script>
|
||||||
|
// Config + globale Sounds nur setzen, wenn vorhanden
|
||||||
|
window.mkConfig = {{ config | tojson | safe | timedelta }};
|
||||||
|
window.mkGlobalSounds = {{ global_sounds | tojson | safe }};
|
||||||
|
|
||||||
|
console.log("base.html → mkConfig gesetzt:", window.mkConfig);
|
||||||
|
console.log("base.html → mkGlobalSounds:", window.mkGlobalSounds);
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Alle Module laden (immer) -->
|
||||||
<script src="{{ url_for('static', filename='js/config.js') }}"></script>
|
<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-status.js') }}"></script>
|
||||||
<script src="{{ url_for('static', filename='js/ui-connect.js') }}"></script>
|
<script src="{{ url_for('static', filename='js/ui-connect.js') }}"></script>
|
||||||
@ -98,13 +109,8 @@
|
|||||||
<!-- Einstiegspunkt -->
|
<!-- Einstiegspunkt -->
|
||||||
<script src="{{ url_for('static', filename='js/app.js') }}"></script>
|
<script src="{{ url_for('static', filename='js/app.js') }}"></script>
|
||||||
|
|
||||||
<!-- Config setzen + Inits aufrufen -->
|
<!-- Initialisierung aufrufen -->
|
||||||
<script>
|
<script>
|
||||||
// Config global setzen (nur auf Seiten mit config)
|
|
||||||
window.mkConfig = {{ config | tojson | safe }};
|
|
||||||
window.mkGlobalSounds = {{ global_sounds | tojson | safe }};
|
|
||||||
|
|
||||||
// Alle Inits aufrufen
|
|
||||||
initConfig();
|
initConfig();
|
||||||
initStatus();
|
initStatus();
|
||||||
initConnect();
|
initConnect();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user