init
This commit is contained in:
commit
5577214005
22 changed files with 4997 additions and 0 deletions
232
views/dashboard.ejs
Normal file
232
views/dashboard.ejs
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
<%- include('partials/header') %>
|
||||
|
||||
<div class="dashboard-wrapper">
|
||||
<!-- Top Bar -->
|
||||
<div class="dashboard-topbar">
|
||||
<div class="dashboard-title-area">
|
||||
<h1 class="dashboard-title">Homework</h1>
|
||||
<p class="dashboard-subtitle">
|
||||
Student <strong>#<%= studentId %></strong>
|
||||
<span class="dot-separator">•</span>
|
||||
<span id="syncStatus">
|
||||
<% if (lastSynced) { %>
|
||||
Last synced: <%= new Date(lastSynced).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) %>
|
||||
<% } else { %>
|
||||
Not synced
|
||||
<% } %>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="sync-actions">
|
||||
<button type="button" class="btn btn-secondary btn-sm" id="btnSyncRecent">
|
||||
Sync Recent
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" id="btnSyncAll">
|
||||
Sync Full History
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="syncAlert" class="alert alert-info hidden"></div>
|
||||
|
||||
<!-- Summary Stats -->
|
||||
<div class="stats-grid">
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">Completion</div>
|
||||
<div class="stat-value" id="statCompletionRate"><%= stats.completionRate %>%</div>
|
||||
<div class="stat-subtext" id="statCompletionFraction"><%= stats.completed %> / <%= stats.total %> done</div>
|
||||
<div class="progress-bar-container">
|
||||
<div class="progress-bar-fill" id="progressBarFill" style="width: <%= stats.completionRate %>%"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">Active</div>
|
||||
<div class="stat-value" id="statActiveCount"><%= stats.active %></div>
|
||||
<div class="stat-subtext">In progress</div>
|
||||
</div>
|
||||
|
||||
<div class="stat-card stat-highlight">
|
||||
<div class="stat-label">Checked Next Week</div>
|
||||
<div class="stat-value" id="statNextWeekCount"><%= stats.checkedNextWeek %></div>
|
||||
<div class="stat-subtext">Due or checked next week</div>
|
||||
</div>
|
||||
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">Due Soon</div>
|
||||
<div class="stat-value" id="statDueSoonCount"><%= stats.dueSoon %></div>
|
||||
<div class="stat-subtext">Within 3 days</div>
|
||||
</div>
|
||||
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">Overdue</div>
|
||||
<div class="stat-value" id="statOverdueCount"><%= stats.overdue %></div>
|
||||
<div class="stat-subtext">Past deadline</div>
|
||||
</div>
|
||||
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">Total</div>
|
||||
<div class="stat-value" id="statTotalCount"><%= stats.total %></div>
|
||||
<div class="stat-subtext">All assignments</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Subjects Overview (Collapsible) -->
|
||||
<div class="section-card">
|
||||
<div class="section-header cursor-pointer" id="subjectToggleHeader">
|
||||
<span class="section-title">Subjects (<%= Object.keys(stats.bySubject).length %>)</span>
|
||||
<span class="toggle-indicator" id="subjectToggleIcon">▼</span>
|
||||
</div>
|
||||
<div class="subject-breakdown-body" id="subjectBreakdownBody">
|
||||
<div class="subject-grid" id="subjectGrid">
|
||||
<% Object.values(stats.bySubject).forEach(function(subj) { %>
|
||||
<div class="subject-item" data-subject="<%= subj.subject %>">
|
||||
<div class="subject-info">
|
||||
<span class="subject-name"><%= subj.subject %></span>
|
||||
<span class="subject-fraction"><%= subj.completed %>/<%= subj.total %> (<%= subj.percentage %>%)</span>
|
||||
</div>
|
||||
<div class="subject-bar">
|
||||
<div class="subject-bar-fill" style="width: <%= subj.percentage %>%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% }); %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Toolbar: Tabs & Search -->
|
||||
<div class="toolbar-card">
|
||||
<div class="filter-tabs" id="filterTabs">
|
||||
<button type="button" class="tab-btn active" data-filter="all">
|
||||
All (<span id="tabAllCount"><%= stats.total %></span>)
|
||||
</button>
|
||||
<button type="button" class="tab-btn" data-filter="next-week">
|
||||
Checked Next Week (<span id="tabNextWeekCount"><%= stats.checkedNextWeek %></span>)
|
||||
</button>
|
||||
<button type="button" class="tab-btn" data-filter="active">
|
||||
Active (<span id="tabActiveCount"><%= stats.active %></span>)
|
||||
</button>
|
||||
<button type="button" class="tab-btn" data-filter="due-soon">
|
||||
Due Soon (<span id="tabDueSoonCount"><%= stats.dueSoon %></span>)
|
||||
</button>
|
||||
<button type="button" class="tab-btn" data-filter="completed">
|
||||
Completed (<span id="tabCompletedCount"><%= stats.completed %></span>)
|
||||
</button>
|
||||
<button type="button" class="tab-btn" data-filter="overdue">
|
||||
Overdue (<span id="tabOverdueCount"><%= stats.overdue %></span>)
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="filter-controls">
|
||||
<div class="search-box">
|
||||
<input
|
||||
type="text"
|
||||
id="searchInput"
|
||||
class="search-input"
|
||||
placeholder="Filter by subject, book, or description..."
|
||||
>
|
||||
<button type="button" id="searchClear" class="search-clear hidden">×</button>
|
||||
</div>
|
||||
|
||||
<div class="select-box">
|
||||
<select id="subjectSelect" class="form-select">
|
||||
<option value="">All Subjects</option>
|
||||
<% subjects.forEach(function(s) { %>
|
||||
<option value="<%= s %>"><%= s %></option>
|
||||
<% }); %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list-meta">
|
||||
<span id="filteredCountText">Showing <%= assignments.length %> assignments</span>
|
||||
</div>
|
||||
|
||||
<!-- Empty Search State -->
|
||||
<div id="noResults" class="empty-state hidden">
|
||||
<p>No matching assignments found.</p>
|
||||
<button type="button" class="btn btn-secondary btn-sm" id="btnResetFilters">Reset filters</button>
|
||||
</div>
|
||||
|
||||
<!-- Assignments -->
|
||||
<div class="assignment-list" id="assignmentList">
|
||||
<% assignments.forEach(function(item) { %>
|
||||
<div
|
||||
class="assignment-card <%= item.completed ? 'is-completed' : '' %> status-<%= item.status %>"
|
||||
data-id="<%= item.id %>"
|
||||
data-status="<%= item.status %>"
|
||||
data-subject="<%= item.subject %>"
|
||||
data-completed="<%= item.completed ? 'true' : 'false' %>"
|
||||
data-search="<%= (item.subject + ' ' + item.description + ' ' + (item.detectedCheckDate || '') + ' ' + (item.topic || '') + ' ' + (item.unit || '')).toLowerCase() %>"
|
||||
>
|
||||
<div class="card-checkbox-col">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="assignment-toggle"
|
||||
data-id="<%= item.id %>"
|
||||
<%= item.completed ? 'checked' : '' %>
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="card-content-col">
|
||||
<div class="card-top-row">
|
||||
<div class="card-subject-wrap">
|
||||
<span class="card-subject"><%= item.subject %></span>
|
||||
<% if (item.type) { %>
|
||||
<span class="badge badge-type"><%= item.type %></span>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<div class="card-badges">
|
||||
<% if (item.detectedCheckDate) { %>
|
||||
<span class="badge badge-check-date">
|
||||
Kontrol: <%= item.detectedCheckDate %>
|
||||
</span>
|
||||
<% } %>
|
||||
|
||||
<% if (item.completed) { %>
|
||||
<span class="badge badge-completed">Done</span>
|
||||
<% } else if (item.status === 'next-week') { %>
|
||||
<span class="badge badge-next-week">Next Week</span>
|
||||
<% } else if (item.status === 'due-soon') { %>
|
||||
<span class="badge badge-due-soon">Due Soon</span>
|
||||
<% } else if (item.status === 'overdue') { %>
|
||||
<span class="badge badge-overdue">Overdue</span>
|
||||
<% } else { %>
|
||||
<span class="badge badge-active">Active</span>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if (item.unit || item.topic) { %>
|
||||
<div class="card-sub-meta">
|
||||
<% if (item.unit) { %><span><strong>Ünite:</strong> <%= item.unit %></span><% } %>
|
||||
<% if (item.topic) { %><span><strong>Konu:</strong> <%= item.topic %></span><% } %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<div class="card-description">
|
||||
<%= item.description %>
|
||||
</div>
|
||||
|
||||
<div class="card-footer-row">
|
||||
<div class="card-dates">
|
||||
<span><%= item.startDate %> — <strong><%= item.endDate %></strong></span>
|
||||
</div>
|
||||
|
||||
<div class="card-timestamps">
|
||||
<% if (item.completed && item.completedAt) { %>
|
||||
<span class="completed-timestamp">Done: <%= new Date(item.completedAt).toLocaleDateString() %></span>
|
||||
<% } %>
|
||||
<span class="card-hash">#<%= item.id %></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% }); %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%- include('partials/footer') %>
|
||||
65
views/login.ejs
Normal file
65
views/login.ejs
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<%- include('partials/header') %>
|
||||
|
||||
<div class="auth-wrapper">
|
||||
<div class="auth-card">
|
||||
<h1 class="auth-title">BeKultur</h1>
|
||||
<p class="auth-subtitle">Log in with your school portal credentials.</p>
|
||||
|
||||
<% if (typeof error !== 'undefined' && error) { %>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<span class="alert-text"><%= error %></span>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<form action="/login" method="POST" class="auth-form" id="loginForm">
|
||||
<div class="form-group">
|
||||
<label for="studentId" class="form-label">Student ID</label>
|
||||
<input
|
||||
type="text"
|
||||
id="studentId"
|
||||
name="studentId"
|
||||
class="form-control"
|
||||
placeholder="Student ID"
|
||||
value="<%= typeof rememberedId !== 'undefined' ? rememberedId : '' %>"
|
||||
required
|
||||
autofocus
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input
|
||||
type="password"
|
||||
id="password"
|
||||
name="password"
|
||||
class="form-control"
|
||||
placeholder="Password"
|
||||
required
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="form-row-between">
|
||||
<label class="checkbox-label">
|
||||
<input type="checkbox" name="rememberMe" value="true" checked>
|
||||
<span>Remember credentials</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary btn-block" id="submitBtn">
|
||||
Log In
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById('loginForm').addEventListener('submit', function() {
|
||||
var btn = document.getElementById('submitBtn');
|
||||
btn.disabled = true;
|
||||
btn.textContent = 'Logging in...';
|
||||
});
|
||||
</script>
|
||||
|
||||
<%- include('partials/footer') %>
|
||||
9
views/partials/footer.ejs
Normal file
9
views/partials/footer.ejs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
</main>
|
||||
<footer class="app-footer">
|
||||
<div class="footer-container">
|
||||
<span class="footer-text">BeKultur</span>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="/js/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
25
views/partials/header.ejs
Normal file
25
views/partials/header.ejs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><%= typeof title !== 'undefined' ? title : 'BeKultur' %></title>
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header class="app-header">
|
||||
<div class="header-container">
|
||||
<div class="brand">
|
||||
<a href="/" class="brand-link">
|
||||
<span class="brand-name">BeKultur</span>
|
||||
</a>
|
||||
</div>
|
||||
<% if (typeof studentId !== 'undefined' && studentId) { %>
|
||||
<div class="user-nav">
|
||||
<span class="user-id">Student: <%= studentId %></span>
|
||||
<a href="/logout" class="btn btn-outline btn-sm">Log out</a>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</header>
|
||||
<main class="main-content">
|
||||
Loading…
Add table
Add a link
Reference in a new issue