Deploy from Lumerel

This commit is contained in:
Lumerel Deploy
2026-02-16 23:47:37 +00:00
commit 8e01be1fcd
20 changed files with 1156 additions and 0 deletions

162
public/project.html Normal file
View File

@@ -0,0 +1,162 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TaskIt! - Project Details</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css" rel="stylesheet">
<style>
body {
background-color: #f4f6f9;
font-family: 'Inter', sans-serif;
}
.project-container {
max-width: 1200px;
margin: 2rem auto;
}
.task-card {
border-radius: 15px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
transition: transform 0.3s ease;
}
.task-card:hover {
transform: translateY(-5px);
}
.status-created { background-color: #e9ecef; color: #6c757d; }
.status-in_progress { background-color: #ffc107; color: white; }
.status-testing { background-color: #17a2b8; color: white; }
.status-complete { background-color: #28a745; color: white; }
.status-approved { background-color: #007bff; color: white; }
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
<div class="container">
<a class="navbar-brand" href="/dashboard.html">TaskIt!</a>
<button class="btn btn-outline-danger" id="logoutBtn">Logout</button>
</div>
</nav>
<div class="project-container">
<div class="row">
<div class="col-md-4">
<div class="card mb-4">
<div class="card-body">
<h5 class="card-title">Create New Task</h5>
<form id="newTaskForm">
<div class="mb-3">
<input type="text" class="form-control" placeholder="Task Name" required>
</div>
<div class="mb-3">
<textarea class="form-control" placeholder="Task Description" rows="3" required></textarea>
</div>
<div class="mb-3">
<select class="form-control" required>
<option value="created">Created</option>
<option value="in_progress">In Progress</option>
<option value="testing">Testing</option>
<option value="complete">Complete</option>
<option value="approved">Approved</option>
</select>
</div>
<button type="submit" class="btn btn-primary w-100">Create Task</button>
</form>
</div>
</div>
</div>
<div class="col-md-8">
<div id="projectHeader" class="mb-4">
<h2 id="projectName"></h2>
<p id="projectDescription"></p>
</div>
<div id="taskList">
<!-- Tasks will be dynamically loaded here -->
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
const urlParams = new URLSearchParams(window.location.search);
const projectId = urlParams.get('id');
// Logout Handler
document.getElementById('logoutBtn').addEventListener('click', async () => {
try {
const response = await fetch('/api/logout', { method: 'POST' });
const result = await response.json();
if (result.success) {
window.location.href = '/index.html';
}
} catch (error) {
console.error('Logout error:', error);
}
});
// Load Project Details
async function loadProjectDetails() {
try {
const response = await fetch(`/api/projects/${projectId}`);
const data = await response.json();
document.getElementById('projectName').textContent = data.project.name;
document.getElementById('projectDescription').textContent = data.project.description;
const taskList = document.getElementById('taskList');
taskList.innerHTML = data.tasks.map(task => `
<div class="card task-card mb-3">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<div>
<h5 class="card-title">${task.name}</h5>
<p class="card-text">${task.description}</p>
</div>
<div class="task-status status-${task.status} px-2 py-1 rounded">
${task.status.replace('_', ' ')}
</div>
</div>
</div>
</div>
`).join('');
} catch (error) {
console.error('Project details load error:', error);
}
}
// Create New Task
document.getElementById('newTaskForm').addEventListener('submit', async function(e) {
e.preventDefault();
const name = this.querySelector('input[type="text"]').value;
const description = this.querySelector('textarea').value;
const status = this.querySelector('select').value;
try {
const response = await fetch('/api/tasks', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
name,
description,
project_id: projectId,
status
})
});
const result = await response.json();
if (result) {
loadProjectDetails();
this.reset();
}
} catch (error) {
console.error('Task creation error:', error);
}
});
// Initial Load
loadProjectDetails();
</script>
</body>
</html>