From f6aa54e51c8d80efb225c251f0a3bf6594772000 Mon Sep 17 00:00:00 2001 From: maximilianKalff Date: Thu, 12 Dec 2024 08:48:55 +0100 Subject: [PATCH 1/3] Header fixed, Button hover effect, first run always selected, deselect runs --- ui/runs/static/runs/index.js | 41 ++++++++++- ui/runs/templates/runs/index.html | 109 ++++++++++++++++-------------- 2 files changed, 99 insertions(+), 51 deletions(-) diff --git a/ui/runs/static/runs/index.js b/ui/runs/static/runs/index.js index f7c4bd8e..4f3161b0 100644 --- a/ui/runs/static/runs/index.js +++ b/ui/runs/static/runs/index.js @@ -1,9 +1,46 @@ +// === EVENT LISTENER === + +document.addEventListener('DOMContentLoaded', () => { + // Delete Btns + const delete_btns = document.querySelectorAll('.delete-btn'); + + delete_btns.forEach(button => { + const svg = button.querySelector('svg'); + + button.addEventListener('mouseover', () => { + button.classList.add('btn-red'); + button.classList.remove('btn-grey'); + if (svg) svg.setAttribute('fill', 'white'); + }); + + button.addEventListener('mouseout', () => { + button.classList.add('btn-grey'); + button.classList.remove('btn-red'); + if (svg) svg.setAttribute('fill', 'grey'); + }); + }); + + // mark first run as selected + let first_run = document.getElementById('run-1'); + first_run.style.backgroundColor = '#e8edf3'; + first_run.style.borderRadius = '10px'; + +}); + + +// === FUNCTIONS === function selectRun(runName, runId, numberOfRuns){ for (let i = 1; i <= numberOfRuns; i++) { let run = document.getElementById('run-' + i); if (i == runId) { - run.style.backgroundColor = '#e8edf3'; - run.style.borderRadius = '10px'; + if (run.style.backgroundColor == 'rgb(232, 237, 243)') { + run.style.backgroundColor = 'white'; + } + else { + run.style.backgroundColor = 'rgb(232, 237, 243)'; + run.style.borderRadius = '10px'; + } + } else { run.style.backgroundColor = 'white'; diff --git a/ui/runs/templates/runs/index.html b/ui/runs/templates/runs/index.html index 038ff3dd..7d4e21b3 100644 --- a/ui/runs/templates/runs/index.html +++ b/ui/runs/templates/runs/index.html @@ -9,7 +9,6 @@ {% block js %} - {% endblock %} {% block content %} @@ -48,18 +47,31 @@

Continue an existing run: @@ -134,7 +145,7 @@

Select filters:

- + @@ -168,43 +179,43 @@

Select filters:

+ {% endblock %} From 397d70d12b84f80edfcfe5ae2d0286bcbc2c6592 Mon Sep 17 00:00:00 2001 From: maximilianKalff Date: Thu, 12 Dec 2024 09:16:23 +0100 Subject: [PATCH 2/3] Minor visual changes (text in rows centered; thicker header line, etc.) --- ui/runs/static/runs/index.css | 25 +++++++++++++++++++++++++ ui/runs/static/runs/index.js | 10 ++-------- ui/runs/templates/runs/index.html | 8 ++++++-- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/ui/runs/static/runs/index.css b/ui/runs/static/runs/index.css index 8d568163..f3974efa 100644 --- a/ui/runs/static/runs/index.css +++ b/ui/runs/static/runs/index.css @@ -2,3 +2,28 @@ height:-100vh; } + +/* === RUN SELECTION === */ +ul { + margin: 0; + padding: 0; +} + +ul li { + display: flex; + justify-content: space-between; + align-items: center; + height: 40px; + padding: 0 10px; +} + +.header-list li{ + margin-top: 20px; +} + +/* Continue btn postioning */ + +input[value="Continue"] { + margin-top: 20px; + float: right; +} \ No newline at end of file diff --git a/ui/runs/static/runs/index.js b/ui/runs/static/runs/index.js index 4f3161b0..9f3f20db 100644 --- a/ui/runs/static/runs/index.js +++ b/ui/runs/static/runs/index.js @@ -33,14 +33,8 @@ function selectRun(runName, runId, numberOfRuns){ for (let i = 1; i <= numberOfRuns; i++) { let run = document.getElementById('run-' + i); if (i == runId) { - if (run.style.backgroundColor == 'rgb(232, 237, 243)') { - run.style.backgroundColor = 'white'; - } - else { - run.style.backgroundColor = 'rgb(232, 237, 243)'; - run.style.borderRadius = '10px'; - } - + run.style.backgroundColor = 'rgb(232, 237, 243)'; + run.style.borderRadius = '10px'; } else { run.style.backgroundColor = 'white'; diff --git a/ui/runs/templates/runs/index.html b/ui/runs/templates/runs/index.html index 7d4e21b3..73ebd314 100644 --- a/ui/runs/templates/runs/index.html +++ b/ui/runs/templates/runs/index.html @@ -45,7 +45,7 @@

Continue an existing run: {{ all_available_runs.0.run_name }}

- +