Hide button if no last session

This commit is contained in:
2023-01-15 13:02:02 +01:00
parent 64f5668dde
commit 163211ab0b
3 changed files with 5 additions and 1 deletions

View File

@ -4,11 +4,13 @@
{% block content %}
<div class="text-center text-xl mb-4 dark:text-slate-400">
{% if dataset.count > 0 %}
<a href="{% url 'start_session' dataset.last.purchase.id %}">
<button type="button" title="Track last tracked" class="py-1 px-2 bg-green-600 hover:bg-green-700 focus:ring-green-500 focus:ring-offset-blue-200 text-white transition ease-in duration-200 text-center text-base font-semibold shadow-md focus:outline-none focus:ring-2 focus:ring-offset-2 rounded-lg ">
New session of {{ dataset.last.purchase }}
</button>
</a>
{% endif %}
{% if purchase %}
<h1>Listing sessions only for purchase "{{ purchase }}"</h1>
<h2>Total playtime: {{ total_duration }} over {{ dataset.count }} sessions.</h2>