chore: remove deprecated static assets and ignore local database
This commit is contained in:
1 parent
a8d75037de
commit
314b82b759
4 files changed
+1
-393
No files matched your search
@@ -36,3 +36,4 @@ venv/
|
|||||||
Thumbs.db
|
Thumbs.db
|
||||||
apps/homepage/config/logs/
|
apps/homepage/config/logs/
|
||||||
|
|
||||||
|
apps/learning/learning.db
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Learning Kanban Board</title>
|
|
||||||
<link rel="stylesheet" href="style.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<header>
|
|
||||||
<h1>🎓 Learning Hub</h1>
|
|
||||||
<button id="add-course-btn" onclick="showModal()">+ Add Course</button>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="kanban-board">
|
|
||||||
<div class="column" id="WIP" ondrop="drop(event)" ondragover="allowDrop(event)">
|
|
||||||
<h2>🚀 WIP</h2>
|
|
||||||
<div class="course-list" id="list-WIP"></div>
|
|
||||||
</div>
|
|
||||||
<div class="column" id="Planning" ondrop="drop(event)" ondragover="allowDrop(event)">
|
|
||||||
<h2>📅 Planning</h2>
|
|
||||||
<div class="course-list" id="list-Planning"></div>
|
|
||||||
</div>
|
|
||||||
<div class="column" id="Archive" ondrop="drop(event)" ondragover="allowDrop(event)">
|
|
||||||
<h2>📦 Archive</h2>
|
|
||||||
<div class="course-list" id="list-Archive"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Modal for adding/editing courses -->
|
|
||||||
<div id="course-modal" class="modal">
|
|
||||||
<div class="modal-content">
|
|
||||||
<h2 id="modal-title">Add New Course</h2>
|
|
||||||
<form id="course-form">
|
|
||||||
<input type="hidden" id="course-id">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Title</label>
|
|
||||||
<input type="text" id="title" required>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Description</label>
|
|
||||||
<textarea id="description"></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Main Link</label>
|
|
||||||
<input type="url" id="main_link" required>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Last Milestone Link</label>
|
|
||||||
<input type="url" id="last_link">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Status</label>
|
|
||||||
<select id="status">
|
|
||||||
<option value="WIP">WIP</option>
|
|
||||||
<option value="Planning">Planning</option>
|
|
||||||
<option value="Archive">Archive</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="modal-actions">
|
|
||||||
<button type="button" onclick="closeModal()">Cancel</button>
|
|
||||||
<button type="submit" id="save-btn">Save</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="script.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
let courses = [];
|
|
||||||
|
|
||||||
async function fetchCourses() {
|
|
||||||
const response = await fetch('/api/courses');
|
|
||||||
courses = await response.json();
|
|
||||||
renderBoard();
|
|
||||||
}
|
|
||||||
|
|
||||||
function renderBoard() {
|
|
||||||
const columns = ['WIP', 'Planning', 'Archive'];
|
|
||||||
columns.forEach(status => {
|
|
||||||
const list = document.getElementById(`list-${status}`);
|
|
||||||
list.innerHTML = '';
|
|
||||||
const filtered = courses.filter(c => c.status === status);
|
|
||||||
filtered.forEach(course => {
|
|
||||||
const card = createCard(course);
|
|
||||||
list.appendChild(card);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function createCard(course) {
|
|
||||||
const card = document.createElement('div');
|
|
||||||
card.className = 'course-card';
|
|
||||||
card.draggable = true;
|
|
||||||
card.id = `course-${course.id}`;
|
|
||||||
card.innerHTML = `
|
|
||||||
<div class="card-actions">
|
|
||||||
<button onclick="editCourse(${course.id})">✏️</button>
|
|
||||||
<button onclick="deleteCourse(${course.id})">🗑️</button>
|
|
||||||
</div>
|
|
||||||
<h3>${course.title}</h3>
|
|
||||||
<p>${course.description || ''}</p>
|
|
||||||
<div class="card-links">
|
|
||||||
<a href="${course.main_link}" target="_blank">Main</a>
|
|
||||||
${course.last_link ? `<a href="${course.last_link}" target="_blank">Milestone</a>` : ''}
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
card.addEventListener('dragstart', (e) => {
|
|
||||||
e.dataTransfer.setData('text/plain', course.id);
|
|
||||||
card.classList.add('dragging');
|
|
||||||
});
|
|
||||||
|
|
||||||
card.addEventListener('dragend', () => {
|
|
||||||
card.classList.remove('dragging');
|
|
||||||
});
|
|
||||||
|
|
||||||
return card;
|
|
||||||
}
|
|
||||||
|
|
||||||
function allowDrop(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function drop(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
const courseId = e.dataTransfer.getData('text/plain');
|
|
||||||
const newStatus = e.currentTarget.id; // The column ID
|
|
||||||
|
|
||||||
const course = courses.find(c => c.id == courseId);
|
|
||||||
if (course && course.status !== newStatus) {
|
|
||||||
course.status = newStatus;
|
|
||||||
await updateCourseOnServer(course);
|
|
||||||
renderBoard();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function updateCourseOnServer(course) {
|
|
||||||
await fetch(`/api/courses/${course.id}`, {
|
|
||||||
method: 'PUT',
|
|
||||||
headers: { 'Content-Type': 'application/json' },
|
|
||||||
body: JSON.stringify(course)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function deleteCourse(id) {
|
|
||||||
if (confirm('Are you sure?')) {
|
|
||||||
await fetch(`/api/courses/${id}`, { method: 'DELETE' });
|
|
||||||
await fetchCourses();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modal Logic
|
|
||||||
const modal = document.getElementById('course-modal');
|
|
||||||
const form = document.getElementById('course-form');
|
|
||||||
|
|
||||||
function showModal(id = null) {
|
|
||||||
modal.style.display = 'block';
|
|
||||||
if (id) {
|
|
||||||
const course = courses.find(c => c.id == id);
|
|
||||||
document.getElementById('modal-title').innerText = 'Edit Course';
|
|
||||||
document.getElementById('course-id').value = course.id;
|
|
||||||
document.getElementById('title').value = course.title;
|
|
||||||
document.getElementById('description').value = course.description || '';
|
|
||||||
document.getElementById('main_link').value = course.main_link;
|
|
||||||
document.getElementById('last_link').value = course.last_link || '';
|
|
||||||
document.getElementById('status').value = course.status;
|
|
||||||
} else {
|
|
||||||
document.getElementById('modal-title').innerText = 'Add New Course';
|
|
||||||
form.reset();
|
|
||||||
document.getElementById('course-id').value = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function closeModal() {
|
|
||||||
modal.style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
form.onsubmit = async (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
const id = document.getElementById('course-id').value;
|
|
||||||
const courseData = {
|
|
||||||
title: document.getElementById('title').value,
|
|
||||||
description: document.getElementById('description').value,
|
|
||||||
main_link: document.getElementById('main_link').value,
|
|
||||||
last_link: document.getElementById('last_link').value,
|
|
||||||
status: document.getElementById('status').value
|
|
||||||
};
|
|
||||||
|
|
||||||
if (id) {
|
|
||||||
await fetch(`/api/courses/${id}`, {
|
|
||||||
method: 'PUT',
|
|
||||||
headers: { 'Content-Type': 'application/json' },
|
|
||||||
body: JSON.stringify(courseData)
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
await fetch('/api/courses', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: { 'Content-Type': 'application/json' },
|
|
||||||
body: JSON.stringify(courseData)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
closeModal();
|
|
||||||
await fetchCourses();
|
|
||||||
};
|
|
||||||
|
|
||||||
window.onclick = (e) => {
|
|
||||||
if (e.target == modal) closeModal();
|
|
||||||
};
|
|
||||||
|
|
||||||
function editCourse(id) {
|
|
||||||
showModal(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initial fetch
|
|
||||||
fetchCourses();
|
|
||||||
@@ -1,175 +0,0 @@
|
|||||||
:root {
|
|
||||||
--bg: #f3f4f6;
|
|
||||||
--column-bg: #e5e7eb;
|
|
||||||
--card-bg: #ffffff;
|
|
||||||
--primary: #2563eb;
|
|
||||||
--text: #1f2937;
|
|
||||||
--border: #d1d5db;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
font-family: -apple-system, sans-serif;
|
|
||||||
background: var(--bg);
|
|
||||||
color: var(--text);
|
|
||||||
margin: 0;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 { margin: 0; }
|
|
||||||
|
|
||||||
#add-course-btn {
|
|
||||||
background: var(--primary);
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
padding: 10px 20px;
|
|
||||||
border-radius: 6px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.kanban-board {
|
|
||||||
display: flex;
|
|
||||||
gap: 20px;
|
|
||||||
align-items: flex-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.column {
|
|
||||||
background: var(--column-bg);
|
|
||||||
border-radius: 8px;
|
|
||||||
width: 300px;
|
|
||||||
min-height: 500px;
|
|
||||||
padding: 15px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.column h2 {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
color: #4b5563;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.05em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-list {
|
|
||||||
min-height: 400px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-card {
|
|
||||||
background: var(--card-bg);
|
|
||||||
border-radius: 6px;
|
|
||||||
padding: 15px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
||||||
cursor: grab;
|
|
||||||
position: relative;
|
|
||||||
border: 1px solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-card:hover {
|
|
||||||
border-color: var(--primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-card.dragging {
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-card h3 {
|
|
||||||
margin: 0 0 8px 0;
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-card p {
|
|
||||||
font-size: 0.85rem;
|
|
||||||
color: #6b7280;
|
|
||||||
margin: 0 0 12px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-links {
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-links a {
|
|
||||||
color: var(--primary);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-actions {
|
|
||||||
position: absolute;
|
|
||||||
top: 10px;
|
|
||||||
right: 10px;
|
|
||||||
display: flex;
|
|
||||||
gap: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-actions button {
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
color: #9ca3af;
|
|
||||||
cursor: pointer;
|
|
||||||
padding: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-actions button:hover {
|
|
||||||
color: var(--text);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Modal Styles */
|
|
||||||
.modal {
|
|
||||||
display: none;
|
|
||||||
position: fixed;
|
|
||||||
z-index: 100;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background: rgba(0,0,0,0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-content {
|
|
||||||
background: white;
|
|
||||||
margin: 10% auto;
|
|
||||||
padding: 2rem;
|
|
||||||
width: 400px;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-group {
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-group label {
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-group input, .form-group textarea, .form-group select {
|
|
||||||
width: 100%;
|
|
||||||
padding: 8px;
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
border-radius: 4px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-actions {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 10px;
|
|
||||||
margin-top: 1.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-actions button {
|
|
||||||
padding: 8px 16px;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user