203 lines
8.3 KiB
Text
203 lines
8.3 KiB
Text
<%- include('partials/header') %>
|
|
|
|
<div class="syllabus-wrapper">
|
|
<!-- Top Bar -->
|
|
<div class="dashboard-topbar">
|
|
<div class="dashboard-title-area">
|
|
<h1 class="dashboard-title"><%= t('syllabus.title') %></h1>
|
|
<p class="dashboard-subtitle">
|
|
<%= t('syllabus.weekLabel') %> <strong><%= weekRange %></strong> (<%= weekId %>)
|
|
<span class="dot-separator">•</span>
|
|
<span id="syllabusSyncStatus">
|
|
<% if (lastSynced) { %>
|
|
<%= t('syllabus.syncedLabel') %> <%= new Date(lastSynced).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) %>
|
|
<% } else { %>
|
|
<%= t('syllabus.notSynced') %>
|
|
<% } %>
|
|
</span>
|
|
</p>
|
|
</div>
|
|
|
|
<div class="sync-actions">
|
|
<button type="button" class="btn btn-primary btn-sm" id="btnSyncSyllabus">
|
|
<%= t('syllabus.syncBtn') %>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="syllabusAlert" class="alert alert-info hidden"></div>
|
|
|
|
<!-- Real-Time Lesson Status -->
|
|
<% if (currentStatus && currentStatus.statusText) { %>
|
|
<div class="live-period-banner">
|
|
<span class="live-dot">●</span>
|
|
<span><%= currentStatus.statusText %></span>
|
|
</div>
|
|
<% } %>
|
|
|
|
<!-- Controls Card: Station Selector & View Toggle -->
|
|
<div class="toolbar-card">
|
|
<div class="station-select-row">
|
|
<span class="toolbar-label"><%= t('syllabus.stationLabel') %></span>
|
|
<div class="station-pills" id="stationPills">
|
|
<button type="button" class="station-btn <%= selectedStation === 'İst-1' ? 'active' : '' %>" data-station="İst-1">İst-1</button>
|
|
<button type="button" class="station-btn <%= selectedStation === 'İst-2' ? 'active' : '' %>" data-station="İst-2">İst-2</button>
|
|
<button type="button" class="station-btn <%= selectedStation === 'İst-3' ? 'active' : '' %>" data-station="İst-3">İst-3</button>
|
|
<button type="button" class="station-btn <%= selectedStation === 'İst-4' || !selectedStation ? 'active' : '' %>" data-station="İst-4">İst-4</button>
|
|
<button type="button" class="station-btn <%= selectedStation === 'İst-5' ? 'active' : '' %>" data-station="İst-5">İst-5</button>
|
|
<button type="button" class="station-btn <%= selectedStation === 'all' ? 'active' : '' %>" data-station="all"><%= t('syllabus.allStations') %></button>
|
|
</div>
|
|
</div>
|
|
|
|
<% if (typeof advisoryTeacher !== 'undefined' && advisoryTeacher) { %>
|
|
<div class="advisor-row">
|
|
<span class="toolbar-label"><%= t('syllabus.advisorLabel') %></span>
|
|
<div class="advisor-pill">
|
|
<span class="advisor-name"><%= advisoryTeacher %></span>
|
|
<span class="advisor-sub"><%= t('syllabus.advisoryTag') %></span>
|
|
</div>
|
|
</div>
|
|
<% } %>
|
|
|
|
<div class="view-toggle-row">
|
|
<span class="toolbar-label"><%= t('syllabus.viewLabel') %></span>
|
|
<div class="view-toggle-pills" id="viewTogglePills">
|
|
<button type="button" class="view-btn active" data-view="day"><%= t('syllabus.dayView') %></button>
|
|
<button type="button" class="view-btn" data-view="week"><%= t('syllabus.weekView') %></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Day View Container -->
|
|
<div id="dayViewContainer" class="schedule-view-section">
|
|
<!-- Day Tabs -->
|
|
<div class="day-tabs" id="dayTabs">
|
|
<% [1, 2, 3, 4, 5].forEach(function(d) { %>
|
|
<% const isToday = (new Date().getDay() === d); %>
|
|
<button
|
|
type="button"
|
|
class="day-tab-btn <%= activeDay === d ? 'active' : '' %>"
|
|
data-day="<%= d %>"
|
|
>
|
|
<span><%= DAY_NAMES[d] %></span>
|
|
<% if (isToday) { %>
|
|
<span class="today-badge"><%= t('syllabus.todayBadge') %></span>
|
|
<% } %>
|
|
<span class="day-count-badge"><%= (filteredSchedule[d] || []).length %></span>
|
|
</button>
|
|
<% }); %>
|
|
</div>
|
|
|
|
<!-- Day Lessons List -->
|
|
<% [1, 2, 3, 4, 5].forEach(function(d) { %>
|
|
<div class="day-schedule-panel <%= activeDay === d ? '' : 'hidden' %>" id="panelDay<%= d %>">
|
|
<% const lessons = filteredSchedule[d] || []; %>
|
|
<% if (lessons.length === 0) { %>
|
|
<div class="empty-state">
|
|
<p><%= t('syllabus.noLessonsDay', { day: DAY_NAMES[d] }) %></p>
|
|
</div>
|
|
<% } else { %>
|
|
<div class="timetable-list">
|
|
<% lessons.forEach(function(l) { %>
|
|
<div class="timetable-row">
|
|
<div class="period-col">
|
|
<span class="period-num"><%= l.period %></span>
|
|
<span class="period-time"><%= l.time %></span>
|
|
</div>
|
|
|
|
<div class="subject-col">
|
|
<div class="subject-title"><%= l.subject %></div>
|
|
<div class="teacher-info">
|
|
<% if (l.teacherPhoto) { %>
|
|
<img src="<%= l.teacherPhoto %>" class="teacher-thumb" alt="<%= l.teacher %>" onerror="this.style.display='none'">
|
|
<% } %>
|
|
<span class="teacher-name"><%= l.teacher %></span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="station-col">
|
|
<% if (l.station) { %>
|
|
<span class="station-badge"><%= l.station %></span>
|
|
<% } else { %>
|
|
<span class="class-badge"><%= t('syllabus.classBadge') %></span>
|
|
<% } %>
|
|
</div>
|
|
</div>
|
|
<% }); %>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
<% }); %>
|
|
</div>
|
|
|
|
<!-- Full Week Grid View Container -->
|
|
<div id="weekViewContainer" class="schedule-view-section hidden">
|
|
<div class="table-responsive">
|
|
<table class="week-grid-table">
|
|
<thead>
|
|
<tr>
|
|
<th class="grid-time-th"><%= t('syllabus.periodHeader') %></th>
|
|
<% [1, 2, 3, 4, 5].forEach(function(d) { %>
|
|
<% const isToday = (new Date().getDay() === d); %>
|
|
<th class="<%= isToday ? 'grid-today-th' : '' %>">
|
|
<%= DAY_NAMES[d] %>
|
|
<% if (isToday) { %><span class="grid-today-pill"><%= t('syllabus.todayBadge') %></span><% } %>
|
|
</th>
|
|
<% }); %>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<%
|
|
// Discover max periods across all days
|
|
let maxPeriod = 1;
|
|
[1, 2, 3, 4, 5].forEach(d => {
|
|
(filteredSchedule[d] || []).forEach(l => {
|
|
if (l.periodNumber > maxPeriod) maxPeriod = l.periodNumber;
|
|
});
|
|
});
|
|
%>
|
|
<% for (let p = 1; p <= maxPeriod; p++) { %>
|
|
<tr>
|
|
<td class="grid-period-cell">
|
|
<div class="grid-period-title"><%= p %>. Ders</div>
|
|
<%
|
|
// Find sample time
|
|
let sampleTime = '';
|
|
for (let d = 1; d <= 5; d++) {
|
|
const match = (filteredSchedule[d] || []).find(l => l.periodNumber === p);
|
|
if (match && match.time) { sampleTime = match.time; break; }
|
|
}
|
|
%>
|
|
<% if (sampleTime) { %>
|
|
<div class="grid-period-time"><%= sampleTime %></div>
|
|
<% } %>
|
|
</td>
|
|
|
|
<% [1, 2, 3, 4, 5].forEach(function(d) { %>
|
|
<% const dayLessons = (filteredSchedule[d] || []).filter(l => l.periodNumber === p); %>
|
|
<td class="grid-lesson-cell <%= dayLessons.length > 0 ? 'has-lesson' : '' %>">
|
|
<% if (dayLessons.length > 0) { %>
|
|
<% dayLessons.forEach(function(lesson) { %>
|
|
<div class="grid-lesson-item">
|
|
<div class="grid-lesson-subject"><%= lesson.subject %></div>
|
|
<div class="grid-lesson-teacher"><%= lesson.teacher %></div>
|
|
<% if (lesson.station) { %>
|
|
<span class="grid-station-tag"><%= lesson.station %></span>
|
|
<% } %>
|
|
</div>
|
|
<% }); %>
|
|
<% } else { %>
|
|
<span class="grid-empty-cell">—</span>
|
|
<% } %>
|
|
</td>
|
|
<% }); %>
|
|
</tr>
|
|
<% } %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/js/syllabus.js"></script>
|
|
<%- include('partials/footer') %>
|