Deadline-sarake ekaksi tehtävälistassa, käynnissä-rivit vihreällä

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 13:39:40 +02:00
parent e3891463e9
commit 40879b3db1
3 changed files with 5 additions and 3 deletions

View File

@@ -474,12 +474,12 @@
<table class="data-table" id="tasks-table" style="display:none;">
<thead>
<tr>
<th>Deadline</th>
<th>Status</th>
<th>Prioriteetti</th>
<th>Tyyppi</th>
<th>Tehtävä</th>
<th>Vastuuhenkilö</th>
<th>Deadline</th>
<th>Tunnit</th>
<th>&#128172;</th>
</tr>

View File

@@ -3975,14 +3975,14 @@ function renderTasksList() {
tbody.innerHTML = tasks.map(t => {
const overdue = t.deadline && t.status !== 'valmis' && t.deadline < today;
const soon = t.deadline && t.status !== 'valmis' && !overdue && t.deadline <= new Date(Date.now()+3*86400000).toISOString().slice(0,10);
const rowClass = overdue ? 'todo-row-overdue' : (soon ? 'todo-row-soon' : (t.status === 'valmis' ? 'todo-row-done' : ''));
const rowClass = overdue ? 'todo-row-overdue' : (soon ? 'todo-row-soon' : (t.status === 'kaynnissa' ? 'todo-row-active' : (t.status === 'valmis' ? 'todo-row-done' : '')));
return `<tr class="${rowClass}" onclick="openTaskRead('${t.id}')" style="cursor:pointer;">
<td class="nowrap">${t.deadline ? `<span${overdue ? ' style="color:#e74c3c;font-weight:600;"' : (soon ? ' style="color:#f39c12;font-weight:600;"' : '')}>${t.deadline}</span>` : '<span style="color:#ccc;">—</span>'}</td>
<td><span class="todo-status status-${t.status}">${todoStatusLabels[t.status]||t.status}</span></td>
<td><span class="priority-badge priority-${t.priority}">${todoPriorityLabels[t.priority]||t.priority}</span></td>
<td>${t.category ? `<span class="todo-category cat-${t.category}">${todoCategoryLabels[t.category]||t.category}</span>` : '<span style="color:#ccc;">—</span>'}</td>
<td><strong>${esc(t.title)}</strong></td>
<td>${t.assigned_to ? esc(t.assigned_to) : '<span style="color:#ccc;">—</span>'}</td>
<td class="nowrap">${t.deadline ? `<span${overdue ? ' style="color:#e74c3c;font-weight:600;"' : (soon ? ' style="color:#f39c12;font-weight:600;"' : '')}>${t.deadline}</span>` : '<span style="color:#ccc;">—</span>'}</td>
<td style="text-align:center;">${t.total_hours > 0 ? t.total_hours + 'h' : '<span style="color:#ccc;">—</span>'}</td>
<td style="text-align:center;">${t.comment_count > 0 ? t.comment_count : ''}</td>
</tr>`;

View File

@@ -1133,6 +1133,8 @@ span.empty {
.todo-row-overdue:hover { background:#fde8e8 !important; }
.todo-row-soon { background:#fffbeb !important; }
.todo-row-soon:hover { background:#fef3c7 !important; }
.todo-row-active { background:#ecfdf5 !important; }
.todo-row-active:hover { background:#d1fae5 !important; }
.todo-row-done { opacity:0.55; }
.todo-row-done:hover { opacity:0.75; }
.priority-badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:0.72rem; font-weight:600; }