- forcing browser to refresh images via timestamp
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
<div class="center">
|
<div class="center">
|
||||||
<h2>{{product.name}}</h2>
|
<h2>{{product.name}}</h2>
|
||||||
{% set fils = "product_%s.png" % product.name %}
|
{% set fils = "product_%s.png" % product.name %}
|
||||||
<img src="{{ url_for('static', filename=fils) }}" /><br>
|
<img src="{{ url_for('static', filename=fils) }}?{{timestamp}}" /><br>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
{{"%0.2f" % product.price}} €
|
{{"%0.2f" % product.price}} €
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<div class="fridge_sensor">
|
<div class="fridge_sensor">
|
||||||
{{ sensor.name }}<br>
|
{{ sensor.name }}<br>
|
||||||
{% set fils = "log_%s.png" % sensor.id %}
|
{% set fils = "log_%s.png" % sensor.id %}
|
||||||
<img src="{{ url_for('static', filename=fils) }}" /><br>
|
<img src="{{ url_for('static', filename=fils) }}?{{timestamp}}" /><br>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{% set title = "Bierliste" %}
|
{% set title = "Bierliste" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1> Bierliste </h1>
|
<h1> Bierliste </h1>
|
||||||
<img src="{{ url_for('static', filename='bierliste_small.png') }}" style="width:100%;max-width:990px;">
|
<img src="{{ url_for('static', filename='bierliste_small.png') }}?{{timestamp}}" style="width:100%;max-width:990px;">
|
||||||
<!-- <table>
|
<!-- <table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
<h1> Statistik </h1>
|
<h1> Statistik </h1>
|
||||||
<div>
|
<div>
|
||||||
<h2> Bierkonsum </h2>
|
<h2> Bierkonsum </h2>
|
||||||
<img src="{{ url_for('static', filename='total.png') }}">
|
<img src="{{ url_for('static', filename='total.png') }}?{{timestamp}}">
|
||||||
{% if user %}
|
{% if user %}
|
||||||
{% set fils = "total%03d.png" % user.id %}
|
{% set fils = "total%03d.png" % user.id %}
|
||||||
<img src="{{ url_for('static', filename=fils) }}">
|
<img src="{{ url_for('static', filename=fils) }}?{{timestamp}}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<h1> Abrechnung </h1>
|
<h1> Abrechnung </h1>
|
||||||
|
|||||||
@@ -13,7 +13,12 @@ from consumption import Consumption
|
|||||||
import bcrypt
|
import bcrypt
|
||||||
import os
|
import os
|
||||||
from settings import *
|
from settings import *
|
||||||
|
import time
|
||||||
|
|
||||||
|
# makes the variable timehex available in all templates
|
||||||
|
@app.context_processor
|
||||||
|
def inject_time():
|
||||||
|
return dict(timestamp=time.time().__int__())
|
||||||
|
|
||||||
@app.route('/static/<path:path>')
|
@app.route('/static/<path:path>')
|
||||||
def static_proxy(path):
|
def static_proxy(path):
|
||||||
|
|||||||
Reference in New Issue
Block a user