css versioniert
This commit is contained in:
parent
d1c84d0ea9
commit
fa1eccb805
2 changed files with 18 additions and 2 deletions
18
app.py
18
app.py
|
|
@ -14,6 +14,7 @@ import shutil
|
|||
from shutil import copy2
|
||||
import logging
|
||||
import platform
|
||||
import os
|
||||
# --------------------------------------------------
|
||||
# Logging
|
||||
# --------------------------------------------------
|
||||
|
|
@ -407,9 +408,23 @@ def get_balance_comparison():
|
|||
result_data[names[idx]] = data
|
||||
|
||||
return result_data
|
||||
@app.context_processor
|
||||
def inject_css_version():
|
||||
|
||||
return {
|
||||
"css_version": int(
|
||||
os.path.getmtime(
|
||||
BASE_DIR / "static" / "style.css"
|
||||
)
|
||||
)
|
||||
}
|
||||
@app.route("/")
|
||||
def index():
|
||||
|
||||
css_version = int(
|
||||
os.path.getmtime(
|
||||
BASE_DIR / "static" / "style.css"
|
||||
)
|
||||
)
|
||||
(
|
||||
year,
|
||||
week,
|
||||
|
|
@ -446,6 +461,7 @@ def index():
|
|||
total_expenses=total_expenses,
|
||||
total_saldo=total_saldo,
|
||||
balance=balance,
|
||||
css_version=css_version,
|
||||
balance_color=balance_color,
|
||||
current_day=current_day,
|
||||
balance_history=balance_history
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
</title>
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="{{ url_for('static', filename='style.css') }}">
|
||||
href="{{ url_for('static', filename='style.css') }}?v={{ css_version }}">
|
||||
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue