Hide button if no last session

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

View File

@ -6,7 +6,7 @@ RUN npm install && \
FROM python:3.10.9-alpine
ENV VERSION_NUMBER 0.2.1
ENV VERSION_NUMBER 0.2.1-2-g734e6de
ENV PROD 1
RUN apk add \

View File

@ -11,6 +11,8 @@ python = "^3.10"
django = "^4.1.4"
gunicorn = "^20.1.0"
uvicorn = "^0.20.0"
pandas = "^1.5.2"
matplotlib = "^3.6.3"
[tool.poetry.group.dev.dependencies]
black = "^22.12.0"

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>