Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion Api/wwwroot/js/kanban.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,25 @@ function selectElementText(element) {
========================= */

function createTaskCard(task, column, columnIndex, taskIndex) {
const color = task.color || column.color || "#ef6a35";
const columnTitle = String(
column.title ??
column.name ??
column.Title ??
column.Name ??
""
).trim().toLowerCase();

const isDoneColumn =
column.done === true ||
column.isDone === true ||
column.Done === true ||
column.IsDone === true ||
columnTitle === "done" ||
columnTitle === "готово";

const color = isDoneColumn
? "#407d52"
: task.color || column.color || "#ef6a35";
const doneLabel = column.done ? "Дата выполнения" : "Дедлайн";

const tags = [
Expand All @@ -514,6 +532,8 @@ function createTaskCard(task, column, columnIndex, taskIndex) {

const card = document.createElement("article");
card.className = "task-card is-draggable";
console.log("COLUMN:", column);
console.log("TASK:", task.title, "COLOR:", color);
card.style.setProperty("--task-color", color);
card.dataset.taskId = task.id;
card.dataset.columnId = column.id;
Expand Down