BeKultur/views/private-lessons.ejs

206 lines
8.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.

<%- include('partials/header') %>
<div class="content-container">
<!-- Top Bar -->
<div class="dashboard-top-row">
<div>
<h1 class="page-title"><%= t('privateLessons.title') %></h1>
<p class="page-subtitle">
<%= t('privateLessons.subtitle') %>
<% if (lastSynced) { %>
• <span class="sync-time"><%= t('privateLessons.syncedLabel') %> <%= new Date(lastSynced).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) %></span>
<% } %>
</p>
</div>
<div class="sync-actions">
<button type="button" class="btn btn-primary btn-sm" id="btnSyncPrivateLessons">
<%= t('privateLessons.syncBtn') %>
</button>
</div>
</div>
<div id="privateLessonsAlert" class="alert alert-info hidden"></div>
<!-- Student Info Card -->
<% if (formMeta) { %>
<div class="student-profile-card">
<div class="student-profile-main">
<% if (formMeta.photoUrl) { %>
<img src="<%= formMeta.photoUrl %>" alt="<%= formMeta.studentName %>" class="student-avatar" />
<% } %>
<div class="student-meta">
<h3 class="student-name"><%= formMeta.studentName %></h3>
<p class="student-school"><%= formMeta.schoolName %> • <%= formMeta.className %></p>
<% if (detectedAdvisor) { %>
<div class="student-advisor-badge">
<span class="advisor-badge-label"><%= t('privateLessons.advisorLabel') %></span>
<strong><%= detectedAdvisor %></strong>
</div>
<% } %>
</div>
</div>
<div class="student-policy-note">
<span class="policy-icon">ℹ</span>
<span><%= t('privateLessons.policyNote') %></span>
</div>
</div>
<% } %>
<!-- Request Form Card -->
<div class="request-form-card">
<div class="form-card-header">
<h2 class="section-title"><%= t('privateLessons.requestTitle') %></h2>
<span class="form-header-badge"><%= t('privateLessons.onlineBadge') %></span>
</div>
<form id="privateLessonForm" class="private-lesson-form">
<% if (formMeta) { %>
<input type="hidden" name="ogrenciDonemId" id="ogrenciDonemId" value="<%= formMeta.ogrenciDonemId %>" />
<input type="hidden" name="okulId" id="okulId" value="<%= formMeta.okulId %>" />
<input type="hidden" name="sinifId" id="sinifId" value="<%= formMeta.sinifId %>" />
<% } else { %>
<input type="hidden" name="ogrenciDonemId" id="ogrenciDonemId" value="" />
<input type="hidden" name="okulId" id="okulId" value="" />
<input type="hidden" name="sinifId" id="sinifId" value="" />
<% } %>
<div class="form-grid-3">
<!-- Course Select -->
<div class="form-group">
<label for="selectCourse" class="form-label"><%= t('privateLessons.courseLabel') %></label>
<select id="selectCourse" name="dersId" class="form-select" required>
<option value=""><%= t('privateLessons.selectPrompt') %></option>
<% if (formMeta && formMeta.courses) { %>
<% formMeta.courses.forEach(function(course) { %>
<option value="<%= course.id %>"><%= course.name %></option>
<% }); %>
<% } %>
</select>
</div>
<!-- Unit Select -->
<div class="form-group">
<label for="selectUnit" class="form-label">
<%= t('privateLessons.unitLabel') %>
<span id="unitLoading" class="select-loading hidden"><%= t('privateLessons.loading') %></span>
</label>
<select id="selectUnit" name="uniteId" class="form-select" disabled required>
<option value=""><%= t('privateLessons.selectCourseFirst') %></option>
</select>
</div>
<!-- Topic Select -->
<div class="form-group">
<label for="selectTopic" class="form-label">
<%= t('privateLessons.topicLabel') %>
<span id="topicLoading" class="select-loading hidden"><%= t('privateLessons.loading') %></span>
</label>
<select id="selectTopic" name="konuId" class="form-select" disabled required>
<option value=""><%= t('privateLessons.selectUnitFirst') %></option>
</select>
</div>
</div>
<div class="form-actions-row">
<button type="submit" id="btnSubmitRequest" class="btn btn-primary" disabled>
<%= t('privateLessons.submitBtn') %>
</button>
</div>
<div id="formFeedback" class="form-feedback hidden"></div>
</form>
</div>
<!-- Lessons Section -->
<div class="lessons-section">
<div class="lessons-header-row">
<div class="lessons-title-wrap">
<h2 class="section-title"><%= t('privateLessons.myLessonsTitle') %></h2>
<span class="lessons-count-badge" id="lessonsCountBadge"><%= allLessons.length %></span>
</div>
<!-- Subject Filters -->
<% if (subjects.length > 0) { %>
<div class="subject-filter-pills" id="subjectFilterPills">
<button type="button" class="subject-pill-btn active" data-subject="all"><%= t('privateLessons.filterAll') %></button>
<% subjects.forEach(function(sub) { %>
<button type="button" class="subject-pill-btn" data-subject="<%= sub %>"><%= sub %></button>
<% }); %>
</div>
<% } %>
</div>
<!-- Upcoming Lessons -->
<% if (upcomingLessons.length > 0) { %>
<div class="upcoming-lessons-group" id="upcomingGroup">
<div class="group-header">
<span class="group-title"><%= t('privateLessons.upcomingGroupTitle') %></span>
<span class="badge badge-active"><%= t('privateLessons.activeCountBadge', { count: upcomingLessons.length }) %></span>
</div>
<div class="lessons-grid">
<% upcomingLessons.forEach(function(item) { %>
<div class="lesson-card is-upcoming" data-subject="<%= item.subject %>">
<div class="lesson-card-header">
<span class="badge badge-active"><%= t('privateLessons.upcomingBadge') %></span>
<span class="lesson-date"><%= item.date %></span>
</div>
<div class="lesson-card-body">
<% if (item.teacherPhoto) { %>
<img src="<%= item.teacherPhoto %>" alt="<%= item.teacherName %>" class="lesson-teacher-photo" />
<% } else { %>
<div class="lesson-teacher-placeholder"><%= item.teacherName ? item.teacherName[0] : 'Ö' %></div>
<% } %>
<div class="lesson-info">
<h4 class="lesson-subject"><%= item.subject %></h4>
<p class="lesson-teacher"><%= item.teacherName %></p>
</div>
</div>
</div>
<% }); %>
</div>
</div>
<% } %>
<!-- Past Lessons -->
<div class="past-lessons-group" id="pastGroup">
<div class="group-header">
<span class="group-title"><%= t('privateLessons.pastGroupTitle') %></span>
<span class="badge badge-type"><%= t('privateLessons.pastCountBadge', { count: pastLessons.length }) %></span>
</div>
<% if (pastLessons.length === 0 && upcomingLessons.length === 0) { %>
<div class="empty-lessons-card">
<p><%= t('privateLessons.emptyState') %></p>
</div>
<% } else { %>
<div class="lessons-grid" id="pastLessonsGrid">
<% pastLessons.forEach(function(item) { %>
<div class="lesson-card is-past" data-subject="<%= item.subject %>">
<div class="lesson-card-header">
<span class="badge badge-type"><%= t('privateLessons.completedBadge') %></span>
<span class="lesson-date"><%= item.date %></span>
</div>
<div class="lesson-card-body">
<% if (item.teacherPhoto) { %>
<img src="<%= item.teacherPhoto %>" alt="<%= item.teacherName %>" class="lesson-teacher-photo" />
<% } else { %>
<div class="lesson-teacher-placeholder"><%= item.teacherName ? item.teacherName[0] : 'Ö' %></div>
<% } %>
<div class="lesson-info">
<h4 class="lesson-subject"><%= item.subject %></h4>
<p class="lesson-teacher"><%= item.teacherName %></p>
</div>
</div>
</div>
<% }); %>
</div>
<% } %>
</div>
</div>
</div>
<script src="/js/private-lessons.js"></script>
<%- include('partials/footer') %>