Gitea:
Push für Serveranwendung in Gitea implementiert
Dieser Commit ist enthalten in:
@ -1225,7 +1225,9 @@ class BoardManager {
|
||||
}
|
||||
|
||||
getTasksForDay(tasks, dateStr) {
|
||||
const result = [];
|
||||
// Gruppiere Aufgaben nach Spalte
|
||||
const columnGroups = new Map();
|
||||
const columns = store.get('columns');
|
||||
|
||||
tasks.forEach(task => {
|
||||
const startDate = task.startDate ? task.startDate.split('T')[0] : null;
|
||||
@ -1235,7 +1237,15 @@ class BoardManager {
|
||||
const isEnd = dueDate === dateStr;
|
||||
|
||||
if (isStart || isEnd) {
|
||||
result.push({
|
||||
const columnId = task.columnId;
|
||||
if (!columnGroups.has(columnId)) {
|
||||
const column = columns.find(c => c.id === columnId);
|
||||
columnGroups.set(columnId, {
|
||||
column,
|
||||
tasks: []
|
||||
});
|
||||
}
|
||||
columnGroups.get(columnId).tasks.push({
|
||||
task,
|
||||
isStart,
|
||||
isEnd
|
||||
@ -1243,70 +1253,99 @@ class BoardManager {
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
return columnGroups;
|
||||
}
|
||||
|
||||
renderDayDots(dayTasks, dateStr) {
|
||||
if (dayTasks.length === 0) return '';
|
||||
renderDayDots(columnGroups, dateStr) {
|
||||
if (columnGroups.size === 0) return '';
|
||||
|
||||
const columns = store.get('columns');
|
||||
const users = store.get('users');
|
||||
const dots = [];
|
||||
|
||||
return dayTasks.map(({ task, isStart, isEnd }) => {
|
||||
const column = columns.find(c => c.id === task.columnId);
|
||||
columnGroups.forEach(({ column, tasks }, columnId) => {
|
||||
const color = column?.color || '#6B7280';
|
||||
const taskIds = tasks.map(t => t.task.id).join(',');
|
||||
|
||||
// Bestimme Dot-Typ basierend auf allen Aufgaben der Spalte
|
||||
const hasStart = tasks.some(t => t.isStart);
|
||||
const hasEnd = tasks.some(t => t.isEnd);
|
||||
|
||||
let typeClass = '';
|
||||
if (isStart && isEnd) {
|
||||
if (hasStart && hasEnd) {
|
||||
typeClass = 'both';
|
||||
} else if (isStart) {
|
||||
} else if (hasStart) {
|
||||
typeClass = 'start';
|
||||
} else {
|
||||
typeClass = 'end';
|
||||
}
|
||||
|
||||
return `<span class="week-strip-dot ${typeClass}"
|
||||
style="color: ${color}"
|
||||
data-task-id="${task.id}"
|
||||
data-is-start="${isStart}"
|
||||
data-is-end="${isEnd}"></span>`;
|
||||
}).join('');
|
||||
dots.push(`<span class="week-strip-dot ${typeClass}"
|
||||
style="color: ${color}"
|
||||
data-column-id="${columnId}"
|
||||
data-task-ids="${taskIds}"
|
||||
data-column-name="${this.escapeHtml(column?.name || '')}"></span>`);
|
||||
});
|
||||
|
||||
return dots.join('');
|
||||
}
|
||||
|
||||
showTaskTooltip(event, dot) {
|
||||
const taskId = parseInt(dot.dataset.taskId);
|
||||
const isStart = dot.dataset.isStart === 'true';
|
||||
const isEnd = dot.dataset.isEnd === 'true';
|
||||
const taskIds = dot.dataset.taskIds ? dot.dataset.taskIds.split(',').map(id => parseInt(id)) : [];
|
||||
const columnName = dot.dataset.columnName || 'Unbekannt';
|
||||
const columnId = parseInt(dot.dataset.columnId);
|
||||
|
||||
const task = store.get('tasks').find(t => t.id === taskId);
|
||||
if (!task) return;
|
||||
if (taskIds.length === 0) return;
|
||||
|
||||
const allTasks = store.get('tasks');
|
||||
const columns = store.get('columns');
|
||||
const column = columns.find(c => c.id === task.columnId);
|
||||
const column = columns.find(c => c.id === columnId);
|
||||
const color = column?.color || '#6B7280';
|
||||
|
||||
let typeLabel = '';
|
||||
if (isStart && isEnd) {
|
||||
typeLabel = 'Start & Ende';
|
||||
} else if (isStart) {
|
||||
typeLabel = 'Startdatum';
|
||||
} else {
|
||||
typeLabel = 'Enddatum';
|
||||
}
|
||||
// Sammle alle Aufgaben mit ihren Start/Ende-Infos
|
||||
const tasksWithDates = taskIds.map(taskId => {
|
||||
const task = allTasks.find(t => t.id === taskId);
|
||||
if (!task) return null;
|
||||
|
||||
const dayDate = dot.closest('.week-strip-day')?.dataset.date;
|
||||
const startDate = task.startDate ? task.startDate.split('T')[0] : null;
|
||||
const dueDate = task.dueDate ? task.dueDate.split('T')[0] : null;
|
||||
const isStart = startDate === dayDate;
|
||||
const isEnd = dueDate === dayDate;
|
||||
|
||||
let typeLabel = '';
|
||||
if (isStart && isEnd) {
|
||||
typeLabel = 'Start & Ende';
|
||||
} else if (isStart) {
|
||||
typeLabel = 'Start';
|
||||
} else if (isEnd) {
|
||||
typeLabel = 'Ende';
|
||||
}
|
||||
|
||||
return { task, typeLabel, isStart, isEnd };
|
||||
}).filter(Boolean);
|
||||
|
||||
if (tasksWithDates.length === 0) return;
|
||||
|
||||
// Create tooltip
|
||||
this.hideTooltip();
|
||||
const tooltip = document.createElement('div');
|
||||
tooltip.className = 'week-strip-tooltip';
|
||||
|
||||
const taskCount = tasksWithDates.length;
|
||||
const taskListHtml = tasksWithDates.map(({ task, typeLabel, isStart }) => `
|
||||
<div class="week-strip-tooltip-task">
|
||||
<span class="week-strip-tooltip-task-dot ${isStart ? 'start' : 'end'}" style="color: ${color}"></span>
|
||||
<span class="week-strip-tooltip-task-title">${this.escapeHtml(task.title)}</span>
|
||||
<span class="week-strip-tooltip-task-type">(${typeLabel})</span>
|
||||
</div>
|
||||
`).join('');
|
||||
|
||||
tooltip.innerHTML = `
|
||||
<div class="week-strip-tooltip-title">${this.escapeHtml(task.title)}</div>
|
||||
<div class="week-strip-tooltip-meta">
|
||||
<div class="week-strip-tooltip-type" style="color: ${color}">
|
||||
<span class="dot ${isStart ? 'start' : 'end'}"></span>
|
||||
${typeLabel}
|
||||
</div>
|
||||
${task.startDate ? `<div>Start: ${formatDate(task.startDate)}</div>` : ''}
|
||||
${task.dueDate ? `<div>Ende: ${formatDate(task.dueDate)}</div>` : ''}
|
||||
<div class="week-strip-tooltip-header" style="border-left-color: ${color}">
|
||||
<span class="week-strip-tooltip-column-name">${this.escapeHtml(columnName)}</span>
|
||||
<span class="week-strip-tooltip-count">${taskCount} Aufgabe${taskCount > 1 ? 'n' : ''}</span>
|
||||
</div>
|
||||
<div class="week-strip-tooltip-task-list">
|
||||
${taskListHtml}
|
||||
</div>
|
||||
`;
|
||||
|
||||
@ -1342,7 +1381,12 @@ class BoardManager {
|
||||
|
||||
openTaskFromDot(event, dot) {
|
||||
event.stopPropagation();
|
||||
const taskId = parseInt(dot.dataset.taskId);
|
||||
const taskIds = dot.dataset.taskIds ? dot.dataset.taskIds.split(',').map(id => parseInt(id)) : [];
|
||||
|
||||
if (taskIds.length === 0) return;
|
||||
|
||||
// Öffne die erste Aufgabe
|
||||
const taskId = taskIds[0];
|
||||
|
||||
window.dispatchEvent(new CustomEvent('modal:open', {
|
||||
detail: { modalId: 'task-modal', mode: 'edit', data: { taskId } }
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren