From 1f4489b3aa58369357e7eac52d5e0758e82aff25 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Mon, 26 Feb 2024 23:34:48 +0100 Subject: [PATCH] Show place number on race result --- formula10/__init__.py | 4 +--- formula10/static/script/draggable.js | 8 +++++--- formula10/templates/enter.jinja | 10 ++++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/formula10/__init__.py b/formula10/__init__.py index c15fae8..ef8e26a 100644 --- a/formula10/__init__.py +++ b/formula10/__init__.py @@ -25,13 +25,11 @@ import formula10.controller.error_controller # TODO # General -# - Show place when entering race result (would require updating the drag'n'drop code...) # - Don't write full 2024 date, just 24 or leave out completely, to make column smaller # Statistics -# - Rename "Statistics" to "Leaderboard" # - Auto calculate points -# - Order user table by points + display points somewhere +# - Display points somewhere in race table? # - Highlight currently correct values for some season guesses (e.g. current most dnfs) # - Generate static diagram using chart.js + templating the js (funny yikes) diff --git a/formula10/static/script/draggable.js b/formula10/static/script/draggable.js index 42bc1a2..c15db60 100644 --- a/formula10/static/script/draggable.js +++ b/formula10/static/script/draggable.js @@ -41,13 +41,15 @@ function handleDrop(e) { // Don't do anything if dropping the same column we're dragging. if (dragSrcEl != this) { // Set the source column's HTML to the HTML of the column we dropped on. - //alert(this.outerHTML); - //dragSrcEl.innerHTML = this.innerHTML; - //this.innerHTML = e.dataTransfer.getData('text/html'); + // alert(this.outerHTML); + // dragSrcEl.innerHTML = this.innerHTML; + // this.innerHTML = e.dataTransfer.getData('text/html'); + this.parentNode.removeChild(dragSrcEl); let dropHTML = e.dataTransfer.getData('text/html'); this.insertAdjacentHTML('beforebegin', dropHTML); let dropElem = this.previousSibling; + addDnDHandlers(dropElem); } diff --git a/formula10/templates/enter.jinja b/formula10/templates/enter.jinja index d1be182..93d8bf3 100644 --- a/formula10/templates/enter.jinja +++ b/formula10/templates/enter.jinja @@ -52,13 +52,19 @@
-