31 lines
975 B
Django/Jinja
31 lines
975 B
Django/Jinja
<div hx-get="/measurements?htmx" hx-trigger="every 2s" hx-target="main"></div>
|
|
|
|
<h1>Measurements</h1>
|
|
<p>Page {{page}}</p>
|
|
|
|
{% for row in list %}
|
|
<article class="card">
|
|
<div class="contents">
|
|
<header>@ {{row['timestamp']|format_datetime}}</header>
|
|
CO2: {{row['co2']}}
|
|
TVOC: {{row['tvoc']}}
|
|
</div>
|
|
</article>
|
|
{% else %}
|
|
<article class="card">
|
|
<div class="contents">
|
|
<header>No measurements yet.</header>
|
|
</div>
|
|
</article>
|
|
{% endfor %}
|
|
|
|
<div>
|
|
{% if page > 1 %}
|
|
<a href="/measurements?page={{page-1}}" hx-get="/measurements?page={{page-1}}&htmx" hx-target="main" class="btn btn-link">Previous page</a>
|
|
{% endif %}
|
|
{% if has_next_page %}
|
|
<a href="/measurements?page={{page+1}}" hx-get="/measurements?page={{page+1}}&htmx" hx-target="main" class="btn btn-link">Next page</a>
|
|
{% endif %}
|
|
|
|
<a href="/" class="btn btn-link">View statistics</a>
|
|
</div>
|