2022-12-31 13:18:27 +00:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
|
2023-01-03 18:03:30 +00:00
|
|
|
{% block title %}Sessions{% endblock title %}
|
2022-12-31 13:18:27 +00:00
|
|
|
|
|
|
|
{% block content %}
|
2023-01-03 18:03:30 +00:00
|
|
|
{% if purchase %}
|
|
|
|
<div class="text-center text-xl mb-4 dark:text-slate-400">
|
|
|
|
<h1>Listing sessions only for purchase "{{ purchase }}"</h1>
|
|
|
|
<a class="dark:text-white hover:underline" href="{% url 'list_sessions' %}">View all sessions</a>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2023-01-04 19:28:07 +00:00
|
|
|
<div class="grid grid-cols-5 gap-4 shadow rounded-xl max-w-screen-lg mx-auto dark:bg-slate-700 p-2 justify-center">
|
2022-12-31 13:18:27 +00:00
|
|
|
<div class="dark:border-white dark:text-slate-300 text-lg">Name</div>
|
|
|
|
<div class="dark:border-white dark:text-slate-300 text-lg">Start</div>
|
|
|
|
<div class="dark:border-white dark:text-slate-300 text-lg">End</div>
|
|
|
|
<div class="dark:border-white dark:text-slate-300 text-lg">Duration</div>
|
2023-01-04 19:28:07 +00:00
|
|
|
<div></div>
|
2022-12-31 13:18:27 +00:00
|
|
|
{% for data in dataset %}
|
2023-01-03 18:03:30 +00:00
|
|
|
<div class=""><a class="dark:text-white hover:underline" href="{% url 'list_sessions' data.purchase.id %}">{{ data.purchase }}</a></div>
|
2023-01-03 18:03:46 +00:00
|
|
|
<div class="dark:text-slate-400">{{ data.timestamp_start | date:"d/m/Y H:i" }}</div>
|
2023-01-04 16:27:54 +00:00
|
|
|
<div class="dark:text-slate-400">
|
|
|
|
{% if data.unfinished %}
|
2023-01-04 18:19:49 +00:00
|
|
|
Not finished yet. <a href="{% url 'update_session' data.id %}"><button class="bg-red-700 hover:bg-orange-700 border border-red-900 hover:border-dotted hover:border-white rounded p-1 text-white text-sm">Finish now?</button></a>
|
2023-01-04 16:27:54 +00:00
|
|
|
{% elif data.duration_manual %}
|
|
|
|
MANUAL
|
|
|
|
{% else %}
|
|
|
|
{{ data.timestamp_end | date:"d/m/Y H:i" }}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div class="dark:text-slate-400">{{ data.duration_formatted }}{% if data.duration_manual %} (M){% endif %}</div>
|
2023-01-04 19:28:07 +00:00
|
|
|
<div>
|
|
|
|
<a href="{% url 'delete_session' data.id %}"><button>❌</button></a>
|
|
|
|
</div>
|
2022-12-31 13:18:27 +00:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endblock content %}
|