feat: upgrade to SQLite session & data store with zero-data-loss migration, dark theme, and Turkish i18n
This commit is contained in:
parent
1af973d001
commit
56274f479b
27 changed files with 4222 additions and 1360 deletions
|
|
@ -1,8 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="<%= typeof lang !== 'undefined' ? lang : 'tr' %>">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<script>
|
||||
(function() {
|
||||
try {
|
||||
var saved = localStorage.getItem('color-scheme');
|
||||
var meta = document.querySelector('meta[name="color-scheme"]');
|
||||
if (saved === 'dark' || saved === 'light') {
|
||||
if (meta) meta.content = saved;
|
||||
document.documentElement.setAttribute('data-theme', saved);
|
||||
} else {
|
||||
if (meta) meta.content = 'light dark';
|
||||
var sysDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
document.documentElement.setAttribute('data-theme', sysDark ? 'dark' : 'light');
|
||||
}
|
||||
} catch (e) {}
|
||||
})();
|
||||
</script>
|
||||
<title><%= typeof title !== 'undefined' ? title : 'BeKultur' %></title>
|
||||
|
||||
<!-- PWA & Mobile Web App Meta Tags -->
|
||||
|
|
@ -16,6 +33,19 @@
|
|||
<link rel="icon" type="image/png" sizes="192x192" href="/icons/icon-192.png">
|
||||
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
<script>
|
||||
window.BeKulturLang = "<%= typeof lang !== 'undefined' ? lang : 'tr' %>";
|
||||
window.BeKulturDict = <%- typeof i18nJson !== 'undefined' ? i18nJson : '{}' %>;
|
||||
window.BeKulturT = function(key, params) {
|
||||
var str = (window.BeKulturDict && window.BeKulturDict[key]) || key;
|
||||
if (params) {
|
||||
Object.keys(params).forEach(function(k) {
|
||||
str = str.replace(new RegExp('\\{' + k + '\\}', 'g'), String(params[k]));
|
||||
});
|
||||
}
|
||||
return str;
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Offline Indicator Banner -->
|
||||
|
|
@ -29,19 +59,32 @@
|
|||
</a>
|
||||
<% if (typeof studentId !== 'undefined' && studentId) { %>
|
||||
<nav class="main-nav">
|
||||
<a href="/dashboard" class="nav-item <%= typeof title !== 'undefined' && title.includes('Dashboard') ? 'active' : '' %>">Homework</a>
|
||||
<a href="/syllabus" class="nav-item <%= typeof title !== 'undefined' && title.includes('Syllabus') ? 'active' : '' %>">Syllabus</a>
|
||||
<a href="/private-lessons" class="nav-item <%= typeof title !== 'undefined' && title.includes('Private Lessons') ? 'active' : '' %>">Private Lessons</a>
|
||||
<a href="/exams" class="nav-item <%= typeof title !== 'undefined' && title.includes('Exam') ? 'active' : '' %>">Exams</a>
|
||||
<a href="/dashboard" class="nav-item <%= (typeof activePage !== 'undefined' && activePage === 'dashboard') || (typeof title !== 'undefined' && (title.includes('Dashboard') || title.includes('Ödev'))) ? 'active' : '' %>"><%= typeof t === 'function' ? t('nav.homework') : 'Ödevler' %></a>
|
||||
<a href="/syllabus" class="nav-item <%= (typeof activePage !== 'undefined' && activePage === 'syllabus') || (typeof title !== 'undefined' && (title.includes('Syllabus') || title.includes('Ders Programı'))) ? 'active' : '' %>"><%= typeof t === 'function' ? t('nav.syllabus') : 'Ders Programı' %></a>
|
||||
<a href="/private-lessons" class="nav-item <%= (typeof activePage !== 'undefined' && activePage === 'private-lessons') || (typeof title !== 'undefined' && (title.includes('Private Lessons') || title.includes('Özel Ders'))) ? 'active' : '' %>"><%= typeof t === 'function' ? t('nav.privateLessons') : 'Özel Ders' %></a>
|
||||
<a href="/exams" class="nav-item <%= (typeof activePage !== 'undefined' && activePage === 'exams') || (typeof title !== 'undefined' && (title.includes('Exam') || title.includes('Sınav'))) ? 'active' : '' %>"><%= typeof t === 'function' ? t('nav.exams') : 'Sınav Raporları' %></a>
|
||||
</nav>
|
||||
<% } %>
|
||||
</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 class="user-nav">
|
||||
<!-- Language Switcher (TR Default / EN) -->
|
||||
<div class="lang-switcher" role="group" aria-label="<%= typeof t === 'function' ? t('header.langToggleTitle') : 'Dil Seçimi' %>">
|
||||
<a href="/lang/tr" class="lang-btn <%= (typeof lang === 'undefined' || lang === 'tr') ? 'active' : '' %>" data-lang="tr">TR</a>
|
||||
<a href="/lang/en" class="lang-btn <%= (typeof lang !== 'undefined' && lang === 'en') ? 'active' : '' %>" data-lang="en">EN</a>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<!-- Theme Toggle Button -->
|
||||
<button type="button" id="themeToggleBtn" class="btn-icon-toggle" title="<%= typeof t === 'function' ? t('header.themeToggle') : 'Tema Değiştir' %>" aria-label="<%= typeof t === 'function' ? t('header.themeToggle') : 'Tema Değiştir' %>">
|
||||
<span class="theme-icon theme-icon-sun" aria-hidden="true">☀️</span>
|
||||
<span class="theme-icon theme-icon-moon" aria-hidden="true">🌙</span>
|
||||
</button>
|
||||
|
||||
<% if (typeof studentId !== 'undefined' && studentId) { %>
|
||||
<span class="user-id"><%= typeof t === 'function' ? t('header.student') : 'Öğrenci' %>: <%= studentId %></span>
|
||||
<a href="/logout" class="btn btn-outline btn-sm"><%= typeof t === 'function' ? t('header.logout') : 'Çıkış Yap' %></a>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main class="main-content">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue