- forcing browser to refresh images via timestamp
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<div class="center">
|
||||
<h2>{{product.name}}</h2>
|
||||
{% 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 class="right">
|
||||
{{"%0.2f" % product.price}} €
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="fridge_sensor">
|
||||
{{ sensor.name }}<br>
|
||||
{% 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>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% set title = "Bierliste" %}
|
||||
{% block content %}
|
||||
<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>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
<h1> Statistik </h1>
|
||||
<div>
|
||||
<h2> Bierkonsum </h2>
|
||||
<img src="{{ url_for('static', filename='total.png') }}">
|
||||
<img src="{{ url_for('static', filename='total.png') }}?{{timestamp}}">
|
||||
{% if user %}
|
||||
{% set fils = "total%03d.png" % user.id %}
|
||||
<img src="{{ url_for('static', filename=fils) }}">
|
||||
<img src="{{ url_for('static', filename=fils) }}?{{timestamp}}">
|
||||
{% endif %}
|
||||
</div>
|
||||
<h1> Abrechnung </h1>
|
||||
|
||||
@@ -13,7 +13,12 @@ from consumption import Consumption
|
||||
import bcrypt
|
||||
import os
|
||||
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>')
|
||||
def static_proxy(path):
|
||||
|
||||
Reference in New Issue
Block a user