From 44f49e597483a34b9a8792841254505987260949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Wed, 10 Jan 2024 15:53:15 +0100 Subject: [PATCH] Session list: speed up starting new sessions --- CHANGELOG.md | 2 +- games/templates/list_sessions.html | 3 +-- games/views.py | 25 ++++++++++--------------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4868406..86605b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## Improved * game overview: improve how editions and purchases are displayed * add purchase: only allow choosing purchases of selected edition -* session list: clicking the "End now?" link is not much faster +* session list: starting and ending sessions is much faster/doest not reload the page ## 1.5.1 / 2023-11-14 21:10+01:00 diff --git a/games/templates/list_sessions.html b/games/templates/list_sessions.html index 6e80ac1..8d3449e 100644 --- a/games/templates/list_sessions.html +++ b/games/templates/list_sessions.html @@ -11,7 +11,6 @@ hx-get="{% url 'start_session_same_as_last' last.id %}" hx-swap="afterbegin" hx-target=".responsive-table tbody" - hx-select=".responsive-table tbody tr:first-child" onClick="document.querySelector('#last-session-start').classList.add('invisible')" class="{% if last.timestamp_end == null %}invisible{% endif %}"> {% include 'components/button_start.html' with text=last.purchase title="Start session of last played game" only %} @@ -42,7 +41,7 @@ {{ session.timestamp_start | date:"d/m/Y H:i" }} - {% if session.unfinished %} + {% if not session.timestamp_end %}