групировка фаилов

This commit is contained in:
2026-02-05 21:22:17 +05:00
parent dc1471b4fb
commit 220a356574
2 changed files with 120 additions and 120 deletions

View File

@@ -103,29 +103,6 @@ function removeEditFile(index) {
document.getElementById('edit-files').files = dataTransfer.files;
}
async function loadTaskFiles(taskId) {
try {
const response = await fetch(`/api/tasks/${taskId}/files`);
const files = await response.json();
const container = document.getElementById(`files-${taskId}`);
if (container) {
if (files.length === 0) {
container.innerHTML = '<strong>Файлы:</strong> <span class="files-placeholder">скрыто</span>';
} else {
container.innerHTML = `
<strong>Файлы:</strong>
<div class="file-icons-container">
${files.map(file => renderFileIcon(file)).join('')}
</div>
`;
}
}
} catch (error) {
console.error('Ошибка загрузки файлов:', error);
}
}
function renderFileIcon(file) {
// Исправляем кодировку имени файла
const fixEncoding = (str) => {