BeKultur/views/partials/header.ejs

90 lines
5 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<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 -->
<link rel="manifest" href="/manifest.json">
<meta name="theme-color" content="#2563eb">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="apple-mobile-web-app-title" content="BeKultur">
<link rel="apple-touch-icon" href="/icons/icon-192.png">
<link rel="icon" type="image/svg+xml" href="/icons/icon.svg">
<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 -->
<div id="offlineBanner" class="offline-banner hidden"></div>
<header class="app-header">
<div class="header-container">
<div class="brand-group">
<a href="/" class="brand-link">
<span class="brand-name">BeKultur</span>
</a>
<% if (typeof studentId !== 'undefined' && studentId) { %>
<nav class="main-nav">
<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>
<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">