Update anban, kanban (~3)
This commit is contained in:
@@ -155,11 +155,18 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
min-height: 24px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.task-date {
|
||||
font-size: var(--text-xs);
|
||||
color: var(--text-muted);
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
padding-right: var(--space-2);
|
||||
}
|
||||
|
||||
.task-priority {
|
||||
@@ -173,12 +180,14 @@
|
||||
.priority-low { background: var(--success); }
|
||||
|
||||
.task-actions {
|
||||
display: none;
|
||||
display: flex;
|
||||
gap: var(--space-1);
|
||||
opacity: 0;
|
||||
transition: opacity var(--transition-fast);
|
||||
}
|
||||
|
||||
.task:hover .task-actions {
|
||||
display: flex;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.task-action {
|
||||
@@ -545,14 +554,46 @@
|
||||
searchTasks();
|
||||
}
|
||||
|
||||
function formatDateTime(isoStr) {
|
||||
if (!isoStr) return '';
|
||||
const d = new Date(isoStr);
|
||||
if (isNaN(d.getTime())) return isoStr; // fallback for old format
|
||||
const day = d.getDate().toString().padStart(2, '0');
|
||||
const month = (d.getMonth() + 1).toString().padStart(2, '0');
|
||||
const year = d.getFullYear();
|
||||
const hours = d.getHours().toString().padStart(2, '0');
|
||||
const mins = d.getMinutes().toString().padStart(2, '0');
|
||||
const secs = d.getSeconds().toString().padStart(2, '0');
|
||||
return `${day}/${month}/${year} ${hours}:${mins}:${secs}`;
|
||||
}
|
||||
|
||||
function calcDuration(created, completed) {
|
||||
if (!created || !completed) return '';
|
||||
const start = new Date(created);
|
||||
const end = new Date(completed);
|
||||
if (isNaN(start.getTime()) || isNaN(end.getTime())) return '';
|
||||
const diffMs = end - start;
|
||||
if (diffMs < 0) return '';
|
||||
const mins = Math.floor(diffMs / 60000);
|
||||
if (mins < 60) return `${mins}m`;
|
||||
const hours = Math.floor(mins / 60);
|
||||
if (hours < 24) return `${hours}h ${mins % 60}m`;
|
||||
const days = Math.floor(hours / 24);
|
||||
return `${days}d ${hours % 24}h`;
|
||||
}
|
||||
|
||||
function renderTask(task) {
|
||||
const hasDesc = task.description && task.description.trim();
|
||||
const startTime = formatDateTime(task.created);
|
||||
const duration = calcDuration(task.created, task.completed);
|
||||
const timeInfo = duration ? `${startTime} (${duration})` : startTime;
|
||||
|
||||
return `
|
||||
<div class="task" draggable="true" data-task-id="${task.id}" onclick="toggleTaskExpand(event, this)">
|
||||
<div class="task-title" contenteditable="true" onblur="updateTask('${task.id}', 'title', this.textContent)">${task.title}</div>
|
||||
${hasDesc ? `<div class="task-desc" contenteditable="true" onblur="updateTask('${task.id}', 'description', this.textContent)">${task.description}</div>` : ''}
|
||||
<div class="task-footer">
|
||||
<span class="task-date">${task.completed || task.created}</span>
|
||||
<span class="task-date">${timeInfo || task.completed || task.created}</span>
|
||||
<div class="task-actions">
|
||||
<button class="task-action" onclick="event.stopPropagation(); cyclePriority('${task.id}')" title="Prioritate">
|
||||
<i data-lucide="flag"></i>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"lastUpdated": "2026-01-29T11:53:32.969Z",
|
||||
"lastUpdated": "2026-01-29T14:54:25.803288Z",
|
||||
"columns": [
|
||||
{
|
||||
"id": "backlog",
|
||||
@@ -182,6 +182,22 @@
|
||||
"description": "https://www.youtube.com/watch?v=l94A53kIUB0",
|
||||
"created": "2026-01-29",
|
||||
"priority": "high"
|
||||
},
|
||||
{
|
||||
"id": "task-028",
|
||||
"title": "ANAF Monitor - verificare (test)",
|
||||
"description": "Testare manuală cron job",
|
||||
"created": "2026-01-29",
|
||||
"priority": "medium",
|
||||
"completed": "2026-01-29"
|
||||
},
|
||||
{
|
||||
"id": "task-029",
|
||||
"title": "Test sortare timestamp",
|
||||
"description": "Verificare sortare",
|
||||
"created": "2026-01-29T14:54:17Z",
|
||||
"priority": "medium",
|
||||
"completed": "2026-01-29T14:54:25Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ def add_task(column_id, title, description="", priority="medium"):
|
||||
"id": get_next_id(data),
|
||||
"title": title,
|
||||
"description": description,
|
||||
"created": datetime.now().strftime("%Y-%m-%d"),
|
||||
"created": datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"),
|
||||
"priority": priority
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ def move_task(task_id, to_column):
|
||||
|
||||
# Add to new column
|
||||
if to_column == 'done':
|
||||
task['completed'] = datetime.now().strftime("%Y-%m-%d")
|
||||
task['completed'] = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ")
|
||||
|
||||
for col in data['columns']:
|
||||
if col['id'] == to_column:
|
||||
|
||||
Reference in New Issue
Block a user